added "syslog facility" option. It is an integer and defaults to the
authorAndrew Tridgell <tridge@samba.org>
Wed, 13 May 1998 08:12:51 +0000 (08:12 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 13 May 1998 08:12:51 +0000 (08:12 +0000)
value of LOG_DAEMON.

loadparm.c
log.c

index 38c539c772073c5bbcda5cc8e78e3e362cc946f0..3afa9f4409940bec27e90dc5d87714a59947d817 100644 (file)
@@ -98,6 +98,7 @@ static BOOL bLoaded = False;
 typedef struct
 {
        char *motd_file;
+       int syslog_facility;
 } global;
 
 static global Globals;
@@ -150,6 +151,7 @@ static BOOL bInGlobalSection = True;
 static struct parm_struct parm_table[] =
 {
   {"motd file",        P_STRING,  P_GLOBAL, &Globals.motd_file,    NULL,   0},
+  {"syslog facility",  P_INTEGER, P_GLOBAL, &Globals.syslog_facility, NULL,0},
   {"name",             P_STRING,  P_LOCAL,  &sDefault.name,        NULL,   0},
   {"comment",          P_STRING,  P_LOCAL,  &sDefault.comment,     NULL,   0},
   {"path",             P_STRING,  P_LOCAL,  &sDefault.path,        NULL,   0},
@@ -168,6 +170,9 @@ Initialise the global parameter structure.
 ***************************************************************************/
 static void init_globals(void)
 {
+#ifdef LOG_DAEMON
+       Globals.syslog_facility = LOG_DAEMON;
+#endif
 }
 
 /***************************************************************************
@@ -203,6 +208,7 @@ static void init_locals(void)
 
 
 FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file)
+FN_GLOBAL_INTEGER(lp_syslog_facility, &Globals.syslog_facility)
 FN_LOCAL_STRING(lp_name, name)
 FN_LOCAL_STRING(lp_comment, comment)
 FN_LOCAL_STRING(lp_path, path)
diff --git a/log.c b/log.c
index ebf796b66faa377b65563d11cf756e58476b21f8..19339c76fc8a9935015e706e745fb149fe9d5319 100644 (file)
--- a/log.c
+++ b/log.c
@@ -55,7 +55,7 @@ void rprintf(int fd, const char *format, ...)
                if (!initialised) {
                        initialised = 1;
 #ifdef LOG_DAEMON
-                       openlog("rsyncd", LOG_PID, LOG_DAEMON);
+                       openlog("rsyncd", LOG_PID, lp_syslog_facility());
 #else
                        openlog("rsyncd", LOG_PID);
 #endif