Making files always inherit permissions from dataset?

Status
Not open for further replies.

Samwarez

Dabbler
Joined
Oct 16, 2015
Messages
10
I have several datasets/directories each each with is own permissions set on them. I know I can have any new files inherit the permissions for the parent dataset, but when I copy files from one dataset to another, they retain their original permissions.

Is there a way to set it up so that files will always have same permissions as their current parent directory? Or am I going about this the wrong way?
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
am I going about this the wrong way?
The permissions a copied file ends up with depend on the method used to copy the file, including which user did the copying. If you want destination permissions, do the copy as the destination owner and don't use a permissions-preserving method, e.g. use cp without the -p option.
 

Samwarez

Dabbler
Joined
Oct 16, 2015
Messages
10
that makes sense, the problem is that all the file management is done on windows clients, so I'm not sure how that will translate to FreeNAS. Would it be better to write a script to recursively set the permissions on each directory? and can I have that run each time a file is modified in one of those directories?

Maybe I should explain my setup so that you can tell me the best way to go about this:

The FreeNAS system is primarily a media server that a couple XBMC systems get there media from, as well as some user directories for personal backups and file storage. I have a generic 'Media' user and group for anything that just accesses the media, but not anything else, the couple of users I have are part of the media group so that movies and the like can be accesses on their computers and I can administer the media files (sorting, editing, etc.) while accessing their respective user directories. So the media user needs to be able to access anything in the media directories, but any copying/modifications will be done by another user. I guess I just need to ensure the media files always have group ownership by the media group?
I would prefer not to have separate logins for each directory, but I guess I can set that up.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
you can tell me the best way to go about this
Probably not - I'm far from an expert on Windows permissions. The general rule for FreeNAS is, if the clients are running Windows, everything but the top level ownership and permissions should be managed through Windows security settings. Therefore, that's what I would be Googling to try to figure out a solution to your problem.
 

Samwarez

Dabbler
Joined
Oct 16, 2015
Messages
10
Well when I setup the network share in windows it has me enter a username and password, I just put in the user credentials as setup in FreeNAS and it lets me in. I will do some testing to see how FreeNAS is handling the credential translation.
 

Samwarez

Dabbler
Joined
Oct 16, 2015
Messages
10
well Ill be damned, FreeNAS seems to be reading my mind, when I create a file in a directory (via windows) its created with the user as the owner but the group is set to whatever the directories group is. when I copy that over to another directory (again through windows) the owner stays the same but group changes to match the new directory. However everything is created with permissions set to 777. I guess that is the default permissions of CIFS, any chance I could change that to a more sane 775?

Edit: Strange, According to the FreeNAS documentation the "Apply Default Permissions" checkbox on the share is supposed to set the permissions to "read/write for owner/group and read-only for other" aka 775. Why is mine different?
 
Last edited:
Status
Not open for further replies.
Top