On Sun, Aug 21, 2022 at 11:50 AM Tres Finocchiaro <
tres.finocchi...@gmail.com> wrote:

> Unix results have near identical regressions using the stackoverflow
> <https://stackoverflow.com/questions/73428286> snippet, but for
> "/opt/MyApp" (Linux) and "/Applications/MyApp.app" (Mac)
>
> *Ubuntu 22.04:*
>
> 2.8 and lower:
>
>    - Files copied from $HOME/Desktop to /opt/MyApp *inherit target
>    permissions*.  For example, if you're using copyDirectory() to deploy
>    files /opt/, they will generally be owned by the root user.
>
> 2.9 and higher:
>
>    - Files copied from $HOME/Desktop to /opt/MyApp *keep source
> permissions*.
>    For example, if you're using copyDirectory() to deploy files /opt/, they
>    will generally be maintained (in the case of the snippet, owned by the
>    *$USER:$USER*).
>
> *MacOS 13.0:*
> 2.8 and lower:
>
>    - Files copied from $HOME/Desktop to /opt/MyApp *inherit target
>    permissions*.  For example, if you're using copyDirectory() to deploy
>    files /Applications/, they will generally be owned by *"root:admin"*.
>
> 2.9 and higher:
>
>    - Files copied from $HOME/Desktop to /Applications/MyApp.app *keep
>    source permissions* For example, if you're using copyDirectory() to
>    deploy files /Applications/, they will generally be maintained (in the
> case
>    of the snippet, owned by the "*root:staff*").
>
> Note:
>
> The permissions between Mac and Linux have slightly different behaviors due
> to how Java is handling the creation of the "test.txt" file when using
> "sudo".  Linux creates them with user permissions, Mac does not.
> Regardless, in both cases, the regression seems to behave the same.
> Permission inheritance is lost in both instances.
>

Hi Tres,

Thank you for the analysis :-)


> Should I begin writing a patch to restore the old behavior?
>

That's entirely up to you.

My concern is avoiding a ping-pong of (future) requests for restoring
behavior between released versions. An unexpected change of behavior is not
nice but now that's been released we can't tell if the new behavior is
being relied upon or not.

Another concern is that for changes we should have tests that will avoid
future regressions and also clearly document why the test exists so that
the tests are not also changed inadvertently,

This is why I suggested a new API but that might not be acceptable either.
One way I like to look at this is what I'd expect as a new user of Commons
IO. Maybe we need to extend CopyOption or better Javadoc what we do with
StandardCopyOption?

We should be able to explain clearly in the Javadoc of FileUtils.copyXYZ
and PathUtils.copyXYZ what they do and how they differ and why.

Thank you for digging in!

Gary

Reply via email to