Skip Menu |
Report information
Id: 128967
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: atoomic <me [at] eboxr.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



Subject: Inconsistency between doc and code for chown using negative argument: -1
Download (untitled) / with headers
text/plain 845b
Recent change to perl 5.24 change the chown behavior when using -1 argument: https://github.com/Perl/perl5/commit/f95ba548a286b17c260cc168715a9d0d441b14a6 But perldoc for chow still mention: "A value of -1 in either position is interpreted by most systems to leave that value unchanged." I'm not sure which part is incorrect: the doc ? or the change ? My code was currently using the chown -1 feature documented. Is it now deprecated ? Should we revert this commit or update the doc ? Thanks for the clarification on this. nicolas # chown root: /tmp/xxx; perl522 -E 'open my $f, ">", "/tmp/xxx"; say chown -1, 99, $f'; ls -l /tmp/xxx 1 -rw-r--r-- 1 root nobody 0 Aug 16 16:45 /tmp/xxx # chown root: /tmp/xxx; perl524 -E 'open my $f, ">", "/tmp/xxx"; say chown -1, 99, $f'; ls -l /tmp/xxx 0 -rw-r--r-- 1 root root 0 Aug 16 16:46 /tmp/xxx
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.1k
On Tue Aug 16 15:50:31 2016, atoomic wrote: Show quoted text
> Recent change to perl 5.24 change the chown behavior when using -1 > argument: > https://github.com/Perl/perl5/commit/f95ba548a286b17c260cc168715a9d0d441b14a6 > > But perldoc for chow still mention: > "A value of -1 in either position is interpreted by most systems to > leave that value unchanged." > > I'm not sure which part is incorrect: the doc ? or the change ? > My code was currently using the chown -1 feature documented. > > Is it now deprecated ? > Should we revert this commit or update the doc ? > > Thanks for the clarification on this. > nicolas > > # chown root: /tmp/xxx; perl522 -E 'open my $f, ">", "/tmp/xxx"; say > chown -1, 99, $f'; ls -l /tmp/xxx > 1 > -rw-r--r-- 1 root nobody 0 Aug 16 16:45 /tmp/xxx > > # chown root: /tmp/xxx; perl524 -E 'open my $f, ">", "/tmp/xxx"; say > chown -1, 99, $f'; ls -l /tmp/xxx > 0 > -rw-r--r-- 1 root root 0 Aug 16 16:46 /tmp/xxx
Commit f95ba548a28 looks like a mistake to me. The change was made to appease a linter that didn’t like the idea of a negative argument because someone decided at some point to make it not like it. Makes no sense to me. -- Father Chrysostomos
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.4k
On Tue Aug 16 15:59:52 2016, sprout wrote: Show quoted text
> On Tue Aug 16 15:50:31 2016, atoomic wrote:
> > Recent change to perl 5.24 change the chown behavior when using -1 > > argument: > > https://github.com/Perl/perl5/commit/f95ba548a286b17c260cc168715a9d0d441b14a6 > > > > But perldoc for chow still mention: > > "A value of -1 in either position is interpreted by most systems to > > leave that value unchanged." > > > > I'm not sure which part is incorrect: the doc ? or the change ? > > My code was currently using the chown -1 feature documented. > > > > Is it now deprecated ? > > Should we revert this commit or update the doc ? > > > > Thanks for the clarification on this. > > nicolas > > > > # chown root: /tmp/xxx; perl522 -E 'open my $f, ">", "/tmp/xxx"; say > > chown -1, 99, $f'; ls -l /tmp/xxx > > 1 > > -rw-r--r-- 1 root nobody 0 Aug 16 16:45 /tmp/xxx > > > > # chown root: /tmp/xxx; perl524 -E 'open my $f, ">", "/tmp/xxx"; say > > chown -1, 99, $f'; ls -l /tmp/xxx > > 0 > > -rw-r--r-- 1 root root 0 Aug 16 16:46 /tmp/xxx
> > Commit f95ba548a28 looks like a mistake to me. The change was made to > appease a linter that didn’t like the idea of a negative argument > because someone decided at some point to make it not like it. > > Makes no sense to me.
Looks like the negative arguments to fchown are supported in some systems, with some semantics, under some conditions. In other words, nothing portable can be said about it. So reverting the change and telling Coverity to shut up about it.
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.8k
Please also revert https://github.com/Perl/perl5/commit/c4f643b9fca4c4487ef74e4e6cd5b61a26025698 at the same time you are reverting https://github.com/Perl/perl5/commit/f95ba548a286b17c260cc168715a9d0d441b14a6 On Tue Aug 16 16:09:54 2016, jhi wrote: Show quoted text
> On Tue Aug 16 15:59:52 2016, sprout wrote:
> > On Tue Aug 16 15:50:31 2016, atoomic wrote:
> > > Recent change to perl 5.24 change the chown behavior when using -1 > > > argument: > > > https://github.com/Perl/perl5/commit/f95ba548a286b17c260cc168715a9d0d441b14a6 > > > > > > But perldoc for chow still mention: > > > "A value of -1 in either position is interpreted by most systems to > > > leave that value unchanged." > > > > > > I'm not sure which part is incorrect: the doc ? or the change ? > > > My code was currently using the chown -1 feature documented. > > > > > > Is it now deprecated ? > > > Should we revert this commit or update the doc ? > > > > > > Thanks for the clarification on this. > > > nicolas > > > > > > # chown root: /tmp/xxx; perl522 -E 'open my $f, ">", "/tmp/xxx"; > > > say > > > chown -1, 99, $f'; ls -l /tmp/xxx > > > 1 > > > -rw-r--r-- 1 root nobody 0 Aug 16 16:45 /tmp/xxx > > > > > > # chown root: /tmp/xxx; perl524 -E 'open my $f, ">", "/tmp/xxx"; > > > say > > > chown -1, 99, $f'; ls -l /tmp/xxx > > > 0 > > > -rw-r--r-- 1 root root 0 Aug 16 16:46 /tmp/xxx
> > > > Commit f95ba548a28 looks like a mistake to me. The change was made > > to > > appease a linter that didn’t like the idea of a negative argument > > because someone decided at some point to make it not like it. > > > > Makes no sense to me.
> > Looks like the negative arguments to fchown are supported in some > systems, with some semantics, under some conditions. In other words, > nothing portable can be said about it. So reverting the change and > telling Coverity to shut up about it.
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 335b
On Wed Aug 17 07:47:43 2016, atoomic wrote: Show quoted text
Can Jarkko explain the purpose of c4f643b9f? -- Father Chrysostomos
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 596b
looks like the second commit happened after the first one in order to fix the unit test as -1 was not available anymore for chown.... that's why I think they are going together, but maybe Jarkko was addressing another problem ? On Wed Aug 17 16:40:40 2016, sprout wrote: Show quoted text
> On Wed Aug 17 07:47:43 2016, atoomic wrote: > > Can Jarkko explain the purpose of c4f643b9f?
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 326b
On Wed, 17 Aug 2016 07:47:43 -0700, atoomic wrote: Show quoted text
Done in 622584734f799751a284558aaebad21acd3270bf. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 501b
On Tue, 15 Nov 2016 04:13:58 GMT, tonyc wrote: Show quoted text
> On Wed, 17 Aug 2016 07:47:43 -0700, atoomic wrote: > > Done in 622584734f799751a284558aaebad21acd3270bf. > > Tony
Are there any issues outstanding for this ticket? Thank you very much. -- James E Keenan (jkeenan@cpan.org)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 620b
we can close this ticket the revert was done, and now everything is in sync On Thu, 29 Dec 2016 06:11:58 -0800, jkeenan wrote: Show quoted text
> On Tue, 15 Nov 2016 04:13:58 GMT, tonyc wrote:
> > On Wed, 17 Aug 2016 07:47:43 -0700, atoomic wrote: > > > > Done in 622584734f799751a284558aaebad21acd3270bf. > > > > Tony
> > Are there any issues outstanding for this ticket? > > Thank you very much.
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 765b
On Thu, 29 Dec 2016 18:52:08 GMT, atoomic wrote: Show quoted text
> we can close this ticket the revert was done, and now everything is in > sync > > On Thu, 29 Dec 2016 06:11:58 -0800, jkeenan wrote:
> > On Tue, 15 Nov 2016 04:13:58 GMT, tonyc wrote:
> > > On Wed, 17 Aug 2016 07:47:43 -0700, atoomic wrote: > > > > > > Done in 622584734f799751a284558aaebad21acd3270bf. > > > > > > Tony
> > > > Are there any issues outstanding for this ticket? > > > > Thank you very much.
Marking ticket Resolved. -- James E Keenan (jkeenan@cpan.org)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org