Skip to content

Commit f4c9f4d

Browse files
committed
1 parent 0ce777d commit f4c9f4d

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

libs/filesystem/src/operations.cpp

+13-7
Original file line numberDiff line numberDiff line change
@@ -1400,20 +1400,26 @@ namespace detail
14001400
else if (prms & remove_perms)
14011401
prms = current_status.permissions() & ~prms;
14021402

1403-
// Mac OS X Lion and some other platforms don't support fchmodat().
1404-
// Solaris (SunPro and gcc) only support fchmodat() on Solaris 11 and higher,
1405-
// and a runtime check is too much trouble.
1406-
// Linux does not support permissions on symbolic links and has no plans to
1403+
1404+
// OS X <10.10, iOS <8.0 and some other platforms don't support fchmodat().
1405+
// Solaris (SunPro and gcc) only support fchmodat() on Solaris 11 and higher,
1406+
// and a runtime check is too much trouble.
1407+
// Linux does not support permissions on symbolic links and has no plans to
14071408
// support them in the future. The chmod() code is thus more practical,
14081409
// rather than always hitting ENOTSUP when sending in AT_SYMLINK_NO_FOLLOW.
14091410
// - See the 3rd paragraph of
14101411
// "Symbolic link ownership, permissions, and timestamps" at:
14111412
// "http://man7.org/linux/man-pages/man7/symlink.7.html"
14121413
// - See the fchmodat() Linux man page:
14131414
// "http://man7.org/linux/man-pages/man2/fchmodat.2.html"
1414-
# if defined(AT_FDCWD) && defined(AT_SYMLINK_NOFOLLOW) \
1415-
&& !(defined(__SUNPRO_CC) || defined(__sun) || defined(sun)) \
1416-
&& !(defined(linux) || defined(__linux) || defined(__linux__))
1415+
1416+
# if defined(AT_FDCWD) && defined(AT_SYMLINK_NOFOLLOW) \
1417+
&& !(defined(__SUNPRO_CC) || defined(__sun) || defined(sun)) \
1418+
&& !(defined(linux) || defined(__linux) || defined(__linux__)) \
1419+
&& !(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) \
1420+
&& __MAC_OS_X_VERSION_MIN_REQUIRED < 101000) \
1421+
&& !(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) \
1422+
&& __IPHONE_OS_VERSION_MIN_REQUIRED < 80000)
14171423
if (::fchmodat(AT_FDCWD, p.c_str(), mode_cast(prms),
14181424
!(prms & symlink_perms) ? 0 : AT_SYMLINK_NOFOLLOW))
14191425
# else // fallback if fchmodat() not supported

0 commit comments

Comments
 (0)