summaryrefslogtreecommitdiff
path: root/source3/rpcclient/rpcclient.c
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-03-08 03:31:01 +0000
committerJim McDonough <jmcd@samba.org>2002-03-08 03:31:01 +0000
commitf3df73c0cf3f001fe299bd4700a18519a6a0eeff (patch)
tree56326281d315a8f7d0257859bf749cfb9011c41e /source3/rpcclient/rpcclient.c
parent194e39b179efc040c3db65996edaf9e785ef6d78 (diff)
downloadsamba-f3df73c0cf3f001fe299bd4700a18519a6a0eeff.tar.gz
samba-f3df73c0cf3f001fe299bd4700a18519a6a0eeff.tar.bz2
samba-f3df73c0cf3f001fe299bd4700a18519a6a0eeff.zip
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)
Diffstat (limited to 'source3/rpcclient/rpcclient.c')
-rw-r--r--source3/rpcclient/rpcclient.c37
1 files changed, 22 insertions, 15 deletions
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);