![]() |
![]() OCAU News - Wiki - QuickLinks - Pix - Sponsors |
|
|||||||
| Notices |
|
Sign up for a free OCAU account and this ad will go away! Search our forums with Google: |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Member
Join Date: Dec 2002
Location: Townsville
Posts: 9,131
|
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
__________________
Successful trades: eyusuf, andy8, stuartl, michaeliam, theDarkHorse, bob |
|
|
|
| Join OCAU to remove this ad! |
|
|
#2 | |
|
Member
Join Date: Jun 2001
Location: Brisbane
Posts: 20,271
|
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:
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 |
|
|
|
|
|
|
#3 |
|
Member
Join Date: Dec 2002
Location: Townsville
Posts: 9,131
|
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 |
|
|
|
|
|
#4 |
|
Member
Join Date: Jun 2001
Location: Brisbane
Posts: 20,271
|
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 |
|
|
|
|
|
#5 |
|
Member
Join Date: Dec 2002
Location: Townsville
Posts: 9,131
|
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 |
|
|
|
![]() |
| Bookmarks |
|
Sign up for a free OCAU account and this ad will go away! |
| Thread Tools | |
|
|