overriding dyn_CONFIGFILE in pdbedit with command line parameter

Bradley W. Langhorst brad at langhorst.com
Mon Apr 29 14:03:02 GMT 2002


I decided to modify pdbedit to handle another 
command line parameter -c /pathto/smb.conf

I've got that working - but I'm not sure it's safe
Is it reasonable to expect the popt stuff to give me back 
null terminated string?

if so then find a simple patch below


are attachments not accepted by the listserver - i sent this twice
before but never saw anything on the list

brad

diff -r1.43 pdbedit.c
411a412
>       static char *configfile = NULL;
433a435
>               {"configfile",  c,POPT_ARG_STRING,&configfile,0,"use the
given path to the smb.conf file",NULL},
441a444,451
>       pc = poptGetContext(NULL, argc, (const char **) argv,
long_options,
>                                              
POPT_CONTEXT_KEEP_FIRST);
>
>       while((opt = poptGetNextOpt(pc)) != -1);
>
>       if (configfile) {
>         safe_strcpy(dyn_CONFIGFILE,configfile, strlen(configfile));
/*override the default config file*/
>       }
450,451d459
<       pc = poptGetContext(NULL, argc, (const char **) argv,
long_options,
<                                              
POPT_CONTEXT_KEEP_FIRST);
453d460
<       while((opt = poptGetNextOpt(pc)) != -1);






More information about the samba-technical mailing list