Skip to content

Commit 51d3acf

Browse files
committed
Merge pull request libarchive#82 from r0ro/master
Silently ignore lchmod failure in when not supported
2 parents 0128b5a + 65fe103 commit 51d3acf

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

libarchive/archive_write_disk_posix.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3060,9 +3060,21 @@ set_mode(struct archive_write_disk *a, int mode)
30603060
* impact.
30613061
*/
30623062
if (lchmod(a->name, mode) != 0) {
3063-
archive_set_error(&a->archive, errno,
3064-
"Can't set permissions to 0%o", (int)mode);
3065-
r = ARCHIVE_WARN;
3063+
switch (errno) {
3064+
case ENOTSUP:
3065+
case ENOSYS:
3066+
case EOPNOTSUPP:
3067+
/*
3068+
* if lchmod is defined but the platform
3069+
* doesn't support it, silently ignore
3070+
* error
3071+
*/
3072+
break;
3073+
default:
3074+
archive_set_error(&a->archive, errno,
3075+
"Can't set permissions to 0%o", (int)mode);
3076+
r = ARCHIVE_WARN;
3077+
}
30663078
}
30673079
#endif
30683080
} else if (!S_ISDIR(a->mode)) {

0 commit comments

Comments
 (0)