# [smb/cifs] permissions don't get honored

## avx

Mounting my NAS-shares via cifs like this

```
//10.0.0.100/media      /home/avx/nas/media cifs   cred=/etc/samba/nas.cred,gid=100,uid=1000,iocharset=utf8
```

, permissions aren't setup how I would like them.

I.e.

```
> mkdir foo

> touch bla

> ls -l

total 0

drwxrwxrw-+ 2 avx users 0 31. Mär 2011  foo/

-rwxrwxrw-+ 1 avx users 0 31. Mär 01:24 bla*
```

Everything gets the executable-bit, which is quite unpleasant for it ruining the purpose of DIR_COLORS and being a potential risk and plain rsync doesn't really work that way when I'd like to keep permissions. a-x does not work, removing the x from my user, but keeping it for the group.

I tried adding umask=022,file_mode=0644,dir_mode=0755 to the mount-line, but it doesn't change a thing. I found no related setting in the webui and not much if anything via Google. So, do I have to live with this or what are my options?

----------

## vyedmic

How is the samba share configured on the NAS?

There are 2 config options available in smb.conf which would solve your problem:

```
create mask = 0644

directory mask = 0755
```

Try to figure out how to access the smb.conf on your NAS and add these to your share with masks you require.

----------

## Seron

I've had the same problem and was able to mitigate it somewhat with the option file_mode=0644. There's also a dir_mode. I suppose it does the same as what vyedmic suggested. Have a look in the mount.cifs man page. It's a bit crude as it just sets another set of fixed attributes to all files so if you have a better solution I'd be interested to know. My NAS is an Apple Airport Extreme router with a USB drive attached to it and have no access to the smb.conf file.

----------

