Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_PC_CHOWN_RESTRICTED can only be used via pathconf/fpathconf not sysconf #22156

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpan/File-Temp/lib/File/Temp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

}

Expand Down
4 changes: 2 additions & 2 deletions pod/perlfunc.pod
Original file line number Diff line number Diff line change
Expand Up @@ -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<perlport/chown>.

Expand Down
Loading