Fwd: Re: Using rpcclient to install printer drivers

T. William Schmidt wschmidt at starband.net
Mon Oct 22 09:09:02 GMT 2001


Hi Jerry Carter and list members,

The post below was rejected by the list moderator as too big.  That cost me 
four days and now I am really anxious for positive feedback from rpcclient 
experts either in the field or at samba.org.  It was too big because I 
included a listing of STDERR and STDOUT from setting debug level to 10 in 
step #4 of install_printer_drivers.pl.  I have trimmed it down by removing 
some of that trace, but it may no longer be 100% useful in isolating this 
rpcclient problem.  Let me know if more of the trace is needed and I will 
send it as an attachment.

>I am getting a fatal Signal 11 event when I use install_printer_drivers.pl 
>on AIX 4.3.3 with Samba 2.2.1a so I would like to bring you up to date on 
>my testing and get some additional advice.
>
>Here is a quick and dirty summary of what I did, so far.  If you want me 
>to elaborate further I shall but I will keep this message as short as 
>possible and let the logs speak for themselves.
>
>I downloaded from Source Forge all the Perl files associated with 
>install_printer_drivers.pl, including mkprintpkg.pl.
>
> From the admin of our NT printer server group I obtained the exploded 
> driver package for the HP DesignJet 750 series.  There is nothing magic 
> about this package.  It is representative of what we are trying to 
> achieve and was chosen at random to prove the concept.
>
>I had to modify HP_750_1.INF that came with the package in order to use it 
>with mkprintpkg.pl.  Specifically I had to uncomment the Signature= 
>expression for Windows NT (only Chicago was enabled), remove a reference 
>to PSCRIPT.CNT and add a [Manufacturer] section title.  mkprintpkg.pl is 
>very informative what kind of changes it requires to the .INF so that part 
>was easy though alarming that it was necessary.  After these hacks I was 
>able to create the package containing a control file defined as:
>
>[common]
>name=hp750
>version=1.0
>display_name="HP DesignJet 750C"
>
>[W32X86]
>inf_fname=HP_750_1.INF
>manufacturer="HP"
>model="HP DesignJet 750C/PS"
>
>I then modified install_printer_drivers.pl to disable downloading the 
>driver package from the imprints server at samba.org and directly call the 
>Perl function install_package() passing a file reference to the package I 
>created with mkprintpkg.pl. The net result of this was the Signal 11.  The 
>Samba log called out the error in 
>printing/nt_printing.c:move_driver_to_download_area(1389) which I 
>determined to be in Step #4 in Perl rpc_client_wrapper() so I increased 
>the debug level argument to 10 in the rpcclient "addprinter" call and got 
>the following logs:
>
> From log.smbd:
>
>   vistadev (170.2.0.224) connect to service print$ as user jftl64 
> (uid=402, gid=318) (pid 21306)
>[2001/10/18 10:06:50, 0] 
>printing/nt_printing.c:move_driver_to_download_area(1389)
>   move_driver_to_download_area: Unable to rename [W32X86/_] to [W32X86/2/_]

Notice here a new_name/old_name reference to a file in the driver 
collection resolves to '_'.  Is this faulty tokenizing?

>[2001/10/18 10:06:50, 1] smbd/service.c:close_cnum(646)
>   vistadev (170.2.0.224) closed connection to service print$
>[2001/10/18 10:06:50, 0] lib/fault.c:fault_report(40)
>   ===============================================================
>[2001/10/18 10:06:50, 0] lib/fault.c:fault_report(41)
>   INTERNAL ERROR: Signal 11 in pid 21308 (2.2.1a)
>   Please read the file BUGS.txt in the distribution
>[2001/10/18 10:06:50, 0] lib/fault.c:fault_report(43)
>   ===============================================================
>[2001/10/18 10:06:50, 0] lib/util.c:smb_panic(1101)
>   PANIC: internal error
>
> From redirecting STDOUT and STDERR from executing 
> install_printer_driver.pl with Step #4 set to -d 10:
>
>Exploding package...
>Installing package...
>[rpc]: Printer Driver Information :
>[rpc]:     Printer Model   = HP DesignJet 750C/PS
>[rpc]:     Environment     = W32X86
>[rpc]:     Driver Filename = PSCRIPT.DLL
>[rpc]:     Data Filename   = HP_750_1.PPD
>[rpc]:     Config Filename = PSCRPTUI.DLL
>[rpc]:     Help Filename   = PSCRIPT.HLP
>[rpc]: Installing Windows NT x86 drivers for HP DesignJet 750C/PS...
>rpcclient vistadev -d 1 -A /home/imisexp/src/perl/.user -c "getdriverdir 
>\"Windows NT x86\""
>INFO: Debug class all level = 1   (pid 33210 from pid 33210)
>session setup ok
>Domain=[CORP] OS=[Unix] Server=[Samba 2.2.1a]
>         Directory Name:[\\VISTADEV\print$\W32X86]
>[rpc]: Printer Driver Upload Directory = \\VISTADEV\print$\W32X86
>CWD: /tmp/aaaMMxWia/install/W32X86
>total 912
>drwxr-xr-x   2 root     system       512 Oct 18 10:06 .
>drwxr-xr-x   3 root     system       512 Oct 18 10:06 ..
>-rw-r--r--   1 root     system     29690 Oct 18 10:06 hp_750_1.ppd
>-rw-r--r--   1 root     system    225648 Oct 18 10:06 pscript.dll
>-rw-r--r--   1 root     system     14234 Oct 18 10:06 pscript.hlp
>-rw-r--r--   1 root     system    179472 Oct 18 10:06 pscrptui.dll
>smbclient //VISTADEV/print$ -A /home/imisexp/src/perl/.user -d 1 -c 
>"prompt; cd W32X86; put hp_750_1.ppd; put pscrptui.dll; put pscript.hlp; 
>put pscript.dll"
>INFO: Debug class all level = 1   (pid 33212 from pid 33212)
>added interface ip=170.2.0.224 bcast=170.2.1.255 nmask=255.255.254.192
>Domain=[CORP] OS=[Unix] Server=[Samba 2.2.1a]
>putting file hp_750_1.ppd as \W32X86\hp_750_1.ppd (1159.8 kb/s) (average 
>1159.8 kb/s)
>[rpc]: putting file hp_750_1.ppd as \W32X86\hp_750_1.ppd (1159.8 kb/s) 
>(average 1159.8 kb/s)
>putting file pscrptui.dll as \W32X86\pscrptui.dll (4494.0 kb/s) (average 
>3191.6 kb/s)
>[rpc]: putting file pscrptui.dll as \W32X86\pscrptui.dll (4494.0 kb/s) 
>(average 3191.6 kb/s)
>putting file pscript.hlp as \W32X86\pscript.hlp (434.4 kb/s) (average 
>2272.5 kb/s)
>[rpc]: putting file pscript.hlp as \W32X86\pscript.hlp (434.4 kb/s) 
>(average 2272.5 kb/s)
>putting file pscript.dll as \W32X86\pscript.dll (7345.3 kb/s) (average 
>3480.3 kb/s)
>[rpc]: putting file pscript.dll as \W32X86\pscript.dll (7345.3 kb/s) 
>(average 3480.3 kb/s)
>rpcclient vistadev -d 3 -A  /home/imisexp/src/perl/.user -c "adddriver 
>\"Windows NT x86\" \"HP DesignJet 
>750C/PS:PSCRIPT.DLL:HP_750_1.PPD:PSCRPTUI.DLL:PSCRIPT.HLP:NULL:RAW:hp_750_1.ppd,pscrptui.dll,pscript.hlp,pscript.dll\""
>Initialising global parameters
>params.c:pm_process() - Processing configuration file 
>"/usr/local/samba/lib/smb.conf"
>Processing section "[global]"
>INFO: Debug class all level = 1   (pid 33214 from pid 33214)
>added interface ip=170.2.0.224 bcast=170.2.1.255 nmask=255.255.254.192
>resolve_lmhosts: Attempting lmhosts lookup for name vistadev<0x20>
>resolve_hosts: Attempting host lookup for name vistadev<0x20>
>Connecting to 170.2.0.224 at port 139
>session setup ok
>Domain=[CORP] OS=[Unix] Server=[Samba 2.2.1a]
>result was NT_STATUS_NOT_IMPLEMENTED
>rpcclient vistadev -d 10 -A  /home/imisexp/src/perl/.user -c "addprinter 
>\"HP DesignJet 750C/PS\" \"EngrSDPS\" \"HP DesignJet 750C/PS\" \"Samba 
>Printer Port\""
>Initialising global parameters
>params.c:pm_process() - Processing configuration file 
>"/usr/local/samba/lib/smb.conf"
>Processing section "[global]"
>doing parameter comment = Samba %v
>doing parameter netbios name = VISTADEV
>handle_netbios_name: set global_myname to: VISTADEV
>doing parameter security = domain
>doing parameter workgroup = CORP
>doing parameter invalid users = root daemon bin sys adm uucp
>doing parameter password server = CORP01 CORP02
>doing parameter encrypt passwords = Yes
>doing parameter log level = 1
>INFO: Debug class all level = 1   (pid 33216 from pid 33216)

less useful (I hope) stuff removed at moderator's request :-(

>smb_bcc=585
>[000] 5C 50 49 50 45 5C 00 05  00 00 03 10 00 00 00 42  \PIPE\.. .......B
>[010] 02 00 00 02 00 00 00 32  02 00 00 00 00 46 00 01  .......2 .....F..
>[020] 00 00 00 0A 00 00 00 00  00 00 00 0A 00 00 00 5C  ........ .......\
>[030] 00 5C 00 56 00 49 00 53  00 54 00 41 00 44 00 45  .\.V.I.S .T.A.D.E
>[040] 00 56 00 02 00 00 00 02  00 00 00 01 00 00 00 00  .V...... ........
>[050] 00 00 00 01 00 00 00 01  00 00 00 01 00 00 00 01  ........ ........
>[060] 00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........
>[070] 00 00 00 01 00 00 00 01  00 00 00 00 00 00 00 00  ........ ........
>[080] 00 00 00 08 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........
>[090] 00 00 00 00 00 00 00 5F  00 5F 00 00 00 00 00 00  ......._ ._......
>[0A0] 00 00 00 15 00 00 00 00  00 00 00 15 00 00 00 48  ........ .......H
>[0B0] 00 50 00 20 00 44 00 65  00 73 00 69 00 67 00 6E  .P. .D.e .s.i.g.n
>[0C0] 00 4A 00 65 00 74 00 20  00 37 00 35 00 30 00 43  .J.e.t.  .7.5.0.C
>[0D0] 00 2F 00 50 00 53 00 00  00 00 00 09 00 00 00 00  ./.P.S.. ........
>[0E0] 00 00 00 09 00 00 00 45  00 6E 00 67 00 72 00 53  .......E .n.g.r.S
>[0F0] 00 44 00 50 00 53 00 00  00 00 00 13 00 00 00 00  .D.P.S.. ........
>[100] 00 00 00 13 00 00 00 53  00 61 00 6D 00 62 00 61  .......S .a.m.b.a
>[110] 00 20 00 50 00 72 00 69  00 6E 00 74 00 65 00 72  . .P.r.i .n.t.e.r
>[120] 00 20 00 50 00 6F 00 72  00 74 00 00 00 00 00 15  . .P.o.r .t......
>[130] 00 00 00 00 00 00 00 15  00 00 00 48 00 50 00 20  ........ ...H.P.
>[140] 00 44 00 65 00 73 00 69  00 67 00 6E 00 4A 00 65  .D.e.s.i .g.n.J.e
>[150] 00 74 00 20 00 37 00 35  00 30 00 43 00 2F 00 50  .t. .7.5 .0.C./.P
>[160] 00 53 00 00 00 00 00 15  00 00 00 00 00 00 00 15  .S...... ........
>[170] 00 00 00 43 00 72 00 65  00 61 00 74 00 65 00 64  ...C.r.e .a.t.e.d
>[180] 00 20 00 62 00 79 00 20  00 72 00 70 00 63 00 63  . .b.y.  .r.p.c.c
>[190] 00 6C 00 69 00 65 00 6E  00 74 00 00 00 00 00 09  .l.i.e.n .t......
>[1A0] 00 00 00 00 00 00 00 09  00 00 00 77 00 69 00 6E  ........ ...w.i.n
>[1B0] 00 70 00 72 00 69 00 6E  00 74 00 00 00 00 00 04  .p.r.i.n .t......
>[1C0] 00 00 00 00 00 00 00 04  00 00 00 52 00 41 00 57  ........ ...R.A.W
>[1D0] 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........
>[1E0] 00 00 00 01 00 00 00 01  00 00 00 01 00 00 00 14  ........ ........
>[1F0] 00 00 00 01 00 00 00 01  00 00 00 65 05 00 00 02  ........ ...e....
>write_socket(3,656)
>write_socket(3,656) wrote 656
>read_socket_with_timeout: timeout read. EOF from client.
>receive_smb: length < 0!
>client_receive_smb failed
>size=0
>smb_com=0x0
>smb_rcls=0
>smb_reh=0
>smb_err=0
>smb_flg=0
>smb_flg2=0
>smb_tid=0
>smb_pid=0
>smb_uid=0
>smb_mid=0
>smt_wct=0
>smb_bcc=0
>cli_pipe: return critical error. Error was code 0
>write_socket(3,45)
>write_socket(3,45) wrote 45
>read_socket_with_timeout: timeout read. read error = Connection reset by peer.
>receive_smb: length < 0!
>client_receive_smb failed
>size=0
>smb_com=0x0
>smb_rcls=0
>smb_reh=0
>smb_err=0
>smb_flg=0
>smb_flg2=0
>smb_tid=0
>smb_pid=0
>smb_uid=0
>smb_mid=0
>smt_wct=0
>smb_bcc=0
>result was NT_STATUS_UNSUCCESSFUL
>[rpc]: ERROR! Windows NT error code : [result was NT_STATUS_UNSUCCESSFUL]
>Cleaning up temporary files...
>Installation experienced problems.
>
>Notice I added another debug step just before Step #2 in 
>rpc_client_wrapper() to list the CWD and its content before putting the 
>package files to the Samba server.  Step #4 seems to be having a problem 
>with a new_name/old_name value that resolves to '_', possibly from parsing 
>the HP file name HP_750_1.PPD, the only file with the '_' in its name.
>
>This Imprints stuff is very promising for what I am trying to do, if I can 
>make it work.  I am a little surprised and disappointed that I had to hack 
>the HP .INF file in order to build the local package.  Is that common with 
>.INF files?   Perhaps I could have obtained a package for this driver from 
>some other source than our existing NT driver collection, but I have great 
>confidence in the guy who manages the NT print server environment and his 
>driver collection so I felt justified in getting the .INF file from his 
>reference server.
>
>Is it your plan to serve driver packages from the imprints server at 
>samba.org, or are all the references to it just examples?
>
>Now to the point:  What is going on in the addprinter function?  The Samba 
>log advises reading BUGS.txt and submitting a bug report but before I do 
>that, can you shed any light on the error I am seeing and how I might 
>resolve it?  Today I plan to add more debug statements in the module 
>source/printing/nt_printing.c to list out some of the data structures used 
>by the move function.  I tried attaching to smbd in execution with dbx -a 
>and setting a break point near line 1389 but smbd apparently does a fork() 
>and exec() so my break is not in the right context.
>
>Notice I got:
>result was NT_STATUS_NOT_IMPLEMENTED
>in the adddriver rpcclient call.  I assume since the process did not quit 
>on this error it came from the NULL argument for Language Monitor and is 
>therefore only a warning, correct?
>
>Say mate, I do hope you can help me resolve this problem as I consider 
>rpcclient to be a most important and useful tool for managing a large 
>collection of printer drivers in Samba, just as you said in one of the 
>Imprints docos, to whit;
>
>"Rather the bottom line is that since Samba runs on UNIX platforms and 
>UNIX-like variants. a sysadmin should be able to administer that server 
>from a UNIX host.  Equal opportunity for all..."  Right on, I could not 
>agree more.

Regards,
Will Schmidt
SW Engineer/Consultant
Kipe & Associates       currently on assignment @ Freightliner LLC
Portland, OR
(541) 462-3160
(541) 462-3899 fax
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the samba mailing list