summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-08-27 21:32:06 +0000
committerTim Potter <tpot@samba.org>2001-08-27 21:32:06 +0000
commit8b6b1b2e82a23d4e6472a65dd1e1dd5fdd6cd277 (patch)
tree7eee097d80d7b20cf306bdcc1693633fe289260e
parentb031af348c7dcc8c74bf49945211c466b8eca079 (diff)
downloadsamba-8b6b1b2e82a23d4e6472a65dd1e1dd5fdd6cd277.tar.gz
samba-8b6b1b2e82a23d4e6472a65dd1e1dd5fdd6cd277.tar.bz2
samba-8b6b1b2e82a23d4e6472a65dd1e1dd5fdd6cd277.zip
Fix bug in usage().
Allow user to invoke with \\ or // in front of server name. (This used to be commit c292b63ff60ca80c0f1804fbfb28d582c3308014)
-rw-r--r--source3/rpcclient/rpcclient.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index d49fd13340..572b6cc620 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -3,7 +3,7 @@
Version 2.2
RPC pipe client
- Copyright (C) Tim Potter 2000
+ Copyright (C) Tim Potter 2000-2001
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -553,7 +553,7 @@ struct cli_state *setup_connection(struct cli_state *cli, char *system_name,
/* Print usage information */
static void usage(void)
{
- printf("Usage: rpcclient [options] server\n");
+ printf("Usage: rpcclient server [options]\n");
printf("\t-A authfile file containing user credentials\n");
printf("\t-c \"command string\" execute semicolon separated cmds\n");
@@ -649,11 +649,15 @@ static void usage(void)
argc -= optind;
/* Parse options */
- if (argc < 1) {
+ if (argc > 1) {
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