GNU bug report logs - #8736
chmod -p --parents

Previous Next

Package: coreutils;

Reported by: francky.leyn <at> telenet.be

Date: Thu, 26 May 2011 22:31:02 UTC

Severity: normal

Tags: wontfix

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8736 in the body.
You can then email your comments to 8736 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8736; Package coreutils. (Thu, 26 May 2011 22:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to francky.leyn <at> telenet.be:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 26 May 2011 22:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: francky.leyn <at> telenet.be
To: bug-coreutils <at> gnu.org
Cc: Francky Leyn <Francky <at> Leyn.eu>
Subject: chmod -p --parents
Date: Thu, 26 May 2011 22:13:05 +0200 (CEST)
[Message part 1 (text/plain, inline)]

Hello, 



In the past, I was an advocate of the -p --parents option for 

mkdir. By now this is realised. Now I'm doing the same for chmod. 



I want this option for chmod for the following reason. 

I want my home directory shut. I do this with 

"chmod -R gw-rwx". The problem arises when I want to 

set open some file for group or world. Then I have to set 

open each directory level concerning this file. These 

can be numerious directories. All this is cumbersome, and a 

waist of time and energy. 



I want to be able to execute the following: 

chmod a+rx -p ~/dir1/dir2/dir3/file.ext 
It should be more refined however: the dirs 

should be rx, but the file only r. 



Please let me hear something. 



Best regards, 



Francky Leyn, 



www.Leyn.eu
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8736; Package coreutils. (Fri, 27 May 2011 14:56:02 GMT) Full text and rfc822 format available.

Message #8 received at 8736 <at> debbugs.gnu.org (full text, mbox):

From: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>
To: francky.leyn <at> telenet.be
Cc: 8736 <at> debbugs.gnu.org, Francky Leyn <Francky <at> Leyn.eu>
Subject: Re: bug#8736: chmod -p --parents
Date: Fri, 27 May 2011 16:54:57 +0200
Hi,

On Thu, May 26, 2011 at 10:13:05PM +0200, francky.leyn <at> telenet.be wrote:
> 
> In the past, I was an advocate of the -p --parents option for 
> mkdir. By now this is realised. Now I'm doing the same for chmod. 
> [...]
> I want to be able to execute the following: 
> 
> chmod a+rx -p ~/dir1/dir2/dir3/file.ext 

I like the proposal.

> It should be more refined however: the dirs 
> should be rx, but the file only r. 

You can use a capital X to automatically handle the directory case. But
please take a look at the docs for the _exact_ meaning of X.

Regards,
Erik
-- 
In the beginning, there were not enough colors.
                        -- Guy Keren




Information forwarded to bug-coreutils <at> gnu.org:
bug#8736; Package coreutils. (Wed, 22 Feb 2012 23:43:02 GMT) Full text and rfc822 format available.

Message #11 received at 8736 <at> debbugs.gnu.org (full text, mbox):

From: Jérémy Compostella <jeremy.compostella <at> gmail.com>
To: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>
Cc: 8736 <at> debbugs.gnu.org, coreutils <at> gnu.org, francky.leyn <at> telenet.be
Subject: Re: bug#8736: chmod -p --parents
Date: Thu, 23 Feb 2012 00:40:37 +0100
[Message part 1 (text/plain, inline)]
> Hi,
> 
> On Thu, May 26, 2011 at 10:13:05PM +0200, francky.leyn <at> telenet.be wrote:
> > 
> > In the past, I was an advocate of the -p --parents option for 
> > mkdir. By now this is realised. Now I'm doing the same for chmod. 
> > [...]
> > I want to be able to execute the following: 
> > 
> > chmod a+rx -p ~/dir1/dir2/dir3/file.ext 
> 
> I like the proposal.
> > It should be more refined however: the dirs 
> > should be rx, but the file only r. 
> 
> You can use a capital X to automatically handle the directory case. But
> please take a look at the docs for the _exact_ meaning of X.
I made a first implementation of this chmod --parents feature (see the
attached patch). I do not support the second part since 'X' is already
in used for the "Conditional Executability" feature. I have no idea how
to support it.

I don't have written the documentation for now. I would like to have
your opinion about this patch first as I maybe missed some corner case
or the code should be written another way or even something else ...

I really hope you will find time to look at it.

Cheers,

Jérémy
---
Sent from my Emacs

[0001-chmod-add-parents-option.patch (text/x-diff, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#8736; Package coreutils. (Thu, 23 Feb 2012 11:07:02 GMT) Full text and rfc822 format available.

Message #14 received at 8736 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Jérémy Compostella <jeremy.compostella <at> gmail.com>
Cc: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>, 8736 <at> debbugs.gnu.org,
	coreutils <at> gnu.org, francky.leyn <at> telenet.be
Subject: Re: bug#8736: chmod -p --parents
Date: Thu, 23 Feb 2012 12:04:22 +0100
Jérémy Compostella wrote:
>> On Thu, May 26, 2011 at 10:13:05PM +0200, francky.leyn <at> telenet.be wrote:
>> >
>> > In the past, I was an advocate of the -p --parents option for
>> > mkdir. By now this is realised. Now I'm doing the same for chmod.
>> > [...]
>> > I want to be able to execute the following:
>> >
>> > chmod a+rx -p ~/dir1/dir2/dir3/file.ext
>>
>> I like the proposal.
>> > It should be more refined however: the dirs
>> > should be rx, but the file only r.
>>
>> You can use a capital X to automatically handle the directory case. But
>> please take a look at the docs for the _exact_ meaning of X.
> I made a first implementation of this chmod --parents feature (see the
> attached patch). I do not support the second part since 'X' is already
> in used for the "Conditional Executability" feature. I have no idea how
> to support it.
>
> I don't have written the documentation for now. I would like to have
> your opinion about this patch first as I maybe missed some corner case
> or the code should be written another way or even something else ...
>
> I really hope you will find time to look at it.

Hi Jérémy,

Thank you for the patch, but as usual with option-adding patches,
we have to justify it, i.e., to ask "why not do it some other way?"
Or, "is this too specialized to merit an option?"

Here's a little bash/zsh script that does it:

chmod-parents()
{
  local p=$2
  while :; do
    chmod "$1" "$p" || break
    test "$p" = . && break
    p=$(dirname "$p")
  done
}

And an example showing how to use it:

  p=d1/d2/d3
  mkdir -p $p
  touch $p/file
  chmod-parents 505 $p/file




Information forwarded to bug-coreutils <at> gnu.org:
bug#8736; Package coreutils. (Thu, 23 Feb 2012 19:09:01 GMT) Full text and rfc822 format available.

Message #17 received at 8736 <at> debbugs.gnu.org (full text, mbox):

From: Jérémy Compostella <jeremy.compostella <at> gmail.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>, 8736 <at> debbugs.gnu.org,
	coreutils <at> gnu.org, francky.leyn <at> telenet.be
Subject: Re: bug#8736: chmod -p --parents
Date: Thu, 23 Feb 2012 20:05:09 +0100
[Message part 1 (text/plain, inline)]
OK, I understand. My answers to both questions:

1. why not do it some other way?

First, it is very convenient to do it that way because it is very simple
and it is more consistent with other commands that already provide it:

$ mkdir -p a/b/c d/e
$ chmod g+w -p a/b/c d/e

IMHO, the way like the one you propose misses the consistency point.

Don't misunderstand me, I don't want to force a new feature if someone
has a pertinent argument to oppose to. But this one has already been
proposed by other people and I really think it is worth to have it too.

2. Is this too specialized to merit an option?

I don't think so. This option already exists for other commands like
`mkdir' and `cp' to deserve the same purpose.

Cheers,

Jérémy
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#8736; Package coreutils. (Thu, 23 Feb 2012 19:43:02 GMT) Full text and rfc822 format available.

Message #20 received at 8736 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Jérémy Compostella <jeremy.compostella <at> gmail.com>
Cc: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>, 8736 <at> debbugs.gnu.org,
	coreutils <at> gnu.org, francky.leyn <at> telenet.be
Subject: Re: bug#8736: chmod -p --parents
Date: Thu, 23 Feb 2012 20:40:21 +0100
Jérémy Compostella wrote:
> OK, I understand. My answers to both questions:
>
> 1. why not do it some other way?
>
> First, it is very convenient to do it that way because it is very simple
> and it is more consistent with other commands that already provide it:
>
> $ mkdir -p a/b/c d/e
> $ chmod g+w -p a/b/c d/e
>
> IMHO, the way like the one you propose misses the consistency point.
>
> Don't misunderstand me, I don't want to force a new feature if someone
> has a pertinent argument to oppose to. But this one has already been
> proposed by other people and I really think it is worth to have it too.

When a small bash/perl/python script can provide the same functionality,
that means the proposed feature requires more justification.

By your arguments, chown, chgrp and chcon should also support this new option.
Sorry, but "consistency" and "convenience" are not sufficient, here.
It's just as convenient to use a small script on those rare occasions
that one requires this behavior.

Sorry to reject the idea, but if we were to accept new options too easily
many of the coreutils programs would be larger and harder to maintain,
for relatively little added value.  Part of our job as maintainers is
to ensure that each new feature really is well justified.

> 2. Is this too specialized to merit an option?
>
> I don't think so. This option already exists for other commands like
> `mkdir' and `cp' to deserve the same purpose.




Information forwarded to bug-coreutils <at> gnu.org:
bug#8736; Package coreutils. (Thu, 23 Feb 2012 19:48:01 GMT) Full text and rfc822 format available.

Message #23 received at 8736 <at> debbugs.gnu.org (full text, mbox):

From: francky.leyn <at> telenet.be
To: Jim Meyering <jim <at> meyering.net>
Cc: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>, 8736 <at> debbugs.gnu.org,
	Francky Leyn <francky <at> leyn.eu>,
	Jérémy Compostella <jeremy.compostella <at> gmail.com>,
	coreutils <at> gnu.org
Subject: Re: bug#8736: chmod -p --parents
Date: Thu, 23 Feb 2012 20:44:56 +0100 (CET)
Hello,

I for sure hope the proposal gets through.

Best regards,

Francky

----- Oorspronkelijk e-mail -----
> Jérémy Compostella wrote:
> > OK, I understand. My answers to both questions:
> >
> > 1. why not do it some other way?
> >
> > First, it is very convenient to do it that way because it is very
> > simple
> > and it is more consistent with other commands that already provide
> > it:
> >
> > $ mkdir -p a/b/c d/e
> > $ chmod g+w -p a/b/c d/e
> >
> > IMHO, the way like the one you propose misses the consistency
> > point.
> >
> > Don't misunderstand me, I don't want to force a new feature if
> > someone
> > has a pertinent argument to oppose to. But this one has already
> > been
> > proposed by other people and I really think it is worth to have it
> > too.
> 
> When a small bash/perl/python script can provide the same
> functionality,
> that means the proposed feature requires more justification.
> 
> By your arguments, chown, chgrp and chcon should also support this
> new option.
> Sorry, but "consistency" and "convenience" are not sufficient, here.
> It's just as convenient to use a small script on those rare occasions
> that one requires this behavior.
> 
> Sorry to reject the idea, but if we were to accept new options too
> easily
> many of the coreutils programs would be larger and harder to
> maintain,
> for relatively little added value.  Part of our job as maintainers is
> to ensure that each new feature really is well justified.
> 
> > 2. Is this too specialized to merit an option?
> >
> > I don't think so. This option already exists for other commands
> > like
> > `mkdir' and `cp' to deserve the same purpose.
> 




Information forwarded to bug-coreutils <at> gnu.org:
bug#8736; Package coreutils. (Thu, 23 Feb 2012 20:03:01 GMT) Full text and rfc822 format available.

Message #26 received at 8736 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Jérémy Compostella <jeremy.compostella <at> gmail.com>
Cc: 8736 <at> debbugs.gnu.org, coreutils <at> gnu.org, francky.leyn <at> telenet.be
Subject: Re: bug#8736: chmod -p --parents
Date: Thu, 23 Feb 2012 21:00:02 +0100
Jim Meyering wrote:
...
> Sorry to reject the idea, but if we were to accept new options too easily
> many of the coreutils programs would be larger and harder to maintain,
> for relatively little added value.  Part of our job as maintainers is
> to ensure that each new feature really is well justified.

Also, please ping the list before investing in even a small project
like this.  It's easier to discuss a proposal like this when there
isn't an already-written patch hanging in the balance.




Added tag(s) wontfix. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 11 Oct 2018 22:35:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 8736 <at> debbugs.gnu.org and francky.leyn <at> telenet.be Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 11 Oct 2018 22:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 09 Nov 2018 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.