# mount.cifs broken [Solved]

## grooveman

Hi,

I have a share from a win7 box on the network that I have been using for years.  I upgraded yesterday, and now it is inaccessible to my normal (non-root) user.

here is my entry in my fstab:

```
//10.99.99.199/gman            /home/gman/win7 cifs   user,_netdev,noperm,uid=gman,noauto,user=gman,dir_mode=0700,file_mode=0700,credentials=/etc/smbpwds,rsize=130048,wsize=57344 1 2

```

When trying to mount via the command line:

```
mount /home/gman/win7

This program is not installed setuid root -  "user" CIFS mounts not supported.
```

So, I setuid /sbin/mount.cifs 

```
chmod 4700 /sbin/mount.cfs
```

or

```
chmod +us /sbin/mount/cifs
```

Now I get:

```
Unable to set current process capabilities: Operation not permitted

error 2 (No such file or directory) opening credential file /etc/smbpwds
```

I have no idea what the top line means, and I cannot find anything meaningful when I google search it.

The second line is utter bullshit, because /etc/smbpwds is there.  I have even tried chmoding it to 666, it doesn't make a difference what the perms are.

Is this a bug, or have they changed mount.cifs again?  Is there something I can do to fix this?

Thank you!

G

----------

## grooveman

Upgraded cifs-utils to cifs-utils-5.6-r1, the problem still exists.

Downgraded to cifs-utils-5.4 and the problem disappeared.  I cannot find anything on google or on the samba home page about this, so I'm thinking it is a bug...

----------

## grooveman

Filed Bug:

https://bugs.gentoo.org/show_bug.cgi?id=435570

----------

## maguire

Thanks for filing the bug (I just ran into the same problem).

Does a bug like this usually go a month without any response or "confirmation"?

Bruce.

----------

## javeree

What are your use flag settings ?

I remember having some problems with caps that I could resolve by using the flags 

net-fs/cifs-utils        -caps caps-ng

(+caps did have a problem)

----------

## alex.blackbit

I can confirm that the solution of javeree works.

----------

## grooveman

Yes, I have switched as well, makes me wonder why the default is not set that way...

----------

## Massimo B.

Using caps-ng instead of caps solved the problem:

```
[ebuild  N     ] sys-libs/libcap-ng-0.6.6  USE="-python -static-libs" 359 kB

[ebuild   R   ~] net-fs/cifs-utils-5.8-r1  USE="ads caps-ng* creds -caps* -upcall" 0 kB
```

But the setuid is still required and not yet done by the latest ebuild:

```
$ chmod u+s /sbin/mount.cifs

mode of ‘/sbin/mount.cifs’ changed from 0755 (rwxr-xr-x) to 4755 (rwsr-xr-x)
```

----------

## grooveman

 *Quote:*   

> But the setuid is still required and not yet done by the latest ebuild:
> 
> ```
> $ chmod u+s /sbin/mount.cifs
> 
> ...

 

I don't expect that will ever happen, for security reasons.  I think you will always have to do this manually.

But I am glad to hear you got it working   :Smile: 

----------

## Kobboi

Could you explain the security issue? Note that /bin/mount is also setuid by default.

----------

