mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3/param: don't ignore unknown options
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
08512e3a54
commit
d5f3607233
@ -27,6 +27,7 @@ int main(int argc, const char **argv)
|
|||||||
poptContext pc;
|
poptContext pc;
|
||||||
char *count_str = NULL;
|
char *count_str = NULL;
|
||||||
int i, count = 1;
|
int i, count = 1;
|
||||||
|
int opt;
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
struct poptOption long_options[] = {
|
struct poptOption long_options[] = {
|
||||||
@ -70,7 +71,15 @@ int main(int argc, const char **argv)
|
|||||||
}
|
}
|
||||||
poptSetOtherOptionHelp(pc, "[OPTION...] <config-file>");
|
poptSetOtherOptionHelp(pc, "[OPTION...] <config-file>");
|
||||||
|
|
||||||
while(poptGetNextOpt(pc) != -1);
|
while ((opt = poptGetNextOpt(pc)) != -1) {
|
||||||
|
switch (opt) {
|
||||||
|
case POPT_ERROR_BADOPT:
|
||||||
|
fprintf(stderr, "\nInvalid option %s: %s\n\n",
|
||||||
|
poptBadOption(pc, 0), poptStrerror(opt));
|
||||||
|
poptPrintUsage(pc, stderr, 0);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (poptPeekArg(pc)) {
|
if (poptPeekArg(pc)) {
|
||||||
config_file = poptGetArg(pc);
|
config_file = poptGetArg(pc);
|
||||||
|
Loading…
Reference in New Issue
Block a user