Skip to content
Snippets Groups Projects
Commit 8997057d authored by Tobias S. Josefowitz's avatar Tobias S. Josefowitz
Browse files

Filesystem.Tar: Reorder operations in extract_bits()

As is mentioned in [LysLysKOM 23152065], Linux of recent versions clears
the S_ISUID and S_ISGID bits when chowning to another user. While POSIX
mandates this only for unprivileged users performing the chown, Linux
starting with 2.2.13 does not treat root as a special case anymore.

The operations were previously reordered to make utime() on __NT__ more
robust, which caused chown() to be executed after chmod(). In the
current order, we do utime() first, then chown(), then chmod().

While it seems a bit weird to chown() files that do not belong to us,
especially in the non-root-case, this has been the historical order of
operations in Filesystem.Tar.

Thanks to Per Cederqvist <ceder@lysator.liu.se> for the report.
parent 49179b53
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment