chmod fails Permission denied with cifs client mounted samba share

View: New views
5 Messages — Rating Filter:   Alert me  

chmod fails Permission denied with cifs client mounted samba share

by munga :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have a Thecus N2100 NAS box running samba Version 3.0.23a and I am mounting it in /etc/fstab as below
//n2100/svn_repos /media/svn_repos cifs auto,user,sfu,username=mythtv,password=mythtv,,rw 0 0
The CIFS client is mount.cifs version: 1.12-3.3.4

The problem is I get Permission denied errors when using chmod as below. Even touching a file gives errors although it still creates the file. If I mount the samba share via a windows machine I am able to change the security settings as expected. I have tried many different options with no change. I need chmod to work so I can setup a subversion repository on it.
[root@mythtv media]
# ll svn_repos/
total 4
-rwxrwxrw-+ 1 mythtv users 0 Jun 28 08:48 test
[root@mythtv media]
# chmod 766 svn_repos/test
chmod: changing permissions of `svn_repos/test': Permission denied
[root@mythtv media]
# touch svn_repos/test2
touch: setting times of `svn_repos/test2': Invalid argument


Here is my current smb.conf which is created by NAS box.
[global]
server string = %h
deadtime = 15
hide unreadable=yes
load printers = no
log file = /opt/samba/var/log/samba.%m
log level = 0
unix extensions = yes
max log size = 50
encrypt passwords = yes
case sensitive = auto
passdb backend = tdbsam
socket options = TCP_NODELAY
use sendfile = yes
local master = yes
domain master = no
preferred master =no
dns proxy = no
dos charset=utf8
unix charset=utf8
display charset=utf8
allow trusted domains = No
idmap uid = 20000-40000
idmap gid = 20000-40000
winbind separator = +
winbind nested groups = yes
winbind enum users = yes
winbind enum groups = yes
create mask = 0644
winbind use default domain = yes
map acl inherit = yes
nt acl support = yes
#map system = yes
bind interfaces only = yes
interfaces = eth*,wlan*,lo
guest account = nobody
map to guest = Bad User
guest only = yes
workgroup = HOME                                                                                                        
security = user                                                                                                          
auth methods = guest sam_ignoredomain                                                                                    
password server = .                                                                                                      
realm =                                                                                                                  
idmap backend = idmap_rid:MYGROUP=20000-40000                                                                            
wins server =

[svn_repos]                                                                                                              
comment = Subversion repository                                                                                          
browseable = yes                                                                                                        
#guest only = yes                                                                                                        
path = /raid/svn_repos                                                                                                  
map acl inherit = yes                                                                                                    
inherit acls = yes                                                                                                      
read only = no                                                                                                          
create mask = 0777                                                                                                      
force create mode = 0000                                                                                                
inherit permissions = Yes                                                                                                
map archive = yes                                                                                                        
map hidden = yes                                                                                                        
#recursive = yes                                                                                                        
guest only = no

Re: chmod fails Permission denied with cifs client mounted samba share

by Kaustubh Chaudhari :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If i am not wrong than you are trying to mount a svn repos and than work
on that.

This is not a good idea http://svnbook.red-bean.com/en/1.1/ch05s02.html 
read the warning, this is specific to POSIX though,

munga wrote:

> Hi,
>
> I have a Thecus N2100 NAS box running samba Version 3.0.23a and I am
> mounting it in /etc/fstab as below
> //n2100/svn_repos /media/svn_repos cifs
> auto,user,sfu,username=mythtv,password=mythtv,,rw 0 0
> The CIFS client is mount.cifs version: 1.12-3.3.4
>
> The problem is I get Permission denied errors when using chmod as below.
> Even touching a file gives errors although it still creates the file. If I
> mount the samba share via a windows machine I am able to change the security
> settings as expected. I have tried many different options with no change. I
> need chmod to work so I can setup a subversion repository on it.
> [root@mythtv media]
> # ll svn_repos/
> total 4
> -rwxrwxrw-+ 1 mythtv users 0 Jun 28 08:48 test
> [root@mythtv media]
> # chmod 766 svn_repos/test
> chmod: changing permissions of `svn_repos/test': Permission denied
> [root@mythtv media]
> # touch svn_repos/test2
> touch: setting times of `svn_repos/test2': Invalid argument
>
>
> Here is my current smb.conf which is created by NAS box.
> [global]
> server string = %h
> deadtime = 15
> hide unreadable=yes
> load printers = no
> log file = /opt/samba/var/log/samba.%m
> log level = 0
> unix extensions = yes
> max log size = 50
> encrypt passwords = yes
> case sensitive = auto
> passdb backend = tdbsam
> socket options = TCP_NODELAY
> use sendfile = yes
> local master = yes
> domain master = no
> preferred master =no
> dns proxy = no
> dos charset=utf8
> unix charset=utf8
> display charset=utf8
> allow trusted domains = No
> idmap uid = 20000-40000
> idmap gid = 20000-40000
> winbind separator = +
> winbind nested groups = yes
> winbind enum users = yes
> winbind enum groups = yes
> create mask = 0644
> winbind use default domain = yes
> map acl inherit = yes
> nt acl support = yes
> #map system = yes
> bind interfaces only = yes
> interfaces = eth*,wlan*,lo
> guest account = nobody
> map to guest = Bad User
> guest only = yes
> workgroup = HOME                                                                                                        
> security = user                                                                                                          
> auth methods = guest sam_ignoredomain                                                                                    
> password server = .                                                                                                      
> realm =                                                                                                                  
> idmap backend = idmap_rid:MYGROUP=20000-40000                                                                            
> wins server =
>
> [svn_repos]                                                                                                              
> comment = Subversion repository                                                                                          
> browseable = yes                                                                                                        
> #guest only = yes                                                                                                        
> path = /raid/svn_repos                                                                                                  
> map acl inherit = yes                                                                                                    
> inherit acls = yes                                                                                                      
> read only = no                                                                                                          
> create mask = 0777                                                                                                      
> force create mode = 0000                                                                                                
> inherit permissions = Yes                                                                                                
> map archive = yes                                                                                                        
> map hidden = yes                                                                                                        
> #recursive = yes                                                                                                        
> guest only = no
>
>  


_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client

Parent Message unknown Re: chmod fails Permission denied with cifs client mounted samba share

by munga :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That only applies to the Berkeley DB repository I am going to use fsfs as I have not created the repository yet.
The problem I have asked about relates to chmod not working which is used by svn.

--- On Tue, 30/6/09, Kaustubh Chaudhari <c_kitu@...> wrote:

From: Kaustubh Chaudhari <c_kitu@...>
Subject: Re: [linux-cifs-client] chmod fails Permission denied with cifs client mounted samba share
To: "munga" <n2801841@...>
Cc: linux-cifs-client@...
Received: Tuesday, 30 June, 2009, 12:29 AM

If i am not wrong than you are trying to mount a svn repos and than work on that.

This is not a good idea http://svnbook.red-bean.com/en/1.1/ch05s02.html read the warning, this is specific to POSIX though,

munga wrote:

> Hi,
>
> I have a Thecus N2100 NAS box running samba Version 3.0.23a and I am
> mounting it in /etc/fstab as below
> //n2100/svn_repos /media/svn_repos cifs
> auto,user,sfu,username=mythtv,password=mythtv,,rw 0 0
> The CIFS client is mount.cifs version: 1.12-3.3.4
>
> The problem is I get Permission denied errors when using chmod as below.
> Even touching a file gives errors although it still creates the file. If I
> mount the samba share via a windows machine I am able to change the security
> settings as expected. I have tried many different options with no change. I
> need chmod to work so I can setup a subversion repository on it.
> [root@mythtv media]
> # ll svn_repos/
> total 4
> -rwxrwxrw-+ 1 mythtv users 0 Jun 28 08:48 test
> [root@mythtv media]
> # chmod 766 svn_repos/test chmod: changing permissions of `svn_repos/test': Permission denied
> [root@mythtv media]
> # touch svn_repos/test2
> touch: setting times of `svn_repos/test2': Invalid argument
>
>
> Here is my current smb.conf which is created by NAS box.
> [global]
> server string = %h
> deadtime = 15
> hide unreadable=yes
> load printers = no
> log file = /opt/samba/var/log/samba.%m
> log level = 0
> unix extensions = yes
> max log size = 50
> encrypt passwords = yes
> case sensitive = auto
> passdb backend = tdbsam
> socket options = TCP_NODELAY
> use sendfile = yes
> local master = yes
> domain master = no
> preferred master =no
> dns proxy = no
> dos charset=utf8
> unix charset=utf8
> display charset=utf8
> allow trusted domains = No
> idmap uid = 20000-40000
> idmap gid = 20000-40000
> winbind separator = +
> winbind nested groups = yes
> winbind enum users = yes
> winbind enum groups = yes
> create mask = 0644
> winbind use default domain = yes
> map acl inherit = yes
> nt acl support = yes
> #map system = yes
> bind interfaces only = yes
> interfaces = eth*,wlan*,lo
> guest account = nobody
> map to guest = Bad User
> guest only = yes
> workgroup = HOME                                                                                                         security = user                                                                                                          auth methods = guest sam_ignoredomain                                                                                    password server = .                                                                                                      realm =                                                                                                                  idmap backend = idmap_rid:MYGROUP=20000-40000                                                                            wins server =
>
> [svn_repos]                                                                                                              comment = Subversion repository                                                                                          browseable = yes                                                                                                         #guest only = yes                                                                                                        path = /raid/svn_repos                                                                                                   map acl inherit = yes                                                                                                    inherit acls = yes                                                                                                       read only = no                                                                                                           create mask = 0777                                                                                                       force create mode = 0000                                                                                                 inherit permissions = Yes                                                                                                map archive = yes                                                                                                        map hidden = yes                                                                                                         #recursive = yes                                                                                                         guest only = no
>
>   




Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how.
_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client

Re: chmod fails Permission denied with cifs client mounted samba share

by Jeff Layton-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2009-06-27 at 17:21 -0700, munga wrote:
> Hi,
>
> I have a Thecus N2100 NAS box running samba Version 3.0.23a and I am
> mounting it in /etc/fstab as below
> //n2100/svn_repos /media/svn_repos cifs
> auto,user,sfu,username=mythtv,password=mythtv,,rw 0 0
> The CIFS client is mount.cifs version: 1.12-3.3.4
>

What kernel is the client running?

> The problem is I get Permission denied errors when using chmod as below.
> Even touching a file gives errors although it still creates the file. If I
> mount the samba share via a windows machine I am able to change the security
> settings as expected. I have tried many different options with no change. I
> need chmod to work so I can setup a subversion repository on it.
> [root@mythtv media]
> # ll svn_repos/
> total 4
> -rwxrwxrw-+ 1 mythtv users 0 Jun 28 08:48 test
> [root@mythtv media]
> # chmod 766 svn_repos/test
> chmod: changing permissions of `svn_repos/test': Permission denied
> [root@mythtv media]
> # touch svn_repos/test2
> touch: setting times of `svn_repos/test2': Invalid argument
>
> Here is my current smb.conf which is created by NAS box.
> [global]
> server string = %h
> deadtime = 15
> hide unreadable=yes
> load printers = no
> log file = /opt/samba/var/log/samba.%m
> log level = 0
> unix extensions = yes
> max log size = 50
> encrypt passwords = yes
> case sensitive = auto
> passdb backend = tdbsam
> socket options = TCP_NODELAY
> use sendfile = yes
> local master = yes
> domain master = no
> preferred master =no
> dns proxy = no
> dos charset=utf8
> unix charset=utf8
> display charset=utf8
> allow trusted domains = No
> idmap uid = 20000-40000
> idmap gid = 20000-40000
> winbind separator = +
> winbind nested groups = yes
> winbind enum users = yes
> winbind enum groups = yes
> create mask = 0644
> winbind use default domain = yes
> map acl inherit = yes
> nt acl support = yes
> #map system = yes
> bind interfaces only = yes
> interfaces = eth*,wlan*,lo
> guest account = nobody
> map to guest = Bad User
> guest only = yes
> workgroup = HOME                                                                                                        
> security = user                                                                                                          
> auth methods = guest sam_ignoredomain                                                                                    
> password server = .                                                                                                      
> realm =                                                                                                                  
> idmap backend = idmap_rid:MYGROUP=20000-40000                                                                            
> wins server =
>
> [svn_repos]                                                                                                              
> comment = Subversion repository                                                                                          
> browseable = yes                                                                                                        
> #guest only = yes                                                                                                        
> path = /raid/svn_repos                                                                                                  
> map acl inherit = yes                                                                                                    
> inherit acls = yes                                                                                                      
> read only = no                                                                                                          
> create mask = 0777                                                                                                      
> force create mode = 0000                                                                                                
> inherit permissions = Yes                                                                                                
> map archive = yes                                                                                                        
> map hidden = yes                                                                                                        
> #recursive = yes                                                                                                        
> guest only = no

--
Jeff Layton <jlayton@...>

_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client

Re: chmod fails Permission denied with cifs client mounted samba share

by Jeff Layton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2009-06-27 at 17:21 -0700, munga wrote:

> I have a Thecus N2100 NAS box running samba Version 3.0.23a and I am
> mounting it in /etc/fstab as below
> //n2100/svn_repos /media/svn_repos cifs
> auto,user,sfu,username=mythtv,password=mythtv,,rw 0 0
> The CIFS client is mount.cifs version: 1.12-3.3.4

> The problem is I get Permission denied errors when using chmod as below.
> Even touching a file gives errors although it still creates the file. If I
> mount the samba share via a windows machine I am able to change the security
> settings as expected. I have tried many different options with no change. I
> need chmod to work so I can setup a subversion repository on it.
> [root@mythtv media]
> # ll svn_repos/
> total 4
> -rwxrwxrw-+ 1 mythtv users 0 Jun 28 08:48 test
> [root@mythtv media]
> # chmod 766 svn_repos/test
> chmod: changing permissions of `svn_repos/test': Permission denied
> [root@mythtv media]
> # touch svn_repos/test2
> touch: setting times of `svn_repos/test2': Invalid argument
>

Ok, so in a private email you said that the client was running 2.6.28.
That's reasonably recent, so it's unlikely to be a known issue that was
fixed recently or anything...

Often these sorts of issues are due to a mismatch on client and server
of uid's.

The first thing I'd try is turning off the "sfu" option. That shouldn't
be needed for true POSIX extensions to work. I sort of doubt that it'll
matter though.

Some more questions:

I see the "user" option there. Are you mounting this as an unprivileged
user?

Does "mythtv" have the same uid on both the client and server?

If you log into the server, does the "svn_repos/test" show itself as
being owned by "mythtv" as well?

--
Jeff Layton <jlayton@...>

_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client