Skip to content

Commit 40caa05

Browse files
authored
closes bpo-34652: Always disable lchmod on Linux. (GH-9234)
1 parent 2087023 commit 40caa05

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
@@ -11285,6 +11285,17 @@ fi
1128511285
done
1128611286

1128711287

11288+
# Force lchmod off for Linux. Linux disallows changing the mode of symbolic
11289+
# links. Some libc implementations have a stub lchmod implementation that always
11290+
# returns an error.
11291+
if test "$MACHDEP" != linux; then
11292+
ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod"
11293+
if test "x$ac_cv_func_lchmod" = xyes; then :
11294+
11295+
fi
11296+
11297+
fi
11298+
1128811299
ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
1128911300
#include <dirent.h>
1129011301
"

configure.ac

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

3457+
# Force lchmod off for Linux. Linux disallows changing the mode of symbolic
3458+
# links. Some libc implementations have a stub lchmod implementation that always
3459+
# returns an error.
3460+
if test "$MACHDEP" != linux; then
3461+
AC_CHECK_FUNC(lchmod)
3462+
fi
3463+
34573464
AC_CHECK_DECL(dirfd,
34583465
AC_DEFINE(HAVE_DIRFD, 1,
34593466
Define if you have the 'dirfd' function or macro.), ,

0 commit comments

Comments
 (0)