Ubuntu - changing another users file permissions

1

I have setup Ubuntu as a development web server - however I am experiencing problems with file permissions. I have 2 users, user1 and user2, and they both have been put into the group www-data.

I have uploaded a new file with user1 so the file is owned by user1 and the www-data group.

At present if user2 wants to modify the permissions on that file to say 777 - they cannot.

Is there a way to allow any users within a group to be able to modifiy permissions etc.. on this file? I have tried changing umask to 002 and a few other combinations that were suggested without luck.

Cameron

Posted 2009-11-18T02:04:54.080

Reputation:

Answers

1

From chmod(2) --

   The effective UID of the calling process must match the  owner  of  the
   file,  or  the  process  must  be  privileged  (Linux: it must have the
   CAP_FOWNER capability).

However, user2 (with write permissions on the directory) could create a copy of the file, set its permissions, then replace the original file with the copy.

NVRAM

Posted 2009-11-18T02:04:54.080

Reputation: 778

By Cameron: In response to your answer: They can modify the file but they cannot modify the permissions. Say for example I upload a directory and it is set to 755 and it owned by user1. user2 is not able to change that directories permissions to 777 - only user1 is able to. I would want any user who is in the same user group to be able to modify a files permissions. – Ivo Flipse – 2010-03-16T08:19:26.013

Wouldn't ACLs also work for this? – Marcin Gil – 2009-11-18T07:15:37.940

@Marcin - I don't think so. Can you figure it out? See http://linux.about.com/library/cmd/blcmdl1_setfacl.htm#lbAG

– NVRAM – 2009-11-19T19:43:26.470