summaryrefslogtreecommitdiff
path: root/source3/client/client.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-08-01 21:09:10 +0000
committerJeremy Allison <jra@samba.org>2003-08-01 21:09:10 +0000
commit72a8b313036092d3133c010257218ab60c1ca808 (patch)
tree47879b746536c5e9eae3e5a2702fab391b5e3fa1 /source3/client/client.c
parentbfb312800fe3bb60cacb11c96f8b6c96c66fee0a (diff)
downloadsamba-72a8b313036092d3133c010257218ab60c1ca808.tar.gz
samba-72a8b313036092d3133c010257218ab60c1ca808.tar.bz2
samba-72a8b313036092d3133c010257218ab60c1ca808.zip
Fix the option processing for smbtar. Does no one check this !
Jeremy. (This used to be commit c4af1ec73584656fb9d2b372461da4748e1643f1)
Diffstat (limited to 'source3/client/client.c')
-rw-r--r--source3/client/client.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index e17ae82c0a..ec29f44e6e 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2824,9 +2824,25 @@ static void remember_query_host(const char *arg,
max_protocol = interpret_protocol(poptGetOptArg(pc), max_protocol);
break;
case 'T':
- if (!tar_parseargs(argc, argv, poptGetOptArg(pc), optind)) {
- poptPrintUsage(pc, stderr, 0);
- exit(1);
+ /* We must use old option processing for this. Find the
+ * position of the -T option in the raw argv[]. */
+ {
+ int i, optnum;
+ for (i = 1; i < argc; i++) {
+ if (strncmp("-T", argv[i],2)==0)
+ break;
+ }
+ i++;
+ if (!(optnum = tar_parseargs(argc, argv, poptGetOptArg(pc), i))) {
+ poptPrintUsage(pc, stderr, 0);
+ exit(1);
+ }
+ /* Now we must eat (optnum - i) options - they have
+ * been processed by tar_parseargs().
+ */
+ optnum -= i;
+ for (i = 0; i < optnum; i++)
+ poptGetOptArg(pc);
}
break;
case 'D':
@@ -2851,7 +2867,7 @@ static void remember_query_host(const char *arg,
}
}
- if (poptPeekArg(pc)) {
+ if (poptPeekArg(pc) && !cmdline_auth_info.got_pass) {
cmdline_auth_info.got_pass = True;
pstrcpy(cmdline_auth_info.password,poptGetArg(pc));
}