summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2002-02-26 20:04:54 +0000
committerHerb Lewis <herb@samba.org>2002-02-26 20:04:54 +0000
commit361d0f9f7b5c2568e64123b72c602aa6a07b66e5 (patch)
tree428b4540b25d2ece6f802e25f64615308113d7e1 /source3/rpcclient
parent62299aa7475bad48ba3e230596f09e794c2b4ce5 (diff)
downloadsamba-361d0f9f7b5c2568e64123b72c602aa6a07b66e5.tar.gz
samba-361d0f9f7b5c2568e64123b72c602aa6a07b66e5.tar.bz2
samba-361d0f9f7b5c2568e64123b72c602aa6a07b66e5.zip
merge from 2.2 - fix parsing of options
(This used to be commit c849e93392e3206b010949566a65a339f5064031)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/rpcclient.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 47a36b6dda..7cb56fe5e4 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -566,10 +566,26 @@ static void usage(void)
struct cmd_set **cmd_set;
struct in_addr server_ip;
NTSTATUS nt_status;
+ extern BOOL AllowDebugChange;
setlinebuf(stdout);
DEBUGLEVEL = 1;
+ AllowDebugChange = False;
+
+ /* Parse options */
+ if (argc == 0) {
+ usage();
+ return 0;
+ }
+
+ if (strncmp("//", argv[1], 2) == 0 || strncmp("\\\\", argv[1], 2) == 0)
+ argv[1] += 2;
+
+ pstrcpy(server, argv[1]);
+
+ argv++;
+ argc--;
while ((opt = getopt(argc, argv, "A:s:Nd:U:W:c:l:h")) != EOF) {
switch (opt) {
@@ -625,20 +641,6 @@ static void usage(void)
}
}
- argv += optind;
- argc -= optind;
-
- /* Parse options */
- if (argc == 0) {
- usage();
- return 0;
- }
-
- if (strncmp("//", argv[0], 2) == 0 || strncmp("\\\\", argv[0], 2) == 0)
- argv[0] += 2;
-
- pstrcpy(server, argv[0]);
-
/* the following functions are part of the Samba debugging
facilities. See lib/debug.c */
setup_logging("rpcclient", interactive);