Include info on who is exiting.
[rsync.git] / loadparm.c
index 982fda760a693e7aefa09c14ab244ca5532f3661..e11dce0efb1cac78739cb5eb81ce01d48245b152 100644 (file)
@@ -1,6 +1,3 @@
-/* This is based on loadparm.c from Samba, written by Andrew Tridgell
-   and Karl Auer */
-
 /*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * with this program; if not, visit the http://fsf.org website.
  */
 
-/* some fixes
+/* This is based on loadparm.c from Samba, written by Andrew Tridgell
+ * and Karl Auer.  Some of the changes are:
  *
  * Copyright (C) 2001, 2002 Martin Pool <mbp@samba.org>
+ * Copyright (C) 2003-2009 Wayne Davison <wayned@samba.org>
  */
 
-/*
- *  Load parameters.
+/* Load parameters.
  *
  *  This module provides suitable callback functions for the params
  *  module. It builds the internal table of service details which is
@@ -124,6 +122,7 @@ static global Globals;
 typedef struct
 {
        char *auth_users;
+       char *charset;
        char *comment;
        char *dont_compress;
        char *exclude;
@@ -157,6 +156,8 @@ typedef struct
        BOOL ignore_errors;
        BOOL ignore_nonreadable;
        BOOL list;
+       BOOL munge_symlinks;
+       BOOL numeric_ids;
        BOOL read_only;
        BOOL strict_modes;
        BOOL transfer_logging;
@@ -172,7 +173,8 @@ typedef struct
 static service sDefault =
 {
  /* auth_users; */             NULL,
- /* comment; */                        NULL,
+ /* charset; */                NULL,
+ /* comment; */                NULL,
  /* dont_compress; */          DEFAULT_DONT_COMPRESS,
  /* exclude; */                        NULL,
  /* exclude_from; */           NULL,
@@ -205,6 +207,8 @@ static service sDefault =
  /* ignore_errors; */          False,
  /* ignore_nonreadable; */     False,
  /* list; */                   True,
+ /* munge_symlinks; */         (BOOL)-1,
+ /* numeric_ids; */            (BOOL)-1,
  /* read_only; */              True,
  /* strict_modes; */           True,
  /* transfer_logging; */       False,
@@ -299,6 +303,7 @@ static struct parm_struct parm_table[] =
  {"socket options",    P_STRING, P_GLOBAL,&Globals.socket_options,     NULL,0},
 
  {"auth users",        P_STRING, P_LOCAL, &sDefault.auth_users,        NULL,0},
+ {"charset",           P_STRING, P_LOCAL, &sDefault.charset,           NULL,0},
  {"comment",           P_STRING, P_LOCAL, &sDefault.comment,           NULL,0},
  {"dont compress",     P_STRING, P_LOCAL, &sDefault.dont_compress,     NULL,0},
  {"exclude from",      P_STRING, P_LOCAL, &sDefault.exclude_from,      NULL,0},
@@ -319,7 +324,9 @@ static struct parm_struct parm_table[] =
  {"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},
+ {"numeric ids",       P_BOOL,   P_LOCAL, &sDefault.numeric_ids,       NULL,0},
  {"outgoing chmod",    P_STRING, P_LOCAL, &sDefault.outgoing_chmod,    NULL,0},
  {"path",              P_PATH,   P_LOCAL, &sDefault.path,              NULL,0},
 #ifdef HAVE_PUTENV
@@ -389,6 +396,7 @@ FN_GLOBAL_STRING(lp_socket_options, &Globals.socket_options)
 FN_GLOBAL_INTEGER(lp_rsync_port, &Globals.rsync_port)
 
 FN_LOCAL_STRING(lp_auth_users, auth_users)
+FN_LOCAL_STRING(lp_charset, charset)
 FN_LOCAL_STRING(lp_comment, comment)
 FN_LOCAL_STRING(lp_dont_compress, dont_compress)
 FN_LOCAL_STRING(lp_exclude, exclude)
@@ -410,18 +418,20 @@ 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)
 
 FN_LOCAL_INTEGER(lp_max_connections, max_connections)
 FN_LOCAL_INTEGER(lp_max_verbosity, max_verbosity)
+FN_LOCAL_INTEGER(lp_syslog_facility, syslog_facility)
 FN_LOCAL_INTEGER(lp_timeout, timeout)
 
 FN_LOCAL_BOOL(lp_fake_super, fake_super)
 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_numeric_ids, numeric_ids)
 FN_LOCAL_BOOL(lp_read_only, read_only)
 FN_LOCAL_BOOL(lp_strict_modes, strict_modes)
 FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)
@@ -780,6 +790,11 @@ static BOOL do_section(char *sectionname)
      return(True);
    }
 
+   if (strchr(sectionname, '/') != NULL) {
+     rprintf(FLOG, "Warning: invalid section name in configuration file: %s\n", sectionname);
+     return False;
+   }
+
    /* if we have a current service, tidy it up before moving on */
    bRetval = True;