creating new file and directory permissions samba share

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

creating new file and directory permissions samba share

Postby pkelly » Mon Mar 30, 2015 5:20 am

Hi,

I'm having some permissions issues for a samba share. If I create the file from the client side of the share, it's not problem because the user is the owner. I run into issues when the root user creates a file or directory. It leaves out the write permission bit for the group when creating files and directories. So the client side of the samba share can read the files but can't write to them.

Is there a way to specify recursive permissions that inherit the parent directory permissions?

I've used g+s and that didn't get me far. I end up with locked files and non-writable.

My samba config looks like this:
$this->bbcode_second_pass_code('', '[media]
comment = Automounted Drives Share
writable = yes
valid users = @wheel
path = /media
create mode = 0770
directory mode = 2770')

My /media permissions look like this:
$this->bbcode_second_pass_code('', 'drwxrws--- 4 root wheel 4096 Mar 30 01:10 media')

All users accessing the /media share are in the wheel user group.

I'm automounting usb drives to the /media directory using udev and udisks2. So drives are mounted per drive label. It's kind of useless to share them if no one can write to them though. All I need is to have read/write/execute permissions on any drive I plug in that will be automounted under /media. Sorry for the rambling....it's late. Please help.

Thanks in advance.
pkelly
 
Posts: 17
Joined: Fri Jan 30, 2015 7:24 pm

Re: creating new file and directory permissions samba share

Postby opotonil » Mon Mar 30, 2015 11:39 am

To Inherit owner:
$this->bbcode_second_pass_code('', '
inherit owner = yes
')

To force group:
$this->bbcode_second_pass_code('', '
force group = +users
')
opotonil
 
Posts: 44
Joined: Sat Feb 08, 2014 1:17 pm

Re: creating new file and directory permissions samba share

Postby pkelly » Mon Mar 30, 2015 5:45 pm

Thanks, will this be applied to just the media directory or all subdirectories/files of those directories as well?
pkelly
 
Posts: 17
Joined: Fri Jan 30, 2015 7:24 pm

Re: creating new file and directory permissions samba share

Postby pkelly » Mon Mar 30, 2015 7:25 pm

hmmmm.... i added those to my smb.conf, but that didn't change the permissions for newly created directories and files. I get this: instead:
$this->bbcode_second_pass_code('', 'drwxr-xr-x 4 root wheel 4096 Mar 30 00:37 sda1-usb-SanDisk_Cruzer_4')

when it needs to be:
$this->bbcode_second_pass_code('', 'drwxrws--- 4 root wheel 4096 Mar 30 15:06 media')

Again here is my current smb.conf that creates the permissions above:
$this->bbcode_second_pass_code('', '[media]
comment = Automounted Drives Share
writable = yes
force group = @wheel
inherit owner = yes
valid users = @wheel
path = /media
create mode = 2770
directory mode = 2770')

Not sure what I need to do. This is an automounted USB drive handled by Udev and udisks2. Do I need to write a udev rule that mounts it with the desired permissions?
pkelly
 
Posts: 17
Joined: Fri Jan 30, 2015 7:24 pm

Re: creating new file and directory permissions samba share

Postby pkelly » Wed Apr 01, 2015 5:29 am

bump....
pkelly
 
Posts: 17
Joined: Fri Jan 30, 2015 7:24 pm

Re: creating new file and directory permissions samba share

Postby pkelly » Wed Apr 01, 2015 5:41 am

Ok, I've scoured the interweb....ALL I need to accomplish is making every created file/directoy by any user have rwxrwx--- perms. Every file/directory I create has zero write for group. User is always root because I can't write files to the directory as a user. So I have to sudo nano test.txt in order to write to the file and save it. Thus I can't create any files I can change over my samba share. This is getting seriously exhausting. I've tried a million and one smb.conf settings...I'm at my wits end. Please would someone simply write out a smb.conf starting with the global parameters and ending with a single share to /media to allow group "wheel" to write to any file and directory created by anyone. Thanks.
pkelly
 
Posts: 17
Joined: Fri Jan 30, 2015 7:24 pm


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 16 guests