Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 524 forks source link

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

Closed BernardQuatermass closed 1 week ago

BernardQuatermass commented 1 week ago

The documentation regarding availability of chown (perldoc -f chown) incorrectly uses the sysconf() function rather than the pathconf() function along with a path.

PC can only be used as parameters to pathconf()/fpathconf(). Only SC values can be used against sysconf().

Cannot speak to other systems but on all linux systems the original code would be returning the value for "_SC_TZNAME_MAX, The maximum number of bytes in a timezone name."

There is also an matching misuse in cpan/File-Temp/lib/File/Temp.pm

mauke commented 1 week ago

The modules in cpan/ are maintained elsewhere (see https://github.com/Perl-Toolchain-Gang/File-Temp/pull/41). The change to File::Temp should be reverted.

The change to perlfunc.pod looks good to me.

jkeenan commented 1 week ago

The modules in cpan/ are maintained elsewhere (see Perl-Toolchain-Gang/File-Temp#41). The change to File::Temp should be reverted.

Yes, there should be no change to File::Temp in this p.r.; that should be done upstream.

@BernardQuatermass, can you run perl Porting/updateAUTHORS.pl to add your name and email address to our AUTHORS file, then re-push? thanks.

The change to perlfunc.pod looks good to me.

mauke commented 1 week ago

Replaced by #22161.