--- winbindd/winbindd.c.orig 2009-05-24 02:36:34.000000000 +0000 +++ winbindd/winbindd.c 2009-05-24 02:35:21.000000000 +0000 @@ -1013,11 +1013,17 @@ static bool is_daemon = False; static bool Fork = True; static bool log_stdout = False; +#ifdef WITH_SYSLOG + static bool syslog_only = False; +#endif static bool no_process_group = False; enum { OPT_DAEMON = 1000, OPT_FORK, OPT_NO_PROCESS_GROUP, +#ifdef WITH_SYSLOG + OPT_SYSLOG_ONLY, +#endif OPT_LOG_STDOUT }; struct poptOption long_options[] = { @@ -1025,6 +1031,10 @@ { "stdout", 'S', POPT_ARG_NONE, NULL, OPT_LOG_STDOUT, "Log to stdout" }, { "foreground", 'F', POPT_ARG_NONE, NULL, OPT_FORK, "Daemon in foreground mode" }, { "no-process-group", 0, POPT_ARG_NONE, NULL, OPT_NO_PROCESS_GROUP, "Don't create a new process group" }, + { "log-stdout", 'S', POPT_ARG_NONE, NULL, OPT_LOG_STDOUT, "Log to stdout" }, +#ifdef WITH_SYSLOG + { "syslog-only", 'L', POPT_ARG_NONE, NULL, OPT_SYSLOG_ONLY, "Log to syslog" }, +#endif { "daemon", 'D', POPT_ARG_NONE, NULL, OPT_DAEMON, "Become a daemon (default)" }, { "interactive", 'i', POPT_ARG_NONE, NULL, 'i', "Interactive mode" }, { "no-caching", 'n', POPT_ARG_NONE, NULL, 'n', "Disable caching" }, @@ -1084,6 +1094,11 @@ case OPT_LOG_STDOUT: log_stdout = true; break; +#ifdef WITH_SYSLOG + case OPT_SYSLOG_ONLY: + syslog_only = true; + break; +#endif case 'n': opt_nocache = true; break; @@ -1109,6 +1124,19 @@ exit(1); } +#ifdef WITH_SYSLOG + if (log_stdout && syslog_only) { + d_fprintf(stderr, "\nERROR: " + "Can't log to stdout (-S) with syslog only (-L)\n\n"); + poptPrintUsage(pc, stderr, 0); + exit(1); + } + + if( syslog_only ) { + debug_set_syslog_only(); + } +#endif + poptFreeContext(pc); if (!override_logfile) {