closes bpo-34652: Always disable lchmod on Linux. (GH-9234)

(cherry picked from commit 40caa05fa4)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
This commit is contained in:
Benjamin Peterson 2018-09-12 15:52:40 -07:00 committed by Miss Islington (bot)
parent ec4d099b9f
commit 883702ebb8
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1 @@
Ensure :func:`os.lchmod` is never defined on Linux.

11
configure vendored
View File

@ -11354,6 +11354,17 @@ fi
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>
"

View 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.), ,