mirror of
https://github.com/samba-team/samba.git
synced 2025-07-23 20:59:10 +03:00
r21962: Make pdbedit use the configfile specified by -s
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
8c7042b419
commit
f540c18b2b
@ -761,6 +761,7 @@ int main (int argc, char **argv)
|
|||||||
static char *pwd_time_format = NULL;
|
static char *pwd_time_format = NULL;
|
||||||
static BOOL pw_from_stdin = False;
|
static BOOL pw_from_stdin = False;
|
||||||
struct pdb_methods *bin, *bout, *bdef;
|
struct pdb_methods *bin, *bout, *bdef;
|
||||||
|
char *configfile = NULL;
|
||||||
poptContext pc;
|
poptContext pc;
|
||||||
struct poptOption long_options[] = {
|
struct poptOption long_options[] = {
|
||||||
POPT_AUTOHELP
|
POPT_AUTOHELP
|
||||||
@ -818,6 +819,9 @@ int main (int argc, char **argv)
|
|||||||
case 'C':
|
case 'C':
|
||||||
account_policy_value_set = True;
|
account_policy_value_set = True;
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
configfile = optarg;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -826,7 +830,8 @@ int main (int argc, char **argv)
|
|||||||
if (user_name == NULL)
|
if (user_name == NULL)
|
||||||
user_name = poptGetArg(pc);
|
user_name = poptGetArg(pc);
|
||||||
|
|
||||||
if (!lp_load(dyn_CONFIGFILE,True,False,False,True)) {
|
if (!lp_load(configfile?configfile:dyn_CONFIGFILE,
|
||||||
|
True,False,False,True)) {
|
||||||
fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
|
fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user