diff options
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r-- | source3/utils/net.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c index 3ab34e7aa9..7588771fbc 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -78,6 +78,8 @@ static int opt_machine_pass = 0; BOOL opt_have_ip = False; struct in_addr opt_dest_ip; +extern BOOL AllowDebugChange; + /* run a function from a function table. If not found then call the specified usage function @@ -511,14 +513,18 @@ static struct functable net_func[] = { int argc_new = 0; const char ** argv_new; poptContext pc; + static char *servicesf = dyn_CONFIGFILE; + static char *debuglevel = NULL; struct poptOption long_options[] = { {"help", 'h', POPT_ARG_NONE, 0, 'h'}, {"workgroup", 'w', POPT_ARG_STRING, &opt_target_workgroup}, + {"myworkgroup", 'W', POPT_ARG_STRING, &opt_workgroup}, {"user", 'U', POPT_ARG_STRING, &opt_user_name, 'U'}, {"ipaddress", 'I', POPT_ARG_STRING, 0,'I'}, {"port", 'p', POPT_ARG_INT, &opt_port}, {"myname", 'n', POPT_ARG_STRING, &opt_requester_name}, + {"conf", 's', POPT_ARG_STRING, &servicesf}, {"server", 'S', POPT_ARG_STRING, &opt_host}, {"container", 'c', POPT_ARG_STRING, &opt_container}, {"comment", 'C', POPT_ARG_STRING, &opt_comment}, @@ -530,8 +536,8 @@ static struct functable net_func[] = { {"force", 'f', POPT_ARG_NONE, &opt_force}, {"timeout", 't', POPT_ARG_INT, &opt_timeout}, {"machine-pass",'P', POPT_ARG_NONE, &opt_machine_pass}, - {"myworkgroup", 'W', POPT_ARG_STRING, &opt_workgroup}, - POPT_COMMON_SAMBA + {"debuglevel", 'd', POPT_ARG_STRING, &debuglevel}, + {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version}, { 0, 0, 0, 0} }; @@ -571,8 +577,13 @@ static struct functable net_func[] = { exit(1); } } - - lp_load(dyn_CONFIGFILE,True,False,False); + + if (debuglevel) { + debug_parse_levels(debuglevel); + AllowDebugChange = False; + } + + lp_load(servicesf,True,False,False); argv_new = (const char **)poptGetArgs(pc); @@ -625,10 +636,6 @@ static struct functable net_func[] = { exit(1); } } - - if (!opt_password) { - opt_password = getenv("PASSWD"); - } rc = net_run_function(argc_new-1, argv_new+1, net_func, net_help); |