From 8b6b1b2e82a23d4e6472a65dd1e1dd5fdd6cd277 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 27 Aug 2001 21:32:06 +0000 Subject: Fix bug in usage(). Allow user to invoke with \\ or // in front of server name. (This used to be commit c292b63ff60ca80c0f1804fbfb28d582c3308014) --- source3/rpcclient/rpcclient.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source3') 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 -- cgit