In myscript
I have a line that does this :
chmod 660 somefile_given_as_argument_to_myscript
I gave the members of a group the right to exectute the script. (chmod 770
myscript
) but when they execute the script on a file that belongs to me, it
fails because they don't have the permission to change that file.
Can I add something to my script to give any member of the group the right to modify the permissions of any file that belongs to any member of the group?
EDIT
As requested by some, I will precise why I want to do that. My ultimate goal is to allow any member of a group to read write any file in a given directory. I already posted another question but for now no good answer was given. I then thought that it would be possible for any user the change permission so that any member of the group could read write any file. But this does't work because one user cannot change permission of a file that belongs to someone else... The problem I have in my other post is that files that are created outside the shared directory and then moved/copied inside, don't have the right permission (I already changed the ACL of the shared directory).
chmod g+s
on my executable that wrapchmod
– PinkFloyd Mar 06 '15 at 14:27chmod
into your home directory, set the setuid bit on that, and let your other team access it so that they can change permissions with it. e.g.cp /bin/chmod /pub/floyds_files/floydmod; chown floyd:wallteam chmod a+s,g+x,o-x floydmod
Now your wallteam can runfloydmod
, which is the same as runningchmod
as you – Brandin Mar 06 '15 at 17:28cp /bin/chmod /pub/floyds_files/floydmod; chown floyd:wallteam /pub/floyds_files/floymod; chmod a+s,g+x,o-x /pub/floyds_files/floydmod
– Brandin Mar 06 '15 at 17:35