1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

merges from SAMBA_2_2

(This used to be commit 91929afbb0cad422cc6d05f9a10ba5c3d797d779)
This commit is contained in:
Gerald Carter 2002-04-16 16:49:08 +00:00
parent 7a661ac63c
commit 1d49e9bc71

View File

@ -576,7 +576,7 @@ static NTSTATUS process_cmd(struct cli_state *cli, char *cmd)
/* Print usage information */
static void usage(void)
{
printf("Usage: rpcclient server [options]\n");
printf("Usage: rpcclient [options] server\n");
printf("\t-A or --authfile authfile file containing user credentials\n");
printf("\t-c or --command \"command string\" execute semicolon separated cmds\n");
@ -660,12 +660,12 @@ static void usage(void)
pc = poptGetContext(NULL, argc, (const char **) argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
while (argc > optind) {
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case 'A':
/* only get the username, password, and domain from the file */
read_authfile (opt_authfile, username,
password, domain);
read_authfile (opt_authfile, username, password, domain);
if (strlen (password))
got_pass = 1;
break;
@ -708,6 +708,23 @@ static void usage(void)
}
}
if (argc > optind) {
if (strncmp("//", argv[optind], 2) == 0 ||
strncmp("\\\\", argv[optind], 2) == 0)
{
argv[optind] += 2;
}
pstrcpy(server, argv[optind]);
optind ++;
}
}
if (!server[0]) {
usage();
return 1;
}
poptFreeContext(pc);
/* the following functions are part of the Samba debugging