Hello!

I am try to build a cupsaddsmb without a userpassword.
I added a new switch (-P) , this new flag makes it possible to add the
printerdriver to the samba-server without knowing the password of a
printeradmin.

the smbclient commands are working fine, but the rpcclient-commands didn't
work.
the rpcclient commands don't work.

Now my question?

Which user do I have to add at the smb.conf parameter
I tried something like + or +
but nothing works.

Here the output of cupsaddsmb with -v -P
--------------------------------------------------------
../cupsaddsmbX -H cobu0035 -P -v cobp0708
Running command: smbclient //cobu0035/print\$ -N -c 'mkdir
W32X86;put /var/spool/cups/tmp/41cac5bccf835
W32X86/cobp0708.ppd;put /usr/share/cups/drivers/ps5ui.dll
W32X86/ps5ui.dll;put /usr/share/cups/drivers/pscript.hlp
W32X86/pscript.hlp;put /usr/share/cups/drivers/pscript.ntf
W32X86/pscript.ntf;put /usr/share/cups/drivers/pscript5.dll
W32X86/pscript5.dll'
Anonymous login successful
Domain=[BROSE] OS=[Unix] Server=[Samba 3.0.10-0.2-SUSE]
NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
putting file /var/spool/cups/tmp/41cac5bccf835 as \W32X86/cobp0708.ppd
(1525.3 kb/s) (average 1525.3 kb/s)
putting file /usr/share/cups/drivers/ps5ui.dll as \W32X86/ps5ui.dll (6289.4
kb/s) (average 2352.1 kb/s)
putting file /usr/share/cups/drivers/pscript.hlp as \W32X86/pscript.hlp
(4240.8 kb/s) (average 2441.4 kb/s)
putting file /usr/share/cups/drivers/pscript.ntf as \W32X86/pscript.ntf
(7167.3 kb/s) (average 4613.3 kb/s)
putting file /usr/share/cups/drivers/pscript5.dll as \W32X86/pscript5.dll
(6963.3 kb/s) (average 5128.6 kb/s)

Running command: rpcclient cobu0035 -P -N -c 'adddriver "Windows NT x86"
"cobp0708script5.dll:cobp0708.ppds5ui.dllscript.hlp:NULL:RAWscript.ntf"'
added interface ip=127.0.0.1 bcast=127.255.255.255 nmask=255.0.0.0
added interface ip=172.31.74.29 bcast=172.31.74.255 nmask=255.255.255.0
Connecting to host=cobu0035
Connecting to 172.31.74.29 at port 445
Doing spnego session setup (blob length=95)
got OID=1 2 840 113554 1 2 2
got OID=1 2 840 48018 1 2 2
got OID=1 3 6 1 4 1 311 2 2 10
got principal=cobu0035$@BROSE.NET
Doing kerberos session setup
Ticket in ccache[MEMORY:cliconnect] expiration Fri, 24 Dec 2004 00:19:00 GMT
lsa_io_sec_qos: length c does not match size 8
Printer Driver cobp0708 successfully installed.

Running command: smbclient //cobu0035/print\$ -N -c 'mkdir
WIN40;put /var/spool/cups/tmp/41cac5bccf835
WIN40/cobp0708.PPD;put /usr/share/cups/drivers/ADFONTS.MFM
WIN40/ADFONTS.MFM;put /usr/share/cups/drivers/ADOBEPS4.DRV
WIN40/ADOBEPS4.DRV;put /usr/share/cups/drivers/ADOBEPS4.HLP
WIN40/ADOBEPS4.HLP;put /usr/share/cups/drivers/ICONLIB.DLL
WIN40/ICONLIB.DLL;put /usr/share/cups/drivers/PSMON.DLL WIN40/PSMON.DLL;'
Anonymous login successful
Domain=[BROSE] OS=[Unix] Server=[Samba 3.0.10-0.2-SUSE]
NT_STATUS_OBJECT_NAME_COLLISION making remote directory \WIN40
putting file /var/spool/cups/tmp/41cac5bccf835 as \WIN40/cobp0708.PPD
(2383.3 kb/s) (average 2383.3 kb/s)
putting file /usr/share/cups/drivers/ADFONTS.MFM as \WIN40/ADFONTS.MFM
(4763.4 kb/s) (average 3926.5 kb/s)
putting file /usr/share/cups/drivers/ADOBEPS4.DRV as \WIN40/ADOBEPS4.DRV
(7038.2 kb/s) (average 5473.7 kb/s)
putting file /usr/share/cups/drivers/ADOBEPS4.HLP as \WIN40/ADOBEPS4.HLP
(6330.0 kb/s) (average 5551.2 kb/s)
putting file /usr/share/cups/drivers/ICONLIB.DLL as \WIN40/ICONLIB.DLL
(6408.8 kb/s) (average 5588.3 kb/s)
putting file /usr/share/cups/drivers/PSMON.DLL as \WIN40/PSMON.DLL (5599.9
kb/s) (average 5588.6 kb/s)

Running command: rpcclient cobu0035 -P -N -c 'adddriver "Windows 4.0"
"cobp0708:ADOBEPS4.DRV:cobp0708.PPD:NULL:ADOBEPS4.H LP:PSMON.DLL:RAW:ADOBEPS4.DRV,
cobp0708.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM,IC ONLIB.DLL"'
added interface ip=127.0.0.1 bcast=127.255.255.255 nmask=255.0.0.0
added interface ip=172.31.74.29 bcast=172.31.74.255 nmask=255.255.255.0
Connecting to host=cobu0035
Connecting to 172.31.74.29 at port 445
Doing spnego session setup (blob length=95)
got OID=1 2 840 113554 1 2 2
got OID=1 2 840 48018 1 2 2
got OID=1 3 6 1 4 1 311 2 2 10
got principal=cobu0035$@BROSE.NET
Doing kerberos session setup
Ticket in ccache[MEMORY:cliconnect] expiration Fri, 24 Dec 2004 00:19:01 GMT
lsa_io_sec_qos: length c does not match size 8
Printer Driver cobp0708 successfully installed.

Running command: rpcclient cobu0035 -P -N -c 'setdriver cobp0708 cobp0708'
added interface ip=127.0.0.1 bcast=127.255.255.255 nmask=255.0.0.0
added interface ip=172.31.74.29 bcast=172.31.74.255 nmask=255.255.255.0
Connecting to host=cobu0035
Connecting to 172.31.74.29 at port 445
Doing spnego session setup (blob length=95)
got OID=1 2 840 113554 1 2 2
got OID=1 2 840 48018 1 2 2
got OID=1 3 6 1 4 1 311 2 2 10
got principal=cobu0035$@BROSE.NET
Doing kerberos session setup
Ticket in ccache[MEMORY:cliconnect] expiration Fri, 24 Dec 2004 00:19:01 GMT
lsa_io_sec_qos: length c does not match size 8
result was WERR_ACCESS_DENIED

Segmentation fault




Here the diff to the cupsaddsmb 1.1.22
--------------------------------------------------------

diff cupsaddsmb.c cupsaddsmb.c.1.1.22
107,110d106
< else if (strcmp(argv[i], "-P") == 0)
< {
< SAMBAUser = NULL;
< }
411,412d406
< if (SAMBAUser != NULL)
< {
414,425d407
< {
< snprintf(temp, sizeof(temp),
< "Password for %s required to access %s via SAMBA: ",
< SAMBAUser, SAMBAServer);
<
< if ((p = cupsGetPassword(temp)) == NULL)
< break;
< }
<
< snprintf(temp, sizeof(temp), "%s -N -U\'%s%%%s\' -c \'%s\'",
command, SAMBAUser, p, subcmd);
< }
< else
427c409,414
< snprintf(temp, sizeof(temp), "%s -N -c \'%s\'", command, subcmd);
---
> snprintf(temp, sizeof(temp),
> "Password for %s required to access %s via SAMBA: ",
> SAMBAUser, SAMBAServer);
>
> if ((p = cupsGetPassword(temp)) == NULL)
> break;

429a417,419
> snprintf(temp, sizeof(temp), "%s -N -U\'%s%%%s\' -c \'%s\'",
> command, SAMBAUser, p, subcmd);
>

682c672
< snprintf(command, sizeof(command), "rpcclient %s -P", SAMBAServer);
---
> snprintf(command, sizeof(command), "rpcclient %s", SAMBAServer);

724c714
< snprintf(command, sizeof(command), "rpcclient %s -P", SAMBAServer);
---
> snprintf(command, sizeof(command), "rpcclient %s", SAMBAServer);

748c738
< snprintf(command, sizeof(command), "rpcclient %s -P", SAMBAServer);
---
> snprintf(command, sizeof(command), "rpcclient %s", SAMBAServer);

841d830
< puts(" -P Authenticate by machine");