pdbedit segfaults in SAMBA_3_0

Bradley W. Langhorst brad at langhorst.com
Sat Dec 21 21:28:00 GMT 2002


On Tue, 2002-12-17 at 04:06, Simo Sorce wrote:
> Can you send a backtrace?
> Mine does not segfault (tough I'm using head not 3.0)
> 
> Simo.
simo:
how are you testing it?
I just rebuilt from SAMBA_3.0 (no debian patches or anything)

when i type pdbedit  it segfaults
however if i provide a username it seems to work okay.
(which makes sense given the backtrace...)
I think it just needs this patch (or something like it that fits with how you all do things).



diff -u -r1.39.2.7 pdbedit.c
--- utils/pdbedit.c     12 Nov 2002 23:20:49 -0000      1.39.2.7
+++ utils/pdbedit.c     21 Dec 2002 21:25:24 -0000
@@ -495,7 +495,14 @@
        poptGetArg(pc); /* Drop argv[0], the program name */

        if (user_name == NULL) {
-               user_name = strdup(poptGetArg(pc));
+               if (poptPeekArg(pc) == NULL) {
+                       fprintf(stderr, "Can't use pdbedit without a username\n");
+                       poptPrintHelp(pc, stderr, 0);
+                       exit(1);
+               } else {
+                       /*Don't try to duplicate a null string */
+                       user_name = strdup(poptGetArg(pc));
+               }
        }

        if (!lp_load(dyn_CONFIGFILE,True,False,False)) {





> -- 
> Bradley W. Langhorst <brad at langhorst.com>




More information about the samba-technical mailing list