bug with install and group names

I'm not sure if this is the intended functionality of install(1), but when creating a directory where the previous upper directories don't exist, the group name is set to the unprivileged users.

For example, if I create the directory test/test/test/ with install(1), and none of them exist, the directory will then be owned by root and group amzo, even if I use:

install -o root -g wheel -dm755 test/test/test/

How ever, if I just create test/ with the same command it is owned by root and wheel.

Here is the output.

Code:
[amzo@archbsd ~]$ sudo install -o root -g wheel -dm755 test/test
[amzo@archbsd ~]$ ls -l test
drwxr-xr-x  2 root  wheel  512 Jan  6 03:28 test
[amzo@archbsd ~]$ sudo rm -r test
[amzo@archbsd ~]$ sudo install -o root -g wheel -dm755 test/test/test/test
[amzo@archbsd ~]$ ls -l test
drwxr-xr-x  3 root  amzo  512 Jan  6 03:28 test

I'm not sure if this is the intended behavior or if it should be fixed.

Anyway, here is a patch:

http://sprunge.us/fIQc

And an image comparing results, xinstall is patched, install isn't

http://i.imgur.com/L3kGVc8.png
 
I have concluded this is supposed to happen. Otherwise if you use a complete path: e.g /home/amzo/test/test/test, then /home/amzo would also be set to root:wheel.

So I'm guessing that's why it the way it is by default. Though, all newly created directories should be set to the permissions passed to install().
 
Back
Top