From 142aba00d52143c25d3de9287d6b946e1188b6d0 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 17 Jan 2022 22:12:21 -0800 Subject: [PATCH] Silence some symlink mode-change failures. --- NEWS.md | 5 ++++- generator.c | 2 +- syscall.c | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index a2734d52..3083ca3a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -94,6 +94,9 @@ - Tweak --progress to display "`??:??:??`" when the time-remaining value is so large as to be meaningless. + - Silence some chmod warnings about symlinks when it looks like we have a + function to set their permissions but they can't really be set. + ### ENHANCEMENTS: - Use openssl's `-verify_hostname` option in the rsync-ssl script. @@ -170,7 +173,7 @@ - Try to support a client that sent a remote rsync a wacko stderr file handle (such as an older File::RsyncP perl library used by BackupPC). - - Some man page improvements. + - Lots of man page improvements, including better html versions. ### PACKAGING RELATED: diff --git a/generator.c b/generator.c index 3a45b4bd..454fd19f 100644 --- a/generator.c +++ b/generator.c @@ -532,7 +532,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre iflags |= ITEM_REPORT_CRTIME; } #endif -#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST +#ifndef CAN_CHMOD_SYMLINK if (S_ISLNK(file->mode)) { ; } else diff --git a/syscall.c b/syscall.c index c037349b..f6a7b0af 100644 --- a/syscall.c +++ b/syscall.c @@ -257,7 +257,10 @@ int do_chmod(const char *path, mode_t mode) memset(&attrList, 0, sizeof attrList); attrList.bitmapcount = ATTR_BIT_MAP_COUNT; attrList.commonattr = ATTR_CMN_ACCESSMASK; - code = setattrlist(path, &attrList, &m, sizeof m, FSOPT_NOFOLLOW); + if ((code = setattrlist(path, &attrList, &m, sizeof m, FSOPT_NOFOLLOW)) == 0) + break; + if (errno == ENOTSUP) + code = 1; # else code = 1; # endif -- 2.47.2