[Gllug] File permissions and umask on Ubuntu (and I think probably, Debian)

Anthony Newman anthony.newman at ossified.net
Sun Jan 7 21:07:57 UTC 2007


John Winters wrote:
<snip>
> 
> The directory permissions control whether or not a user can write to the 
> *directory*, not to the files therein.  The user kate can thus happily 
> delete the file "foo", but she can't write to it.  Directory permissions 
> most definitely *do not* override individual file permissions.

Bum, and I thought I'd got it all worked out :(

It appears you can do anything except modify existing files, including 
moving files that don't belong to you, providing you're in the same 
group as the directory. As as side-effect, this gives you modify 
permissions if you don't mind jumping through hoops (copy, modify, 
delete original, rename), but it's obviously not useful as such on a 
regular basis.


(Both aen and postgres are in the shared group)

aen at bones:~ $ cd /home/shared
aen at bones:shared $ ls -ld
drwxrws--- 2 root shared 35 2007-01-07 20:58 .

aen at bones:shared $ echo "My file" > aentest
aen at bones:shared $ ls -l
total 8
-rw-r--r-- 1 aen      shared 8 2007-01-07 21:00 aentest

bones shared # su - postgres

postgres at bones / $ cd /home/shared/
postgres at bones /home/shared $ ls -l
total 4
-rw-r--r-- 1 aen shared 8 2007-01-07 21:00 aentest

postgres at bones /home/shared $ mv aentest postgrestest

postgres at bones /home/shared $ ls -l
total 4
-rw-r--r-- 1 aen shared 8 2007-01-07 21:00 postgrestest

postgres at bones /home/shared $ echo "0wn3d" >> postgrestest
-su: postgrestest: Permission denied

postgres at bones /home/shared $ rm postgrestest
rm: remove write-protected regular file `postgrestest'? y

postgres at bones /home/shared $ ls -l
total 0

-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list