A patch for Service Location Protocol support (derived from a
[rsync/rsync-patches.git] / rsyncd-perm.diff
index de1d357..f73d0f1 100644 (file)
@@ -1,51 +1,55 @@
---- orig/loadparm.c    2005-06-10 21:33:28
-+++ loadparm.c 2005-06-10 23:38:53
-@@ -143,6 +143,10 @@ typedef struct
-       int timeout;
-       int max_connections;
-       int max_verbosity;
+--- orig/loadparm.c    2005-09-19 17:21:10
++++ loadparm.c 2005-09-16 20:41:11
+@@ -140,6 +140,10 @@ typedef struct
+       char *temp_dir;
+       char *uid;
 +      int create_mask;
-+      int force_create_mode;
 +      int directory_mask;
++      int force_create_mode;
 +      int force_directory_mode;
-       BOOL ignore_nonreadable;
- } service;
+       int max_connections;
+       int max_verbosity;
+       int timeout;
+@@ -183,6 +187,10 @@ static service sDefault =
+  /* temp_dir; */              NULL,
+  /* uid; */                   NOBODY_USER,
  
-@@ -178,6 +182,10 @@ static service sDefault =
-       0,        /* timeout */
-       0,        /* max connections */
-       1,        /* max verbosity */
-+      CHMOD_BITS,/* create mask */
-+      0,        /* force create mode */
-+      CHMOD_BITS,/* directory mask */
-+      0,        /* force directory mode */
-       False     /* ignore nonreadable */
- };
++ /* create_mask; */           CHMOD_BITS,
++ /* directory_mask; */                CHMOD_BITS,
++ /* force_create_mode; */     0,
++ /* force_directory_mode; */  0,
+  /* max_connections; */               0,
+  /* max_verbosity; */         1,
+  /* timeout; */                       0,
+@@ -287,10 +295,14 @@ static struct parm_struct parm_table[] =
  
-@@ -298,6 +306,10 @@ static struct parm_struct parm_table[] =
-   {"log format",       P_STRING,  P_LOCAL,  &sDefault.log_format,  NULL,   0},
-   {"refuse options",   P_STRING,  P_LOCAL,  &sDefault.refuse_options,NULL, 0},
-   {"dont compress",    P_STRING,  P_LOCAL,  &sDefault.dont_compress,NULL,  0},
-+  {"create mask",      P_OCTAL,   P_LOCAL,  &sDefault.create_mask, NULL, 0},
-+  {"force create mode",P_OCTAL,   P_LOCAL,  &sDefault.force_create_mode, NULL, 0},
-+  {"directory mask",   P_OCTAL,   P_LOCAL,  &sDefault.directory_mask, NULL, 0},
-+  {"force directory mode",P_OCTAL,P_LOCAL,  &sDefault.force_directory_mode, NULL, 0},
-   {NULL,               P_BOOL,    P_NONE,   NULL,                  NULL,   0}
- };
+  {"auth users",        P_STRING, P_LOCAL, &sDefault.auth_users,        NULL,0},
+  {"comment",           P_STRING, P_LOCAL, &sDefault.comment,           NULL,0},
++ {"create mask",       P_OCTAL,  P_LOCAL, &sDefault.create_mask,       NULL,0},
++ {"directory mask",    P_OCTAL,  P_LOCAL, &sDefault.directory_mask,    NULL,0},
+  {"dont compress",     P_STRING, P_LOCAL, &sDefault.dont_compress,     NULL,0},
+  {"exclude from",      P_STRING, P_LOCAL, &sDefault.exclude_from,      NULL,0},
+  {"exclude",           P_STRING, P_LOCAL, &sDefault.exclude,           NULL,0},
+  {"filter",            P_STRING, P_LOCAL, &sDefault.filter,            NULL,0},
++ {"force create mode", P_OCTAL,  P_LOCAL, &sDefault.force_create_mode, NULL,0},
++ {"force directory mode",P_OCTAL,P_LOCAL, &sDefault.force_directory_mode,NULL,0},
+  {"gid",               P_STRING, P_LOCAL, &sDefault.gid,               NULL,0},
+  {"hosts allow",       P_STRING, P_LOCAL, &sDefault.hosts_allow,       NULL,0},
+  {"hosts deny",        P_STRING, P_LOCAL, &sDefault.hosts_deny,        NULL,0},
+@@ -397,6 +409,10 @@ FN_LOCAL_STRING(lp_secrets_file, secrets
+ FN_LOCAL_STRING(lp_temp_dir, temp_dir)
+ FN_LOCAL_STRING(lp_uid, uid)
  
-@@ -382,6 +394,10 @@ FN_LOCAL_STRING(lp_dont_compress, dont_c
- FN_LOCAL_INTEGER(lp_timeout, timeout)
- FN_LOCAL_INTEGER(lp_max_connections, max_connections)
- FN_LOCAL_INTEGER(lp_max_verbosity, max_verbosity)
 +FN_LOCAL_INTEGER(lp_create_mask, create_mask)
-+FN_LOCAL_INTEGER(lp_force_create_mode, force_create_mode)
 +FN_LOCAL_INTEGER(lp_directory_mask, directory_mask)
++FN_LOCAL_INTEGER(lp_force_create_mode, force_create_mode)
 +FN_LOCAL_INTEGER(lp_force_directory_mode, force_directory_mode)
- /* local prototypes */
- static int    strwicmp(char *psz1, char *psz2);
+ FN_LOCAL_INTEGER(lp_max_connections, max_connections)
+ FN_LOCAL_INTEGER(lp_max_verbosity, max_verbosity)
+ FN_LOCAL_INTEGER(lp_timeout, timeout)
 --- orig/rsync.c       2005-07-27 23:31:12
-+++ rsync.c    2005-07-27 23:49:21
++++ rsync.c    2005-07-28 00:54:53
 @@ -32,6 +32,8 @@ extern int am_server;
  extern int am_sender;
  extern int am_generator;
  extern int preserve_uid;
  extern int preserve_gid;
  extern int inplace;
-@@ -56,6 +58,17 @@ int set_perms(char *fname,struct file_st
+@@ -56,6 +58,7 @@ int set_perms(char *fname,struct file_st
        int updated = 0;
        STRUCT_STAT st2;
        int change_uid, change_gid;
 +      mode_t mode = file->mode; /* file->mode shouldn't be modified */
-+
+       if (!st) {
+               if (dry_run)
+@@ -125,9 +128,19 @@ int set_perms(char *fname,struct file_st
+               updated = 1;
+       }
 +      if (am_daemon) {
 +              if (S_ISDIR(st->st_mode)) {
 +                      mode = (mode & lp_directory_mask(module_id))
 +                           | lp_force_create_mode(module_id);
 +              }
 +      }
-       if (!st) {
-               if (dry_run)
-@@ -126,8 +139,8 @@ int set_perms(char *fname,struct file_st
-       }
++
  #ifdef HAVE_CHMOD
 -      if ((st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) {
 -              int ret = do_chmod(fname, file->mode);
@@ -84,9 +89,9 @@
                if (ret < 0) {
                        rsyserr(FERROR, errno,
                                "failed to set permissions on %s",
---- orig/rsyncd.conf.yo        2005-07-07 23:11:09
+--- orig/rsyncd.conf.yo        2005-07-29 02:47:20
 +++ rsyncd.conf.yo     2005-03-31 08:28:41
-@@ -221,6 +221,70 @@ file transfers to and from that module s
+@@ -218,6 +218,70 @@ file transfers to and from that module s
  was run as root. This complements the "uid" option. The default is gid -2,
  which is normally the group "nobody".