Overclockers Australia Forums
OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Other Operating Systems

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 15th September 2008, 11:30 AM   #1
phreeky82 Thread Starter
Member
 
Join Date: Dec 2002
Location: Townsville
Posts: 9,131
Default smbfs mount permissions

I'm doing my head in trying to figure this out, things are not doing what I expect.

Got a win2003 server as a file server, and a ubuntu 8.04 desktop. I'm mounting a share from the 03 server to the desktop (as you do).

I can successfully set rwx of user/group/others using file_mode & dir_mode (new terms for fmask + dmask, dunno why they've changed it) in fstab. uid + gid options seem to work fine too. However, new files always seem to be set "-rw-r--r--" (dunno exactly what octal value that comes to off the top of me head). After creating the file I can't edit it. Unmounting and remounting shows the file with the same permissions as all the others "-rwx-rwx----" as I wish it to be straight up.

My reading seems to indicate that umask sets the permissions of new files, but it appears to be having no effect. Whatever I set it do does nothing.

Anyway I feel like I'm rambling. Here is the line from fstab:

Code:
//myserver/myshare	/mnt/mountlocation	smbfs	rw,auto,username=myuser,password=mypass,uid=0,gid=1000,dir_mode=0770,file_mode=0660,umask=0777	0	0
gid 1000 is my users group
__________________
Successful trades: eyusuf, andy8, stuartl, michaeliam, theDarkHorse, bob
phreeky82 is offline   Reply With Quote

Join OCAU to remove this ad!
Old 15th September 2008, 2:57 PM   #2
elvis
Member
 
elvis's Avatar
 
Join Date: Jun 2001
Location: Brisbane
Posts: 20,271
Default

Quote:
Originally Posted by phreeky82 View Post
However, new files always seem to be set "-rw-r--r--"
Your umask controls that. Type "umask" to see what it's currently set to. It's represented by the inverse of the permissions you want to set.

So a umask of 022 would touch any new file with 755 for directories, and 644 for files. Set it to 002 for "-,rw-,rw-,r--"/

Set it globally via /etc/profile, or per user in the usual ~/.bash_rc and ~/.bash_profile type places.

Quote:
Originally Posted by phreeky82 View Post
Code:
//myserver/myshare	/mnt/mountlocation	smbfs	rw,auto,username=myuser,password=mypass,uid=0,gid=1000,dir_mode=0770,file_mode=0660,umask=0777	0	0
gid 1000 is my users group
It appears as if your file_mod and dir_mod flags aren't working. I can only assume it's because you've made the owner of the folder root. I rarely mount things this way around (I'm usually building Linux file servers mounted on Windows machines, so it's all a bit foreign to me).

Try setting the umask to 002, and see what that does. Set it back to 022 and then set the "uid=" in fstab to your own user id, remount, and see what happens.
__________________
Child's Play Charity
elvis is offline   Reply With Quote
Old 15th September 2008, 3:08 PM   #3
phreeky82 Thread Starter
Member
 
Join Date: Dec 2002
Location: Townsville
Posts: 9,131
Default

Thanks

Yeah I was aware what umask did after some reading (general concept), however I was under the impression that the umask property on the mount in fstab (or when using the mount command) actually uses that umask for that mount, regardless of the users setting. Not the case?

Setting umask manually does work fine btw (i.e. umask 0007 gives -rw-rw---- when creating a new file).

The file_mode and dir_mode flags do seem to be working though afaik - when I mount it, any existing files in there do have the permissions I've specified in file_mode and dir_mode, that's how it's supposed to work right?
__________________
Successful trades: eyusuf, andy8, stuartl, michaeliam, theDarkHorse, bob
phreeky82 is offline   Reply With Quote
Old 16th September 2008, 8:10 AM   #4
elvis
Member
 
elvis's Avatar
 
Join Date: Jun 2001
Location: Brisbane
Posts: 20,271
Default

Quote:
Originally Posted by phreeky82 View Post
The file_mode and dir_mode flags do seem to be working though afaik - when I mount it, any existing files in there do have the permissions I've specified in file_mode and dir_mode, that's how it's supposed to work right?
Not entirely sure, sorry. Again, I build them the other way around (Linux server, Windows client), and generally with ext3 extended attributes to allow getfacl and setfacl (part of Samba) to set Windows-style ACLs on files and folders.
__________________
Child's Play Charity
elvis is offline   Reply With Quote
Old 16th September 2008, 8:38 AM   #5
phreeky82 Thread Starter
Member
 
Join Date: Dec 2002
Location: Townsville
Posts: 9,131
Default

Well after more googling it appears that specifying umask on a mount in fstab should dictate the umask to use for that mount, regardless of the users global umask setting. But quite clearly, for smbfs, this isn't working. Bug, "feature", I dunno, and in a strange sort of way it doesn't matter anyway because the true permissions at the other end are not effected regardless, it only matters because until I remount it believes that it cannot write to those files.

AFAIK normally if you set g+s on a directory that all below it will inherit its permissions. I wouldn't mind trying this at least, but how do you set this "s" flag using file_mode/dir_mode octal notation???
__________________
Successful trades: eyusuf, andy8, stuartl, michaeliam, theDarkHorse, bob
phreeky82 is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 11:15 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!