The ability to chmod a file is governed by the current users ability to WRITE the file.
The ability to WRITE a file is determined by:
1. ownership
2. file permissions
If the current user OWNS the file, then the file permissions can be modified, and so the permissions are irrelevant.
If the current user does NOT own the file then the ability to WRITE a file are governed solely by the permissions on the file, and the current users role. If the current user is a member of the same unix group as the group owner of the file, then the current users role is GROUP. Otherwise it is WORLD.
File permissions are set in three groups of Read/Write/Execute permissions:
OWNER GROUP WORLD
rwx rwx rwx
These can be examined with the 'ls -l' command:
%ls -l
-rw-rw-rw- 1 user1 group1 0 Mar 4 11:03 file1
-rw-rw-r-- 1 user1 group1 0 Mar 4 11:03 file2
-rw-r--r-- 1 user1 group1 0 Mar 4 11:03 file3
In the example above, the user 'user1' can WRITE and therefore chmod any of the files. Any member of 'group1' can WRITE and therefore chmod file1 and file2. Any user can WRITE and therefore chmod only file1.
roylec,
this is NOT true. If it is, please tell me what system you use.
I just tested it on AIX and as far as I remember, it's the same on Solaris. ONLY the owner of the file (and root) can change the permissions.
Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.