summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/nmbd/nmbd.c10
-rw-r--r--source3/nsswitch/winbindd.c14
-rw-r--r--source3/smbd/server.c5
3 files changed, 23 insertions, 6 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index b14e5a0b61..4f1dd93cae 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -652,6 +652,7 @@ static BOOL open_sockets(enum smb_server_mode server_mode, int port)
BOOL no_process_group = False;
BOOL log_stdout = False;
enum smb_server_mode server_mode = SERVER_MODE_DAEMON;
+ int opt;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -674,7 +675,14 @@ static BOOL open_sockets(enum smb_server_mode server_mode, int port)
global_nmb_port = NMB_PORT;
pc = poptGetContext("nmbd", argc, argv, long_options, 0);
- while (poptGetNextOpt(pc) != -1) {};
+ while ((opt = poptGetNextOpt(pc)) != -1) {
+ switch (opt) {
+ default:
+ d_fprintf(stderr, "\nInvalid option %s: %s\n",
+ poptBadOption(pc, 0), poptStrerror(opt));
+ exit(1);
+ }
+ };
poptFreeContext(pc);
global_in_nmbd = True;
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index 5af5a789ad..f1283c5a83 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -1012,10 +1012,16 @@ int main(int argc, char **argv, char **envp)
/* Initialise samba/rpc client stuff */
- pc = poptGetContext("winbindd", argc, (const char **)argv, long_options,
- POPT_CONTEXT_KEEP_FIRST);
-
- while ((opt = poptGetNextOpt(pc)) != -1) {}
+ pc = poptGetContext("winbindd", argc, (const char **)argv, long_options, 0);
+
+ while ((opt = poptGetNextOpt(pc)) != -1) {
+ switch (opt) {
+ default:
+ d_fprintf(stderr, "\nInvalid option %s: %s\n",
+ poptBadOption(pc, 0), poptStrerror(opt));
+ exit(1);
+ }
+ }
if (server_mode == SERVER_MODE_INTERACTIVE) {
log_stdout = True;
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 491482eea6..3bb60058ac 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -855,7 +855,10 @@ extern void build_options(BOOL screen);
case 'b':
build_options(True); /* Display output to screen as well as debug */
exit(0);
- break;
+ default:
+ d_fprintf(stderr, "\nInvalid option %s: %s\n",
+ poptBadOption(pc, 0), poptStrerror(opt));
+ exit(1);
}
}