summaryrefslogtreecommitdiff
path: root/rsync.h
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>1999-03-04 21:48:52 +0000
committerDavid Dykstra <dwd@samba.org>1999-03-04 21:48:52 +0000
commit972a3619c4ea253671e2fe0897f99af897782e26 (patch)
treee71f800efe91481636fcd6c57aadc86d58b71bd0 /rsync.h
parent8458724d2558659cfb5e53443759cac5419b13bf (diff)
downloadrsync-972a3619c4ea253671e2fe0897f99af897782e26.tar.gz
The change a couple days ago to create files initially without group and
other access resulted in group and other access being left off when the '-p' option was not used. This fixes it by reintroducing the ACCESSPERMS mask and setting permissions to (file->mode & ACCESSPERMS) if preserve_perms is off. I decided to change the mask INITPERMMASK to INITACCESSPERMS at the same time. When preserve_perms is off, rsync is restored to the previous behavior of having the permissions of the original file with the umask and setuid/setgid bits shut off. Also, I decided that a check for "(updated && (file->mode & ~ACCESSPERMS))" is no longer needed since as far as I can tell that would have only affected permissions when not running as root and when a chgrp was done to a group the user was not a member of, using system V chgrp semantics. This is no longer allowed.
Diffstat (limited to 'rsync.h')
-rw-r--r--rsync.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/rsync.h b/rsync.h
index 92823bbc..3e040d4f 100644
--- a/rsync.h
+++ b/rsync.h
@@ -462,10 +462,13 @@ extern int errno;
#define IS_DEVICE(mode) (S_ISCHR(mode) || S_ISBLK(mode) || S_ISSOCK(mode) || S_ISFIFO(mode))
+#ifndef ACCESSPERMS
+#define ACCESSPERMS 0777
+#endif
/* Initial mask on permissions given to temporary files. Mask off setuid
bits and group access because of potential race-condition security
holes, and mask other access because mode 707 is bizarre */
-#define INITPERMMASK 0700
+#define INITACCESSPERMS 0700
/* handler for null strings in printf format */
#define NS(s) ((s)?(s):"<NULL>")