=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/receiver.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/usr.bin/rsync/receiver.c 2019/02/16 10:44:01 1.12 +++ src/usr.bin/rsync/receiver.c 2019/02/16 10:47:20 1.13 @@ -1,4 +1,4 @@ -/* $Id: receiver.c,v 1.12 2019/02/16 10:44:01 florian Exp $ */ +/* $Id: receiver.c,v 1.13 2019/02/16 10:47:20 florian Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons @@ -86,6 +86,16 @@ return 0; } LOG4(sess, "%s: updated date", f->path); + } + + /* Conditionally adjust file permissions. */ + + if (newfile || sess->opts->preserve_perms) { + if (fchmod(fd, f->st.mode) == -1) { + ERR(sess, "%s: fchmod", path); + return 0; + } + LOG4(sess, "%s: updated permissions", f->path); } return 1;