# CIFS: cannot mount as user (w/ possible solution)

## colo

Hello fellow Gentooers,

I've recently began using CIFS on my local network, since there's a windows machine in our household now. So after properly configuring my Kernel for using CIFS and installing net-fs/mount-cifs, I went on to set up my /etc/fstab to allow mounting of a Windows-share for my primary user. The line now looks like this:

```

\\192.168.1.101\Johannes\040-\040Eigene\040Dateien /media/spielepc cifs user,noauto,rw,user=Johannes,pass=,uid=1000,gid=100,nosuid,noexec,nolock,file_mode=0664,dir_mode=0775 0 0

```

When invoking `mount /media/spielepc` as root, everything plays out fine - the share gets mounted, UIDs and GIDs get mapped as requested, and I can write to and read from the remote fs as I wish.

The "user"-flag in fstab should theoretically allow anybody to mount the item specified on that line, but alas, it does not work for me with CIFS (but does so, for example, for my optical drive and an NFSv4-share I have on my LAN as well). When I try to mount, the following happens:

```
colo@zealot ~ $ ls -l $(which mount.cifs)

-rwxr-xr-x 1 root root 28272 2008-12-31 15:03 /usr/bin/mount.cifs

colo@zealot ~ $ mount /media/spielepc/

mount error 1 = Operation not permitted

Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
```

I also tried to setuid-root the binary in question, but then, the following happens (which is RATHER odd imho):

```
colo@zealot ~ $ ls -l $(which mount.cifs)

-rws--x--x 1 root root 28272 2008-12-31 15:03 /usr/bin/mount.cifs

colo@zealot ~ $ mount /media/spielepc/

mount error: permission denied or not superuser and mount.cifs not installed SUID
```

(Please note that the fs with /usr/bin on it is NOT mounted with the "nosuid"-flag.)

Any ideas why this is failing?

I cannot make any sense of the strace output of the two invocations either... but I'll post it if that's requested.

Thanks for taking a look!  :Smile: 

----------

## colo

I put a little research into the issue, and happened to find a solution which fixes the problem for me. It's documented on https://bugs.gentoo.org/show_bug.cgi?id=232608

----------

