linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <bsingharora@gmail.com>
To: Russell Currey <ruscur@russell.cc>
Cc: Balbir Singh <bsingharora@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: Use octal numbers for file permissions
Date: Tue, 17 Jan 2017 12:58:55 +0530	[thread overview]
Message-ID: <20170117072855.GF8963@dhcp-9-109-223-248.in.ibm.com> (raw)
In-Reply-To: <1484526112.2660.1.camel@russell.cc>

On Mon, Jan 16, 2017 at 11:21:52AM +1100, Russell Currey wrote:
> On Fri, 2017-01-13 at 13:41 +0530, Balbir Singh wrote:
> > On Thu, Jan 12, 2017 at 02:54:13PM +1100, Russell Currey wrote:
> > > Symbolic macros are unintuitive and hard to read, whereas octal constants
> > > are much easier to interpret.  Replace macros for the basic permission
> > > flags (user/group/other read/write/execute) with numeric constants
> > > instead, across the whole powerpc tree.
> > > 
> > 
> > I know Linus said otherwise, but I wonder if the churn is worth it.
> > At user mode (do man 2 chmod), these constants are used frequently,
> > even with chmod the command we use chmod a+r equivalents or chmod
> > u+r. My big concern with numbers is how do you know you did not
> > turn on the sticky bit for a file? Can you imagine if someone used
> > 0x644 or 0x444 would we catch it?
> 
> I would certainly expect something like that would be caught.
>

OK.. Lets hope so.
 
> > 
> > Not resisting, but thinking if the churn and what follows might be
> > OK.
> 
> So long as the constants are still in the tree people will still send patches
> with them (which continues to happen even though there's a checkpatch warning). 
> Constants have the issue that the same value can be written multiple ways (which
> is misleading) - some of the files I touched come about the same set of
> permissions different ways or even mix octal values and macros within the same
> file.

I don't think anyone prevents 0444 | 0200 from being sent. It's just that
associativity rules allow for composing things differently.

> 
> I think using octal values for rwx (and sticking to macros for things like the
> sticky bit) is on the side of simplicity and consistency.
>

Fair enough, maintainer gets to decide :)

Balbir Singh. 

  reply	other threads:[~2017-01-17  7:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12  3:54 [PATCH] powerpc: Use octal numbers for file permissions Russell Currey
2017-01-13  7:51 ` Cyril Bur
2017-01-17  9:52   ` Michael Ellerman
2017-01-17 10:50     ` Oliver O'Halloran
2017-01-17 10:54       ` Oliver O'Halloran
2017-01-18  0:05     ` Cyril Bur
2017-01-13  8:11 ` Balbir Singh
2017-01-16  0:21   ` Russell Currey
2017-01-17  7:28     ` Balbir Singh [this message]
2018-01-22  3:34 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170117072855.GF8963@dhcp-9-109-223-248.in.ibm.com \
    --to=bsingharora@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ruscur@russell.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).