8000 closes bpo-34652: Always disable lchmod on Linux. (GH-9234) · python/cpython@bdace2e · GitHub
[go: up one dir, main page]

Skip to content

Commit bdace2e

Browse files
closes bpo-34652: Always disable lchmod on Linux. (GH-9234)
(cherry picked from commit 40caa05) Co-authored-by: Benjamin Peterson <benjamin@python.org>
1 parent e105e55 commit bdace2e

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure :func:`os.lchmod` is never defined on Linux.

configure

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11377,6 +11377,17 @@ fi
1137711377
done
1137811378

1137911379

11380+
# Force lchmod off for Linux. Linux disallows changing the mode of symbolic
11381+
# links. Some libc implementations have a stub lchmod implementation that always
11382+
# returns an error.
11383+
if test "$MACHDEP" != linux; then
11384+
ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod"
11385+
if test "x$ac_cv_func_lchmod" = xyes; then :
11386+
11387+
fi
11388+
11389+
fi
11390+
1138011391
ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
1138111392
#include <dirent.h>
1138211393
"

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3495,6 +3495,13 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
34953495
truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
34963496
wcscoll wcsftime wcsxfrm wmemcmp writev _getpty)
34973497

3498+
# Force lchmod off for Linux. Linux disallows changing the mode of symbolic
3499+
# links. Some libc implementations have a stub lchmod implementation that always
3500+
# returns an error.
3501+
if test "$MACHDEP" != linux; then
3502+
AC_CHECK_FUNC(lchmod)
3503+
fi
3504+
34983505
AC_CHECK_DECL(dirfd,
34993506
AC_DEFINE(HAVE_DIRFD, 1,
35003507
Define if you have the 'dirfd' function or macro.), ,

0 commit comments

Comments
 (0)
0