I am trying to understand file/dir permissions in linuxLinux. A user can list the files in a directory using
cd test ls -l Even if the user issuing above commandcommands does not have read,write write or execute permission on any of the files inside the test directory, still he can list them because he/she has read permissions on the test directory.
Then why in the following scenario user B can change permissions of a file he owns but does not have write permissions of the parent directory ?
User A , makemakes a test directory and gives other users ability to write in it:
mkdir test chmod o+w test User B , creates a file in test folder.
cd test touch b.txt User A ,removesremoves write permission of others from the directory
chmod o-w test User B , can successfully change permissions, even though permissions are part of directory and this user does not have write permission on the parent directory of the file he owns
chmod g-r b.txt why does chmod does chmod not fail aftersince the user can notcannot modify the directory which has the file information - permissions etc ??