compile cifs-utils with libcap-ng
Description: I'm trying to setup user mount with samba share, using credentials option in fstab, but I get error mounting without sudo. I enabled systemd.automount, but I get the same error in dolphin.
I googled it and it seems to be fixed using libcap-ng instead of libcap with samba. For example, this thread in gentoo forum: https://forums.gentoo.org/viewtopic-t-937174-start-0.html
Also, package in arch depends on libcap-ng instead of libcap: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/cifs-utils
* cifs-utils 6.5-1 * libcap 2.25-1
Steps to reproduce:
Add samba share setup to /etc/fstab:
//192.168.1.2/hdd /mnt/osmc cifs _netdev,x-systemd.automount,noauto,credentials=/etc/samba/private/osmc.creds,iocharset=utf8,rw,gid=network,file_mode=0775,dir_mode=0775,user 0 0
Open directory with dolphin, or try to mount without sudo.
Unable to set current process capabilities: Operation not permitted error 2 (No such file or directory) opening credential file /etc/samba/private/osmc.creds
Expected result: It should mount samba share.
I compiled package with same PKGBUILD, having libcap-ng installed, and it **fixed **the problem, mount.cifs was linked to libcap-ng:
$ ldd /bin/mount.cifs linux-vdso.so.1 (0x00007ffc90845000) libcap-ng.so.0 => /usr/lib/libcap-ng.so.0 (0x00007f4d47ace000) libc.so.6 => /usr/lib/libc.so.6 (0x00007f4d4772a000) /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f4d47edd000)