while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
default:
- d_fprintf(stderr, "\nInvalid option %s: %s\n",
+ d_fprintf(stderr, "\nInvalid option %s: %s\n\n",
poptBadOption(pc, 0), poptStrerror(opt));
+ poptPrintUsage(pc, stderr, 0);
exit(1);
}
};
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
default:
- d_fprintf(stderr, "\nInvalid option %s: %s\n",
+ d_fprintf(stderr, "\nInvalid option %s: %s\n\n",
poptBadOption(pc, 0), poptStrerror(opt));
+ poptPrintUsage(pc, stderr, 0);
exit(1);
}
}
exit(1);
}
+ poptFreeContext(pc);
+
if (!override_logfile) {
pstr_sprintf(logfile, "%s/log.winbindd", dyn_LOGFILEBASE);
lp_set_logfile(logfile);
messaging_register(winbind_messaging_context(), NULL,
MSG_DUMP_EVENT_LIST, winbind_msg_dump_event_list);
- poptFreeContext(pc);
-
netsamlogon_cache_init(); /* Non-critical */
/* clear the cached list of trusted domains */
const char *profile_level = NULL;
int opt;
poptContext pc;
+ BOOL print_build_options = False;
enum smb_server_mode server_mode = SERVER_MODE_DAEMON;
#endif
pc = poptGetContext("smbd", argc, argv, long_options, 0);
-
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case 'b':
- build_options(True); /* Display output to screen as well as debug */
- exit(0);
+ print_build_options = True;
+ break;
default:
- d_fprintf(stderr, "\nInvalid option %s: %s\n",
+ d_fprintf(stderr, "\nInvalid option %s: %s\n\n",
poptBadOption(pc, 0), poptStrerror(opt));
+ poptPrintUsage(pc, stderr, 0);
exit(1);
}
}
-
poptFreeContext(pc);
+ if (print_build_options) {
+ build_options(True); /* Display output to screen as well as debug */
+ exit(0);
+ }
+
#ifdef HAVE_SETLUID
/* needed for SecureWare on SCO */
setluid(0);