From: Romain Fliedel Date: Fri, 20 Jun 2014 13:45:09 +0000 (+0200) Subject: Silently ignore lchmod failure in when not supported X-Git-Tag: v3.1.900a~279^2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F82%2Fhead;p=thirdparty%2Flibarchive.git Silently ignore lchmod failure in when not supported lchmod might be defined but not supported by the platform, (this is the case with musl implementation of fchmodat) in this case we can safely ignore the error. --- diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 3deb5515c..ff2173f21 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -3056,9 +3056,21 @@ set_mode(struct archive_write_disk *a, int mode) * impact. */ if (lchmod(a->name, mode) != 0) { - archive_set_error(&a->archive, errno, - "Can't set permissions to 0%o", (int)mode); - r = ARCHIVE_WARN; + switch (errno) { + case ENOTSUP: + case ENOSYS: + case EOPNOTSUPP: + /* + * if lchmod is defined but the platform + * doesn't support it, silently ignore + * error + */ + break; + default: + archive_set_error(&a->archive, errno, + "Can't set permissions to 0%o", (int)mode); + r = ARCHIVE_WARN; + } } #endif } else if (!S_ISDIR(a->mode)) {