[Samba] Samba 2.2.8 SEGV in rpcclient getdriver on Solaris 7

Nicholas Brealey nick at brealey.org
Sun Apr 6 22:29:31 GMT 2003


Hello

Replying to my own post. The same problem occurred in HEAD and 3.0 and was fixed, see:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=b16d5s%24oq2%241%40FreeBSD.csie.NCTU.edu.tw&rnum=2&prev=/groups%3Fq%3Dsamba%2Brpcclient%2Bgetdriver%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den%26btnG%3DGoogle%2BSearch

The patch was:
http://cvs.samba.org/cgi-bin/cvsweb/samba/source/lib/util_unistr.c.diff?r1=1.97&r2=1.98

I applied as similar patch and avoided the crash.

I now get:

rpcclient $> getdriver hplt2

[Windows NT x86]
Printer Driver Info 3:
         Version: [2]
         Driver Name: [HP LaserJet 2200 Series PS]
         Architecture: [Windows NT x86]
         Driver Path: [\\xxxxxxx\print$\W32X86\2\PSCRIPT4.DLL]
         Datafile: [\\xxxxxxx\print$\W32X86\2\HP2200_6.PPD]
         Configfile: [\\xxxxxxx\print$\W32X86\2\PS4UI.DLL]
         Helpfile: [\\xxxxxxx\print$\W32X86\2\PSCRIPT4.HLP]

         Dependentfiles: [\\xxxxxxx\print$\W32X86\2\HPBHEALR.DLL]
         Dependentfiles: [\\xxxxxxx\print$\W32X86\2\HPDOMON.DLL]
         Dependentfiles: [\\xxxxxxx\print$\W32X86\2\HPBMMON.DLL]
         Dependentfiles: [\\xxxxxxx\print$\W32X86\2\PSCRIPT.NTF]

         Monitorname: [HP Master Monitor]
         Defaultdatatype: [ÿŸ]

I don't know what the ÿŸ means.


Nick


Nicholas Brealey wrote:
> Hello
> 
> I was trying to figure out how to add printer drivers manually for
> downloading to Windows 2000 clients and I came accross this problem.
> (The printer drivers were installed some time ago using an earlier
> version of samba 2.2.x).
> 
> 
> $ dbx /usr/local/samba/bin/rpcclient
> (dbx) run xxxxxxx -U yyyyyyy
> Running: rpcclient xxxxxxx -U yyyyyyy
> (process id 4735)
> Password:
> rpcclient $> enumprinters
>         flags:[0x800000]
>         name:[\\xxxxxxx\hpem]
>         description:[\\xxxxxxx\hpem,HP LaserJet 4050 Series PS,HP 
> LaserJet 4050N PS]
>         comment:[HP LaserJet 4050N PS]
> (trimmed)
> rpcclient $> getdriver hpem
> 
> 
> [Windows NT x86]
> signal SEGV (no mapping at the fault address) in strlen_w at 0x778d4
> 0x000778d4: strlen_w+0x0004:    lduh    [%o0], %g3
> (dbx) where
> =>[1] strlen_w(0x0, 0x1caf00, 0x1f, 0xffbed760, 0x36, 0x0), at 0x778d4
>   [2] rpcstr_pull(0xffbecfe0, 0x0, 0x0, 0x0, 0x1, 0x100), at 0x797ac
>   [3] display_print_driver_3(0x1, 0x0, 0x1c79e8, 0xff23d8fc, 0x0, 0x3), 
> at 0x33de4
>   [4] cmd_spoolss_getdriver(0x15de40, 0xffbed848, 0x2, 0x1c2f48, 
> 0x12c48c, 0x0), at 0x340cc
>   [5] do_cmd(0x1c5b30, 0x12c590, 0x1c5b78, 0xf108c, 0x81010100, 0xff00), 
> at 0x2efb0
>   [6] process_cmd(0xffbee044, 0x0, 0x0, 0x15a5c8, 0x12c590, 0x15de40), 
> at 0x2f148
>   [7] main(0x12c218, 0x12c238, 0xffbef948, 0xf13ac, 0x0, 0x159878), at 
> 0x2f9fc
> (dbx)
> 
> Regards
> 
> Nick
> 

-------------- next part --------------
--- source/lib/util_unistr.c.2.2.8	Sun Apr  6 23:12:48 2003
+++ source/lib/util_unistr.c	Sun Apr  6 23:14:27 2003
@@ -2085,7 +2085,8 @@
 
 int rpcstr_pull(char* dest, void *src, int dest_len, int src_len, int flags)
 {
-	if(dest_len==-1)
+        if (!src) return 0;
+        if(dest_len==-1)
 		dest_len=MAXUNI-3;
 
 	if (flags & STR_TERMINATE) 


More information about the samba mailing list