From f3df73c0cf3f001fe299bd4700a18519a6a0eeff Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 8 Mar 2002 03:31:01 +0000 Subject: One more fix to get popt to work for some compilers...this is the downside to popt. Every option has to be in fixed storage. (This used to be commit e5e7132e80bfe599d56809bf47a13d2028ee9c86) --- source3/rpcclient/rpcclient.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'source3') diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 2a9d01f520..38242648aa 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -552,34 +552,37 @@ static void usage(void) extern char *optarg; extern int optind; extern pstring global_myname; - int got_pass = 0; + static int got_pass = 0; BOOL interactive = True; int opt; int olddebug; - char *cmdstr = ""; + static char *cmdstr = ""; struct cli_state *cli; fstring password="", username="", domain="", server=""; - char *opt_authfile=NULL, - *opt_username=NULL, - *opt_domain=NULL, - *opt_configfile=NULL, - *opt_logfile=NULL; - pstring logfile; - struct cmd_set **cmd_set; - struct in_addr server_ip; - NTSTATUS nt_status; - extern BOOL AllowDebugChange; - + static char *opt_authfile=NULL, + *opt_username=NULL, + *opt_domain=NULL, + *opt_configfile=NULL, + *opt_logfile=NULL; + static int opt_debuglevel; + pstring logfile; + struct cmd_set **cmd_set; + struct in_addr server_ip; + NTSTATUS nt_status; + extern BOOL AllowDebugChange; + + /* make sure the vars that get altered (4th field) are in + a fixed location or certain compilers complain */ poptContext pc; struct poptOption long_options[] = { {"authfile", 'A', POPT_ARG_STRING, &opt_authfile, 'A'}, {"conf", 's', POPT_ARG_STRING, &opt_configfile, 's'}, {"nopass", 'N', POPT_ARG_NONE, &got_pass}, - {"debug", 'd', POPT_ARG_INT, &DEBUGLEVEL}, - {"debuglevel", 'd', POPT_ARG_INT, &DEBUGLEVEL}, + {"debug", 'd', POPT_ARG_INT, &opt_debuglevel, 'd'}, + {"debuglevel", 'd', POPT_ARG_INT, &opt_debuglevel, 'd'}, {"user", 'U', POPT_ARG_STRING, &opt_username, 'U'}, {"workgroup", 'W', POPT_ARG_STRING, &opt_domain, 'W'}, {"command", 'c', POPT_ARG_STRING, &cmdstr}, @@ -633,6 +636,10 @@ static void usage(void) pstrcpy(dyn_CONFIGFILE, opt_configfile); break; + case 'd': + DEBUGLEVEL = opt_debuglevel; + break; + case 'U': { char *lp; pstrcpy(username,opt_username); -- cgit