X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/0f78b81511be65d8fe21af1e6ac674f9e80ac29d..1ed3f5ed619b61f86007413a6c2420ddd55176f7:/loadparm.c diff --git a/loadparm.c b/loadparm.c index dc2dd7d7..dc8ddbe7 100644 --- a/loadparm.c +++ b/loadparm.c @@ -12,9 +12,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* some fixes @@ -57,6 +57,10 @@ typedef char pstring[1024]; #define pstrcpy(a,b) strlcpy(a,b,sizeof(pstring)) +#ifndef LOG_DAEMON +#define LOG_DAEMON 0 +#endif + /* the following are used by loadparm for option lists */ typedef enum { @@ -99,13 +103,11 @@ struct parm_struct typedef struct { char *bind_address; - char *log_file; char *motd_file; char *pid_file; char *socket_options; int rsync_port; - int syslog_facility; } global; static global Globals; @@ -131,6 +133,7 @@ typedef struct char *include_from; char *incoming_chmod; char *lock_file; + char *log_file; char *log_format; char *name; char *outgoing_chmod; @@ -144,11 +147,13 @@ typedef struct int max_connections; int max_verbosity; + int syslog_facility; int timeout; BOOL ignore_errors; BOOL ignore_nonreadable; BOOL list; + BOOL munge_symlinks; BOOL read_only; BOOL strict_modes; BOOL transfer_logging; @@ -176,6 +181,7 @@ static service sDefault = /* include_from; */ NULL, /* incoming_chmod; */ NULL, /* lock_file; */ DEFAULT_LOCK_FILE, + /* log_file; */ NULL, /* log_format; */ "%o %h [%a] %m (%u) %f %l", /* name; */ NULL, /* outgoing_chmod; */ NULL, @@ -189,11 +195,13 @@ static service sDefault = /* max_connections; */ 0, /* max_verbosity; */ 1, + /* syslog_facility; */ LOG_DAEMON, /* timeout; */ 0, /* ignore_errors; */ False, /* ignore_nonreadable; */ False, /* list; */ True, + /* munge_symlinks; */ False, /* read_only; */ True, /* strict_modes; */ True, /* transfer_logging; */ False, @@ -282,12 +290,10 @@ static struct enum_list enum_facilities[] = { static struct parm_struct parm_table[] = { {"address", P_STRING, P_GLOBAL,&Globals.bind_address, NULL,0}, - {"log file", P_STRING, P_GLOBAL,&Globals.log_file, NULL,0}, {"motd file", P_STRING, P_GLOBAL,&Globals.motd_file, NULL,0}, {"pid file", P_STRING, P_GLOBAL,&Globals.pid_file, NULL,0}, {"port", P_INTEGER,P_GLOBAL,&Globals.rsync_port, NULL,0}, {"socket options", P_STRING, P_GLOBAL,&Globals.socket_options, NULL,0}, - {"syslog facility", P_ENUM, P_GLOBAL,&Globals.syslog_facility,enum_facilities,0}, {"auth users", P_STRING, P_LOCAL, &sDefault.auth_users, NULL,0}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL,0}, @@ -305,9 +311,11 @@ static struct parm_struct parm_table[] = {"incoming chmod", P_STRING, P_LOCAL, &sDefault.incoming_chmod, NULL,0}, {"list", P_BOOL, P_LOCAL, &sDefault.list, NULL,0}, {"lock file", P_STRING, P_LOCAL, &sDefault.lock_file, NULL,0}, + {"log file", P_STRING, P_LOCAL, &sDefault.log_file, NULL,0}, {"log format", P_STRING, P_LOCAL, &sDefault.log_format, NULL,0}, {"max connections", P_INTEGER,P_LOCAL, &sDefault.max_connections, NULL,0}, {"max verbosity", P_INTEGER,P_LOCAL, &sDefault.max_verbosity, NULL,0}, + {"munge symlinks", P_BOOL, P_LOCAL, &sDefault.munge_symlinks, NULL,0}, {"name", P_STRING, P_LOCAL, &sDefault.name, NULL,0}, {"outgoing chmod", P_STRING, P_LOCAL, &sDefault.outgoing_chmod, NULL,0}, {"path", P_PATH, P_LOCAL, &sDefault.path, NULL,0}, @@ -319,6 +327,7 @@ static struct parm_struct parm_table[] = {"refuse options", P_STRING, P_LOCAL, &sDefault.refuse_options, NULL,0}, {"secrets file", P_STRING, P_LOCAL, &sDefault.secrets_file, NULL,0}, {"strict modes", P_BOOL, P_LOCAL, &sDefault.strict_modes, NULL,0}, + {"syslog facility", P_ENUM, P_LOCAL, &sDefault.syslog_facility,enum_facilities,0}, {"temp dir", P_PATH, P_LOCAL, &sDefault.temp_dir, NULL,0}, {"timeout", P_INTEGER,P_LOCAL, &sDefault.timeout, NULL,0}, {"transfer logging", P_BOOL, P_LOCAL, &sDefault.transfer_logging, NULL,0}, @@ -335,9 +344,6 @@ Initialise the global parameter structure. static void init_globals(void) { memset(&Globals, 0, sizeof Globals); -#ifdef LOG_DAEMON - Globals.syslog_facility = LOG_DAEMON; -#endif } /*************************************************************************** @@ -373,13 +379,11 @@ static void init_locals(void) FN_GLOBAL_STRING(lp_bind_address, &Globals.bind_address) -FN_GLOBAL_STRING(lp_log_file, &Globals.log_file) FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file) FN_GLOBAL_STRING(lp_pid_file, &Globals.pid_file) FN_GLOBAL_STRING(lp_socket_options, &Globals.socket_options) FN_GLOBAL_INTEGER(lp_rsync_port, &Globals.rsync_port) -FN_GLOBAL_INTEGER(lp_syslog_facility, &Globals.syslog_facility) FN_LOCAL_STRING(lp_auth_users, auth_users) FN_LOCAL_STRING(lp_comment, comment) @@ -394,6 +398,7 @@ FN_LOCAL_STRING(lp_include, include) FN_LOCAL_STRING(lp_include_from, include_from) FN_LOCAL_STRING(lp_incoming_chmod, incoming_chmod) FN_LOCAL_STRING(lp_lock_file, lock_file) +FN_LOCAL_STRING(lp_log_file, log_file) FN_LOCAL_STRING(lp_log_format, log_format) FN_LOCAL_STRING(lp_name, name) FN_LOCAL_STRING(lp_outgoing_chmod, outgoing_chmod) @@ -402,6 +407,7 @@ FN_LOCAL_STRING(lp_postxfer_exec, postxfer_exec) FN_LOCAL_STRING(lp_prexfer_exec, prexfer_exec) FN_LOCAL_STRING(lp_refuse_options, refuse_options) FN_LOCAL_STRING(lp_secrets_file, secrets_file) +FN_LOCAL_INTEGER(lp_syslog_facility, syslog_facility) FN_LOCAL_STRING(lp_temp_dir, temp_dir) FN_LOCAL_STRING(lp_uid, uid) @@ -412,6 +418,7 @@ FN_LOCAL_INTEGER(lp_timeout, timeout) FN_LOCAL_BOOL(lp_ignore_errors, ignore_errors) FN_LOCAL_BOOL(lp_ignore_nonreadable, ignore_nonreadable) FN_LOCAL_BOOL(lp_list, list) +FN_LOCAL_BOOL(lp_munge_symlinks, munge_symlinks) FN_LOCAL_BOOL(lp_read_only, read_only) FN_LOCAL_BOOL(lp_strict_modes, strict_modes) FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)