summaryrefslogtreecommitdiff
path: root/flist.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-03-06 22:41:23 -0800
committerWayne Davison <wayned@samba.org>2009-03-06 22:41:23 -0800
commit4e0fa131fe6a5d864bb6918ff32671484df132c9 (patch)
tree03f392038e8bccc7c9c963f8fac19370b1f6d704 /flist.c
parent17a1676976deacb11cbd064f3de0032c7a381069 (diff)
downloadrsync-4e0fa131fe6a5d864bb6918ff32671484df132c9.tar.gz
rsync-4e0fa131fe6a5d864bb6918ff32671484df132c9.tar.bz2
rsync-4e0fa131fe6a5d864bb6918ff32671484df132c9.zip
Don't let --chmod tweak a 0 mode value (which marks a missing arg).
Diffstat (limited to 'flist.c')
-rw-r--r--flist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/flist.c b/flist.c
index 7d01c9c5..1c15d8c0 100644
--- a/flist.c
+++ b/flist.c
@@ -794,7 +794,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
- if (chmod_modes && !S_ISLNK(mode))
+ if (chmod_modes && !S_ISLNK(mode) && mode)
mode = tweak_mode(mode, chmod_modes);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
@@ -1372,7 +1372,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
if (!file)
return NULL;
- if (chmod_modes && !S_ISLNK(file->mode))
+ if (chmod_modes && !S_ISLNK(file->mode) && file->mode)
file->mode = tweak_mode(file->mode, chmod_modes);
if (f >= 0) {