Eygene Ryabinkin wrote:
> I had faced a strange problem: usually, when one creates some filesystem
> object inside some directory, GID for the object is inherited from the
> parent directory. It turns to be not the case for the DPM:
> -----
> $ /opt/lcg/bin/dpns-ls -ld /dpm/grid.kiae.ru/home/atlas/atlasmcdisk/ drwxr-x--- 5 root 102 0 Nov 08 09:26 /dpm/grid.kiae.ru/home/atlas/atlasmcdisk/
>
> $ /opt/lcg/bin/dpns-ls -ld /dpm/grid.kiae.ru/home/atlas/atlasmcdisk/mc08
> drwxrwx--- 1 121 123 0 Oct 16 18:09 /dpm/grid.kiae.ru/home/atlas/atlasmcdisk/mc08
> -----
>
> May be I am missing something about POSIX ACLs or their implementation
> in the DPM?
The inheritance of group only happens when the setgid bit of the
directory is set. If it isn't, then newly created files will be
owned by your primary group:
$ id
uid=1500(bellman) gid=1500(bellman) groups=10(wheel),100(users),1500(bellman)
$ mkdir gazonk
$ chgrp users gazonk
$ ls -la gazonk
total 8
drwxrwxr-x 2 bellman users 4096 Nov 11 13:19 ./
drwxr-xr-x 45 bellman bellman 4096 Nov 11 13:19 ../
$ touch gazonk/foo
$ ls -l gazonk/foo
-rw-rw-r-- 1 bellman bellman 0 Nov 11 13:21 gazonk/foo
$ chmod g+s gazonk
$ touch gazonk/bar
$ ls -la gazonk
total 8
drwxrwxr-x 2 bellman users 4096 Nov 11 13:22 ./
drwxr-sr-x 45 bellman bellman 4096 Nov 11 13:19 ../
-rw-rw-r-- 1 bellman users 0 Nov 11 13:22 bar
-rw-rw-r-- 1 bellman bellman 0 Nov 11 13:21 foo
As you see, the file "foo" got owned by my primary group, but
the file "bar" got owned by the same group as the directory,
since that was created after I set the setgid bit.
/Thomas Bellman
|