Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to share a folder for two users, here is what I did:

  • created group
  • add users to group
  • set chmod
  • set chown
  • set setgid 2775
  • reboot

After that:

  1. echo test > /Common/testfile -> group readable&writable

  2. Created file using Nautilus -> group readable, but not writable

  3. Copied file using Nautilus -> group readable, but not writable

  4. Created file using gedit -> group readable&writable

Why? Is it a bug? This was on a clean Ubuntu 10.10 installation.

share|improve this question
    
If the files created belong to the group common, the setgid is being respected. It seems to me you have a problem with nautilus not respecting the umask. I found an old bug (bugzilla.gnome.org/show_bug.cgi?id=317664) that describes exactly this, but is apparently fixed. –  Carsten Thiel Dec 21 '10 at 9:09
    
and how can i test it and what can i do? –  Shara Dec 21 '10 at 9:54
    
Why would you create files using Nautilus? –  poolie Apr 21 '11 at 0:06

1 Answer 1

If you want to get specific permissions for every file in folder, using ACLs is probably most robust way to do it:

chgrp YOUR_GROUP_NAME /Common
chmod g+s /Common
setfacl -d -R -m group:YOUR_GROUP_NAME:rwx /Common
setfacl -R -m group:YOUR_GROUP_NAME:rwx /Common

With ACLs filesystem permissions do not matter. Your program can set filesystem permissions (for example read only or no permissions for group).

SGID bit for folder only forces setting group name, but not permissions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.