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 #22161

Merged
merged 2 commits into from
Apr 21, 2024

Conversation

BernardQuatermass
Copy link

@BernardQuatermass BernardQuatermass commented Apr 21, 2024

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."

Copy link
Author

@BernardQuatermass BernardQuatermass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@jkeenan jkeenan requested a review from mauke April 21, 2024 11:04
@mauke mauke changed the title Chwoops _PC_CHOWN_RESTRICTED can only be used via pathconf/fpathconf, not sysconf Apr 21, 2024
@mauke
Copy link
Contributor

mauke commented Apr 21, 2024

I had some issues with porting tests failing, so I made some minor changes and force-pushed the PR branch. fingers crossed

@jkeenan jkeenan merged commit c29a531 into Perl:blead Apr 21, 2024
29 checks passed
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Apr 30, 2024
The wrong function was being used (POSIX::sysconf) to determine the value
of _PC_CHOWN_RESTRICTED, neutering the security feature.

Migrate to POSIX::pathconf, as is now recommended by the Perl documentation
(Perl/perl5#22161).

This patch hasn't yet been merged upstream into File-Temp, but the documentation
change rectifying the error in Perl itself has been merged, so I'm confident
it's the right thing to do.

Closes: https://bugs.gentoo.org/930949
Signed-off-by: Sam James <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants