Re: [1003.1(2016)/Issue7+TC2 0001392]: find(1): clarify whether -perm ops - and + should follow chmod

2020-08-28 Thread Joerg Schilling via austin-group-l at The Open Group
Geoff Clare via austin-group-l at The Open Group  
wrote:

> I think I would prefer just to require consistency with chmod in Issue 8.
> The difference from chmod violates the principle of least surprise.
>
> Another reason to disallow ignoring the umask for '=' without a "who"
> is that this makes it identical to 'a=', thus reducing the available
> functionality for no reason.
>
> I propose:



Looks good.



Re: [1003.1(2016)/Issue7+TC2 0001392]: find(1): clarify whether -perm ops - and + should follow chmod

2020-08-28 Thread Geoff Clare via austin-group-l at The Open Group
Geoff Clare wrote, on 19 Aug 2020:
>
> > -- 
> >  (0004926) geoffclare (manager) - 2020-08-19 09:22
> >  https://austingroupbugs.net/view.php?id=1392#c4926 
> > -- 
> 
> > I think we should issue a "standard is silent" interpretation, thus
> > allowing both behaviours for Issue 7, but we should make a change in Issue
> > 8 to require the BSD behaviour. 
> 
> I started looking into a wording change for this, but I'm not too
> keen on where it would end up. It would have a particular difference
> from chmod that would "stick out like a sore thumb", which is that
> when '=' is used without a "who", find ignores the umask but chmod
> uses it.
> 
> Is that what BSD find does?  Or is it consistent with chmod here
> (contrary to what the standard requires)?

This got answered via a bug note (4941): macOS (which uses BSD find)
is consistent with chmod.

> Perhaps we should allow the difference but recommend against it.

I think I would prefer just to require consistency with chmod in Issue 8.
The difference from chmod violates the principle of least surprise.

Another reason to disallow ignoring the umask for '=' without a "who"
is that this makes it identical to 'a=', thus reducing the available
functionality for no reason.

I propose:

The mode argument is used to represent file mode bits. It shall
be processed in an identical matter to the symbolic_mode operand
described in chmod, except that:

1. The changes to file mode bits shall be applied to a template instead
   of to any files.  The template shall initially have all file mode
   bits cleared.

2. The op symbol '-' cannot be the first character of mode;
   this avoids ambiguity with the optional leading . Since
   the initial mode is all bits off, there are not any symbolic modes
   that need to use '-' as the first character.

If the  is omitted, ...

with a new paragraph in RATIONALE:

Earlier versions of this standard were silent regarding whether the
-perm primary takes into account the file mode creation mask
when the op symbols '+' and '-' are used without who
being specified, and required the mask to be disregarded when the
op symbol '=' is used without who.  The latter resulted
in a surprising inconsistency with chmod, and also meant that
'=' without who just worked the same as '=' with a who
of 'a', disallowing useful functionality.  Some implementations used
the mask anyway, despite the requirement not to. The standard now
requires that the way find handles these op symbols is
consistent with chmod.  Applications that need the old behavior
can simply use '=' with a who of 'a' instead of without
who.

-- 
Geoff Clare 
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England



Re: [1003.1(2016)/Issue7+TC2 0001392]: find(1): clarify whether -perm ops - and + should follow chmod

2020-08-19 Thread Geoff Clare via austin-group-l at The Open Group
> -- 
>  (0004926) geoffclare (manager) - 2020-08-19 09:22
>  https://austingroupbugs.net/view.php?id=1392#c4926 
> -- 

> I think we should issue a "standard is silent" interpretation, thus
> allowing both behaviours for Issue 7, but we should make a change in Issue
> 8 to require the BSD behaviour. 

I started looking into a wording change for this, but I'm not too
keen on where it would end up. It would have a particular difference
from chmod that would "stick out like a sore thumb", which is that
when '=' is used without a "who", find ignores the umask but chmod
uses it.

Is that what BSD find does?  Or is it consistent with chmod here
(contrary to what the standard requires)?

Perhaps we should allow the difference but recommend against it.
Something like this:

The mode argument is used to represent file mode bits. It shall
be processed in an identical matter to the symbolic_mode operand
described in chmod, except that:

1. The changes to file mode bits shall be applied to a template instead
   of to any files.  The template shall initially have all file mode
   bits cleared.

2. The op symbol '-' cannot be the first character of mode;
   this avoids ambiguity with the optional leading . Since
   the initial mode is all bits off, there are not any symbolic modes
   that need to use '-' as the first character.

3. The find utility may, but should not, disregard the contents of
   the file mode creation mask of the process when the op symbol
   '=' is used without who being specified.

If the  is omitted, ...

with a note in FUTURE DIRECTIONS:

A future version of this standard may require that the -perm
primary uses the file mode creation mask in an identical manner to
the way chmod uses it in the symbolic_mode operand.

-- 
Geoff Clare 
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England