1

I am using Linux Mint and my workmates are using Windows. We've got a local, shared server (also Linux) for documentation files and a weird thing happened yesterday: a windows user created a file (.odm) and after I changed it, the ownership of the file changed to me and all the other users, including the one who created it, had permission only to read it, although, initially (before I edited it) everyone could read, write and execute.

I don't know what information I need to give to make context clearer, but I'd like to understand how that happened. I mean, it seems very weird for a different user to be able to change permissions and ownership of a shared server's file.

The server is running samba, and all the clients are using that to access the files.

4
  • You need to set up the share with specific options so that it is owned by the group, file creation mode is 0664 or 0660 (i.e. RW by both owner & group), directory mode is 2775 or 2770 (i.e. use the setgid bit), and with the ownership and group of created files to be a specific owner (usually the person "in charge of" the group) and group. See, for example my answer to a similar question on Server Fault: serverfault.com/a/49088 Commented Aug 5 at 12:24
  • And on the client side (i.e. your workstation), you probably need to mount the share with the appropriate uid and gid - see my other answer in the same question for details on that. Commented Aug 5 at 12:26
  • 2
    RE: "it seems very weird for a different user to be able to change permissions and ownership of a shared server's file." - that depends on how the file server is set up (see my comments above) AND on how the program you're using to edit the file actually saves changes. If it opens the existing file and over-writes it, owner & perms won't change....but if it deletes the original first, then a new file with the same name is created, with owner & perms dictated by the user and their umask (unless the samba config forces a specific owner/group/perms as described in my SFault answer). Commented Aug 5 at 12:34
  • this is exactly the same as what happens whenever you create a new file in a directory you have write permission in. And, unless you're running as root (not generally a good idea except for maintenance tasks), you don't have the rights to change a file's owner so any new file you create will always be owned by you. Commented Aug 5 at 12:36

1 Answer 1

3

Samba emulates the permissions model used by Windows. In that world a user or group with Full Control on a file can do whatever they want to that file.

Note that this is different to the UNIX model implemented on Linux systems.

Now, for these *.odm files it may simply be that the application deletes (or renames) the original before writing your saved version. The resulting new file will be owned by you.

Either way, the behaviour you see should be expected

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.