coreutils
coreutils copied to clipboard
Wrong user+group for `uu-install -o $uid -g $gid -d dir/a/b`
Issue
The uu-install implementation handles the argument combination of -o $uid -g $gid -d a/b/c differently then coreutils. Running install -o $UID -g $GID -d dir/a/b fails to set the permissions on the final directory (b in this case) where coreutils does.
Example test cases
Arch Linux uses this in makechrootpkg which is broken by this. Code for usage is here.
Versions
$ /usr/bin/uu-install --version
/usr/bin/uu-install 0.0.17
$ /usr/bin/install --version | head -n1
install (GNU coreutils) 9.1
Simple test case
$ sudo /usr/bin/install -o 1000 -g 1000 -d core/a/b
$ sudo /usr/bin/uu-install -o 1000 -g 1000 -d uu/a/b
$ exa -lng --tree core uu
drwxr-xr-x - 0 0 13 Feb 18:28 core
drwxr-xr-x - 0 0 13 Feb 18:28 └── a
drwxr-xr-x - 1000 1000 13 Feb 18:28 └── b
drwxr-xr-x - 0 0 13 Feb 18:28 uu
drwxr-xr-x - 0 0 13 Feb 18:28 └── a
drwxr-xr-x - 0 0 13 Feb 18:28 └── b
Note that coreutils implementation sets the requested permissions of core/a/b to the uid+gid passed in but uu-install does not.