Hello Lukas,

sorry for the delay.

On 12/5/25 16:24, Lukáš Zaoral wrote:
> [PATCH] find: make -mount POSIX 2024 compliant

This is a nice and small patch. :-)

Minor nit wrt/ commit message:

> * find/defs.h (struct options): Add mount member and rename stay_on_filesystem
> to xdev.

The line length should not exceed, so I'll wrap the text a bit earlier.

> diff --git a/NEWS b/NEWS

> +  The -mount option is now POSIX compliant. [...]

This is not quite true: GNU find(1) was already POSIX compliant, but only Issue 
8 aka
POSIX 2024 added the -mount option and since then mandates -mount to exist and 
to deviate
from the previous behavior in various UNIX implementations (as alias of -xdev).

I'll insert the POSIX version "2024" (as in $subject), and further clarify the
new -mount behaviour compared to -xdev.
I'd also place it as first entry in "Changes to find" section, because this 
change
is more important than the others.
The NEWS change looks as following then:

  diff --git a/NEWS b/NEWS
  index 06fe48e7..675bd2a4 100644
  --- a/NEWS
  +++ b/NEWS
  @@ -20,6 +20,17 @@ GNU findutils NEWS - User visible changes.      -*- 
outline -*- (allout)

   ** Changes in find

  +  As announced since the release of 4.7.0 (2019) and mandated by POSIX 2024,
  +  the behaviour of the -mount option changed: while it was a mere alias for
  +  the -xdev option to prevent descending into directories of another device,
  +  the -mount option now makes find(1) ignore files on another device, i.e.,
  +  'find -mount' will skip the entry of active mount points already.
  +  Example, assuming the PROC filesystem is mounted on '/proc':
  +    $ find / -mount -path /proc -print
  +    $ find / -xdev -path /proc -print
  +    /proc
  +  [#54745]
  +
     The actions -execdir and -okdir now refuse the '{}' replacement in the 
zeroth
     argument of the command to be run.  While POSIX allows this for -exec, 
this is
     deemed insecure as an attacker could influence which files could be found.

The other parts of the patch are perfect, thanks.
I'll push it with the above minor tweaks in the commit msg + NEWS.
Okay to you?

As the change is quite delicate, I'd like to add some follow-up commits to 
clarify
the new -mount behavior vs. -xdev in the documentation as well.
Also tests are needed.

Thanks & have a nice day,
Berny

Reply via email to