On Fri, 7 Jul 2017, Bill Gee wrote:> File permissions are 574. Note that owners are NOT required to have higher > permissions than groups!But the owner can change the permissions, no? 574 is a properly perculiar permission to set. jh
On Fri, 2017-07-07 at 12:31 +0100, John Hodrien wrote:> On Fri, 7 Jul 2017, Bill Gee wrote: > > > File permissions are 574. Note that owners are NOT required to have higher > > permissions than groups! > > But the owner can change the permissions, no?Not necessarily. In order to change permissions on a file you need to have write access to the directory (i.e. the special file in the parent directory that describes the files present in the directory). The owner of a file does not necessarily have those permissions in a normal directory. P.
On Fri, 7 Jul 2017, Pete Biggs wrote:> Not necessarily. In order to change permissions on a file you need to > have write access to the directory (i.e. the special file in the parent > directory that describes the files present in the directory).To delete, yes, but to chmod? It makes no sense for that to be the case, as hardlinks would end up being a touch baffling. [ as root ] # mkdir foo # touch foo/bar # chown user foo/bar # chmod 574 foo/bar [ as user ] $ cd foo $ ls -ld . drwxr-xr-x. 2 root root 16 Jul 7 12:51 . $ ls -l bar -r-xrwxr--. 1 user root 0 Jul 7 12:51 bar $ echo rabbits > bar bash: bar: Permission denied $ chmod 644 bar $ echo rabbits > bar $ cat bar rabbits $ ls -l bar -rw-r--r--. 1 user root 8 Jul 7 12:54 bar jh