Document the fact that --numeric-ids is implied if the source system is
[rsync/rsync.git] / loadparm.c
index 0ddbc61..aba7d30 100644 (file)
@@ -98,6 +98,8 @@ typedef struct
 {
        char *motd_file;
        char *lock_file;
+       char *log_file;
+       char *pid_file;
        int syslog_facility;
        int max_connections;
        char *socket_options;
@@ -117,6 +119,7 @@ typedef struct
        char *comment;
        BOOL read_only;
        BOOL list;
+       BOOL use_chroot;
        char *uid;
        char *gid;
        char *hosts_allow;
@@ -136,6 +139,7 @@ static service sDefault =
        NULL,    /* comment */
        True,    /* read only */
        True,    /* list */
+       True,    /* use chroot */
        "nobody",/* uid */
        "nobody",/* gid */
        NULL,    /* hosts allow */
@@ -231,12 +235,15 @@ static struct parm_struct parm_table[] =
   {"lock file",        P_STRING,  P_GLOBAL, &Globals.lock_file,    NULL,   0},
   {"syslog facility",  P_ENUM,    P_GLOBAL, &Globals.syslog_facility, enum_facilities,0},
   {"socket options",   P_STRING,  P_GLOBAL, &Globals.socket_options,NULL,  0},
+  {"log file",         P_STRING,  P_GLOBAL, &Globals.log_file,      NULL,  0},
+  {"pid file",         P_STRING,  P_GLOBAL, &Globals.pid_file,      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},
   {"read only",        P_BOOL,    P_LOCAL,  &sDefault.read_only,   NULL,   0},
   {"list",             P_BOOL,    P_LOCAL,  &sDefault.list,        NULL,   0},
+  {"use chroot",       P_BOOL,    P_LOCAL,  &sDefault.use_chroot,  NULL,   0},
   {"uid",              P_STRING,  P_LOCAL,  &sDefault.uid,         NULL,   0},
   {"gid",              P_STRING,  P_LOCAL,  &sDefault.gid,         NULL,   0},
   {"hosts allow",      P_STRING,  P_LOCAL,  &sDefault.hosts_allow, NULL,   0},
@@ -295,6 +302,8 @@ static void init_locals(void)
 
 FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file)
 FN_GLOBAL_STRING(lp_lock_file, &Globals.lock_file)
+FN_GLOBAL_STRING(lp_log_file, &Globals.log_file)
+FN_GLOBAL_STRING(lp_pid_file, &Globals.pid_file)
 FN_GLOBAL_STRING(lp_socket_options, &Globals.socket_options)
 FN_GLOBAL_INTEGER(lp_max_connections, &Globals.max_connections)
 FN_GLOBAL_INTEGER(lp_syslog_facility, &Globals.syslog_facility)
@@ -304,6 +313,7 @@ FN_LOCAL_STRING(lp_comment, comment)
 FN_LOCAL_STRING(lp_path, path)
 FN_LOCAL_BOOL(lp_read_only, read_only)
 FN_LOCAL_BOOL(lp_list, list)
+FN_LOCAL_BOOL(lp_use_chroot, use_chroot)
 FN_LOCAL_STRING(lp_uid, uid)
 FN_LOCAL_STRING(lp_gid, gid)
 FN_LOCAL_STRING(lp_hosts_allow, hosts_allow)
@@ -329,7 +339,7 @@ initialise a service to the defaults
 ***************************************************************************/
 static void init_service(service *pservice)
 {
-       bzero((char *)pservice,sizeof(service));
+       memset((char *)pservice,0,sizeof(service));
        copy_service(pservice,&sDefault);
 }
 
@@ -366,12 +376,7 @@ static int add_a_service(service *pservice, char *name)
 
   i = iNumServices;
 
-  if (ServicePtrs) {
-         ServicePtrs = (service **)realloc(ServicePtrs,
-                                           sizeof(service *)*num_to_alloc);
-  } else {
-         ServicePtrs = (service **)malloc(sizeof(service *)*num_to_alloc);
-  }
+  ServicePtrs = (service **)Realloc(ServicePtrs,sizeof(service *)*num_to_alloc);
 
   if (ServicePtrs)
          pSERVICE(iNumServices) = (service *)malloc(sizeof(service));