Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cifs - cannot write to newly created files/dirs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kvap
n00b
n00b


Joined: 16 May 2008
Posts: 4

PostPosted: Fri May 16, 2008 8:47 pm    Post subject: cifs - cannot write to newly created files/dirs Reply with quote

I mount a windows share this way (fstab):
Code:

//10.0.0.110/share /mnt/share  cifs   auto,username=smb_user,password=123,uid=root,gid=users,codepage=866,dir_mode=0770,file_mode=0660,sync   0 0


After mounting there are correct owners/permissions on already existing files:
Code:

$ pwd
/mnt/share

$ ls -l
drwxrwx--- 1 root users 0 Май 17  2008 asd


But:
Code:

$ mkdir dsa; ls -l
итого 0
drwxrwx--- 1 root users 0 Май 17  2008 asd
drwxr-xr-x 2 root users 0 Май 17  2008 dsa


So I cannot, for example, copy a directory with files to this share - the directory is created, but with r-x permissions for group 'users' until remounting.

I can change my umask and then it works fine:
Code:

$ umask 007; mkdir okay; ls -l
итого 0
drwxrwx--- 1 root users 0 Май 17  2008 asd
drwxr-xr-x 2 root users 0 Май 17  2008 dsa
drwxrwx--- 2 root users 0 Май 17  2008 okay


Bit I don't want to create all my files, even outside this share, with umask 007.

Is there a way to specify umask for this share that will override user's umask?
Tried to set it in fstab,
Code:

//10.0.0.110/share /mnt/share  cifs   auto,username=smb_user,password=123,uid=root,gid=users,codepage=866,dir_mode=0770,file_mode=0660,sync,umask=007   0 0
, but this changed nothing.
Back to top
View user's profile Send private message
SeaTiger
l33t
l33t


Joined: 22 Nov 2007
Posts: 603
Location: Toronto, Ontario, Canada

PostPosted: Sat May 17, 2008 4:53 am    Post subject: Reply with quote

Set the file mask in the sambe config, not in the mount option.
Back to top
View user's profile Send private message
kvap
n00b
n00b


Joined: 16 May 2008
Posts: 4

PostPosted: Sun May 18, 2008 9:13 am    Post subject: Reply with quote

I thought the only config for mount.cifs are the mount options...
Back to top
View user's profile Send private message
SeaTiger
l33t
l33t


Joined: 22 Nov 2007
Posts: 603
Location: Toronto, Ontario, Canada

PostPosted: Sun May 18, 2008 10:34 am    Post subject: Reply with quote

oh, I mean the /etc/samba/smb.conf in the samba server.
Back to top
View user's profile Send private message
kvap
n00b
n00b


Joined: 16 May 2008
Posts: 4

PostPosted: Mon May 19, 2008 5:16 am    Post subject: Reply with quote

The server is Windows :P
Back to top
View user's profile Send private message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 455

PostPosted: Mon May 19, 2008 7:38 am    Post subject: Reply with quote

I believe you may be facing the same problem I have (and which I've been unabel to get solved in the fast few months). Are we talking about Windows XP Home here ?

See https://forums.gentoo.org/viewtopic-t-543689-highlight-samba+permissions.html

Can you reproduce the same problem ?
Back to top
View user's profile Send private message
SeaTiger
l33t
l33t


Joined: 22 Nov 2007
Posts: 603
Location: Toronto, Ontario, Canada

PostPosted: Mon May 19, 2008 8:41 am    Post subject: Reply with quote

Try
Code:
//10.0.0.110/share /mnt/share  cifs   auto,username=smb_user,password=123,uid=root,gid=users,codepage=866,dir_mode=0770,file_mode=0660,directio   0 0
Back to top
View user's profile Send private message
kvap
n00b
n00b


Joined: 16 May 2008
Posts: 4

PostPosted: Tue May 20, 2008 9:02 pm    Post subject: Reply with quote

junksiu, this didn't help.

javeree, Windows is Pro 64bit, but situation looks extremely same.

I also tried mounting a share of another server - under Gentoo.

Here are fragments of smb.conf on it:
Code:

...
[sandbox]
   comment = The Sandbox
   path = /home/sandbox
   valid users = @smb_sandbox
   public = no
   writable = yes
   printable = no
   create mask = 0770
   force create mode = 0770
   directory mask = 0770
   force directory mode = 0770
...

Code:

...
[global]
   unix extensions = no
...


The result the same.

On client:
Code:

$ mount.cifs --version
mount.cifs version: 1.10
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum