[Samba] Problem with rpcclient command

Kurt Pfeifle kpfeifle at danka.de
Mon Jul 28 23:35:17 GMT 2003


Thomas Bork tombork at web.de wrote on Samba-Digest:

> Mon Jul 28 22:00:56 GMT 2003
> 
> Hi Rob Tanner,
> 
> you wrote:
> 
>> The response I get is:
>> Initialising global parameters
>> params.c:pm_process() - Processing configuration file
>> "/etc/samba/smb.conf" Processing section "[global]"
>> added interface ip=10.219.255.249 bcast=10.219.255.255
>> nmask=255.255.0.0 resolve_lmhosts: Attempting lmhosts lookup for name
>> abert<0x20>
>> Connecting to host=abert share=IPC$
>> Connecting to 10.225.25.100 at port 445
>> lsa_io_sec_qos: length c does not match size 8
>> cmd = getdriver "HP LaserJet 8000 Series PS"
>> Error opening printer handle for HP LaserJet 8000 Series PS!
>> result was NT_STATUS_UNSUCCESSFUL
> 
> Sorry, I cannot help you. I'm only a man with rpcclient problems too:
> 
> vmeis 1.0 # cupsaddsmb -U root -a -v
> Password for root required to access localhost via SAMBA:
> Running command: smbclient //localhost/print\$ -N -U'root%xxx' -c 'mkdir
> W32X86;put /var/spool/cups/tmp/3f1aaa72b068a W32X86/drucker1.ppd;put
> /usr/share/cups/drivers/cupsdrvr.dll W32X86/cupsdrvr.dll;put
> /usr/share/cups/drivers/cupsui.dll W32X86/cupsui.dll;put
> /usr/share/cups/drivers/cups.hlp W32X86/cups.hlp'
> added interface ip=127.0.0.1 bcast=127.255.255.255 nmask=255.0.0.0
> added interface ip=192.168.0.4 bcast=192.168.0.255 nmask=255.255.255.0
> Domain=[TOMMAIK] OS=[Unix] Server=[Samba 2.2.8a]
> NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
> putting file /var/spool/cups/tmp/3f1aaa72b068a as \W32X86/drucker1.ppd
> (1869.7 kb/s) (average 1869.7 kb/s)
> putting file /usr/share/cups/drivers/cupsdrvr.dll as
> \W32X86/cupsdrvr.dll (10874.2 kb/s) (average 9373.5 kb/s)
> putting file /usr/share/cups/drivers/cupsui.dll as \W32X86/cupsui.dll
> (9164.7 kb/s) (average 9282.9 kb/s)
> putting file /usr/share/cups/drivers/cups.hlp as \W32X86/cups.hlp
> (4633.3 kb/s) (average 9033.8 kb/s)
> ######################################
> OK
> ######################################
> 
> Running command: rpcclient localhost -N -U'root%xxx' -c 'adddriver
> "Windows NT x86"
> "drucker1:cupsdrvr.dll:drucker1.ppd:cupsui.dll:cups.hlp:NULL:RAW:NULL"'
> cmd = adddriver "Windows NT x86"
> "drucker1:cupsdrvr.dll:drucker1.ppd:cupsui.dll:cups.hlp:NULL:RAW:NULL"
> Printer Driver drucker1 successfully installed.
> ######################################
> OK
> #######################################
> 
> Running command: rpcclient localhost -N -U'root%xxx' -c 'setdriver
> drucker1 drucker1'
> cmd = setdriver drucker1 drucker1
> SetPrinter call failed!
> result was NT_STATUS_UNSUCCESSFUL
> #######################################
> NOT OK
> #######################################
> 
> 
> vmeis 1.0 # rpcclient -Uroot%xxx -c 'enumprinters' localhost | grep -C2
> drucker1
> cmd = enumprinters
>         flags:[0x800000]
>         name:[\\localhost\drucker1]
>         description:[\\localhost\drucker1,,Parallel_in_Tommis_Absteige]
>         comment:[Parallel_in_Tommis_Absteige]
> vmeis 1.0 # rpcclient -Uroot%xxx -c 'getprinter drucker1 2' localhost |
> grep driver
>         drivername:[]
> vmeis 1.0 # rpcclient -Uroot%xxx -c 'getprinter drucker1 2' localhost |
> grep -C4 driv
>         servername:[\\localhost]
>         printername:[\\localhost\drucker1]
>         sharename:[drucker1]
>         portname:[Samba Printer Port]
>         drivername:[]
>         comment:[Parallel_in_Tommis_Absteige]
>         location:[]
>         sepfile:[]
>         printprocessor:[winprint]
> 
> vmeis 1.0 # rpcclient -Uroot%xxx -c 'getdriver drucker1' localhost
> cmd = getdriver drucker1
> vmeis 1.0 # rpcclient -Uroot%xxx -c 'enumdrivers 3' localhost |
> grep -B2 -A5 drucker1
> #####################################################################
> No output
> #####################################################################
> 
> No output? Samba doesn't recognizing printer drivers,

This is most likely a wrong interpretation of what you are seeing.
The "enumdrivers 3" subcommand segfaults in many versions of
Samba-2.2.x. Try a simple "enumdrivers" command and you should
see the "driver1" listed, since your above quoted "adddriver" command
*did* install it.

> but they are here:
> 

Of course they are. Your "adddriver" command succeeded, and told
you so.

What failed was the "setdriver" command. The "setdriver" command
associates a driver to the printer(name).

> vmeis 1.0 # ls -l /samba_printer_drivers/W32X86/
> total 4
> drwxr--r--    2 root     root         4096 Jul 20 17:24 2
> vmeis 1.0 # ls -l /samba_printer_drivers/W32X86/2
> total 520
> -rwxr--r--    1 root     root        14234 Jul 20 18:09 cups.hlp
> -rwxr--r--    1 root     root       278380 Jul 20 18:09 cupsdrvr.dll
> -rwxr--r--    1 root     root       215848 Jul 20 18:09 cupsui.dll
> -rwxr--r--    1 root     root         9573 Jul 20 18:09 drucker1.ppd
> 
> vmeis 1.0 # rpcclient -Uroot%xxx -c 'enumdrivers 3' localhost
> cmd = enumdrivers 3
> 
> [Windows NT x86]
> Segmentation fault
> ##############################################
> 

What does "rpcclient -Uroot%xxx -c 'enumdrivers' localhost" give?
And what "rpcclient -Uroot%xxx -c 'enumdrivers 2' localhost"?

> vmeis 1.0 # rpcclient -d 3 -Uroot%xxx -c 'enumdrivers 3' localhost
> Initialising global parameters
> params.c:pm_process() - Processing configuration file "/etc/smb.conf"
> Processing section "[global]"
> added interface ip=127.0.0.1 bcast=127.255.255.255 nmask=255.0.0.0
> added interface ip=192.168.0.4 bcast=192.168.0.255 nmask=255.255.255.0
> resolve_lmhosts: Attempting lmhosts lookup for name localhost<0x20>
> resolve_hosts: Attempting host lookup for name localhost<0x20>
> Connecting to host=localhost share=IPC$
> Connecting to 127.0.0.1 at port 445
> error connecting to 127.0.0.1:445 (Connection refused)
> Connecting to 127.0.0.1 at port 139
> lsa_io_sec_qos: length c does not match size 8
> cmd = enumdrivers 3
> 
> [Windows NT x86]
> Segmentation fault
> ################################################
> 
> Above is a similar message as in you mail:
> lsa_io_sec_qos: length c does not match size 8
> 

This doesn't hurt. I have it for all my completely successfull
"cupsaddsmb" or "rpcclient enumdrivers" commands....

> Maybe this is the problem?
> 

No.

> My configuration:
> Samba is _not_ linked to cups

I *believe* this should *not* be causing the particular errors
you are seeing.

I currently have no advice for you other than trying to get level
3, 5 and 10 Samba logs with maybe more insight-providing messages.

> Samba version is 2.2.8a
> 
> cupsaddsmb and rpcclient are successfull, if samba is linked to cups.
> But I want to print to cups over samba per lpr commands (because some
> users of eisfair want to use lprng and other want to use cups)

Strange reasoning. So you want to please CUPS users by offering CUPS
*at least* partial support. In order to please the LPRng users, you
offer *only* partial CUPS support....

Why don't you *link* Samba against libcups (as you say: then your
rpcclient commands work...) and configure Samba using

     [global]
          ....
          printing = sysv
          printcap = lpstat
          ....

     [printername]
         print command = whatever-you-are-pleased-with.sh

     #there is a similar example in the new HOWTO Collection


(as then you can use any print command you like)??  [But be aware,
that you should have the the "LPRng" version of the "lpr"-command
and the CUPS version of it under 2 different names on your system,
since the CUPS version is using IPP to print, and that your Samba
print command uses the right one...]

> and there
> is only one samba package for that and the point and print functions
> should be used.
> 
> 
> der tom
> 

Cheers,
Kurt




More information about the samba mailing list