]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-34652: Always disable lchmod on Linux. (GH-9234)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 12 Sep 2018 23:36:05 +0000 (16:36 -0700)
committerGitHub <noreply@github.com>
Wed, 12 Sep 2018 23:36:05 +0000 (16:36 -0700)
(cherry picked from commit 40caa05fa4d1810a1a6bfc34e0ec930c351089b7)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
Misc/NEWS.d/next/Library/2018-09-12-14-46-51.bpo-34652.Rt1m1b.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Library/2018-09-12-14-46-51.bpo-34652.Rt1m1b.rst b/Misc/NEWS.d/next/Library/2018-09-12-14-46-51.bpo-34652.Rt1m1b.rst
new file mode 100644 (file)
index 0000000..cbdd7e0
--- /dev/null
@@ -0,0 +1 @@
+Ensure :func:`os.lchmod` is never defined on Linux.
index 7e39458727d02d76b4ba26ee5fe370f998437be2..1219cb9ffa915ee1290f11adb9bf9abca9d0ef87 100755 (executable)
--- a/configure
+++ b/configure
 done
 
 
+# Force lchmod off for Linux. Linux disallows changing the mode of symbolic
+# links. Some libc implementations have a stub lchmod implementation that always
+# returns an error.
+if test "$MACHDEP" != linux; then
+  ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod"
+if test "x$ac_cv_func_lchmod" = xyes; then :
+
+fi
+
+fi
+
 ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
        #include <dirent.h>
 "
index 2b8aa4d592f9031cbf31837a4246e81f5c97922d..d7e0de3a32d358a74b04117bb8f1695c871331bf 100644 (file)
@@ -3519,6 +3519,13 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
  truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
  wcscoll wcsftime wcsxfrm wmemcmp writev _getpty)
 
+# Force lchmod off for Linux. Linux disallows changing the mode of symbolic
+# links. Some libc implementations have a stub lchmod implementation that always
+# returns an error.
+if test "$MACHDEP" != linux; then
+  AC_CHECK_FUNC(lchmod)
+fi
+
 AC_CHECK_DECL(dirfd,
     AC_DEFINE(HAVE_DIRFD, 1,
               Define if you have the 'dirfd' function or macro.), ,