Linux Permissions – Shared Read-Write Photo Directory for Normal Users

gnome3linuxmultiuserpermissions

I.e. what I want is the Linux equivalent of Windows Public/Pictures.

The problem is that Linux file manager Nautilus doesn't apply default ACLs when you move a file into a folder/directory (nor good old set-group-id). Not even in the expected case, where the file is only in one directory at a time, i.e. it hasn't also been hard-linked into another directory.

So dragging photos from a plugged in camera can't work, even with a default ACL. Other users will be able to read the photos, but they won't be able to write to them. They're shown with a padlock in the file manager.

Amusingly it isn't using rename() in this case, because the move crosses filesystems. Nautilus is just providing consistent semantics in this case by re-applying permissions form the source file :trollface:.

Unfortunately I remembered this too late, after getting fed up instructing fellow users on how to use Digikam. (Digikam worked, because deleting photos from the card is a separate operation. So the photos are necessarily copied, instead of moved). I instructed them to write notes on using the file manager instead. Sigh.

So I know this isn't the expected usage, i.e. multi-user computers have not really been catered for. But is there any sensible way I could set this up for my fellow users?

I'm discounting any method that's harder for people to remember (over about a month) than the file manager one. That excludes Digikam; it has too many pointless choices, and then demands confirmation before removing images from the card, as if this whole operation was fraught with danger. (Also unfortunately, with our software we get an "import photos using Digikam" popup that doesn't work).

I'm also excluding any photo manager that can't save album's names (including a date) to the filesystem. If you can't export to Digikam, then you're not trustworthy enough to make me import from Digikam!

Environment:

  • Linux
  • Debian
  • Standard GNOME desktop

Best Answer

I forgot something else. If I can't write to a file, I can still remove it and replace it. And that's exactly the correct way to save a file. (Because you have to fsync() before you have a durable file, which you can safely replace the old one with).

It seems to work fine, you just have to ignore the padlocks :). E.g. I can rotate photos copied in by other users.

DISCLAIMER: Digikam appears to update photo metadata incorrectly. So that will silently fail (:trollface2:), leaving the (metadata) database inconsistent. Fortunately I don't care about doing tagging at the moment, but that's another one of those little traps for me to stumble into later.

Related Question