3

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.

3
  • 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. Dec 21, 2010 at 9:09
  • and how can i test it and what can i do?
    – Shara
    Dec 21, 2010 at 9:54
  • Why would you create files using Nautilus?
    – poolie
    Apr 21, 2011 at 0:06

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .