From 0c56e281f10f624a083731123f98e9a7fd8063b7 Mon Sep 17 00:00:00 2001 From: Bernard Quatermass Date: Thu, 18 Apr 2024 13:59:18 +0100 Subject: [PATCH] _PC_CHOWN_RESTRICTED can only be used via pathconf/fpathconf not sysconf --- cpan/File-Temp/lib/File/Temp.pm | 2 +- pod/perlfunc.pod | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpan/File-Temp/lib/File/Temp.pm b/cpan/File-Temp/lib/File/Temp.pm index 570f25a5619e..b468a4f8aa6d 100644 --- a/cpan/File-Temp/lib/File/Temp.pm +++ b/cpan/File-Temp/lib/File/Temp.pm @@ -749,7 +749,7 @@ sub _is_verysafe { if (defined $chown_restricted) { # Return if the current directory is safe - return _is_safe($path,$err_ref) if POSIX::sysconf( $chown_restricted ); + return _is_safe($path,$err_ref) if POSIX::pathconf( $path, $chown_restricted ); } diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 83885f8a9571..bede8d184b78 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1283,8 +1283,8 @@ the group to any of your secondary groups. On insecure systems, these restrictions may be relaxed, but this is not a portable assumption. On POSIX systems, you can detect this condition this way: - use POSIX qw(sysconf _PC_CHOWN_RESTRICTED); - my $can_chown_giveaway = ! sysconf(_PC_CHOWN_RESTRICTED); + use POSIX qw(pathconf _PC_CHOWN_RESTRICTED); + my $can_chown_giveaway = ! pathconf($path_of_interest,_PC_CHOWN_RESTRICTED); Portability issues: L.