1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils linux-info multilib
9 DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
10 HOMEPAGE="http://wiki.samba.org/index.php/LinuxCIFS_utils"
11 SRC_URI="https://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
16 IUSE="+acl +ads +caps +caps-ng creds"
18 DEPEND="!net-fs/mount-cifs
19 !<net-fs/samba-3.6_rc1
25 caps? ( !caps-ng? ( sys-libs/libcap ) )
26 caps? ( caps-ng? ( sys-libs/libcap-ng ) )
27 creds? ( sys-apps/keyutils )"
30 =net-fs/samba-3.6*[winbind]
31 >=net-fs/samba-4.0.0_alpha1
35 REQUIRED_USE="acl? ( ads )"
37 DOCS="doc/linux-cifs-client-guide.odt"
42 if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
43 ewarn "You must enable CIFS support in your kernel config, "
44 ewarn "to be able to mount samba shares. You can find it at"
47 ewarn " Network File Systems"
50 ewarn "and recompile your kernel ..."
55 ROOTSBINDIR="${EPREFIX}"/sbin \
57 $(use_enable acl cifsacl cifsidmap) \
58 $(use_enable ads cifsupcall) \
59 $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
60 $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
61 $(use_enable creds cifscreds)
67 # remove empty directories
68 find "${ED}" -type d -print0 | xargs --null rmdir \
69 --ignore-fail-on-non-empty &>/dev/null
73 dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
74 /etc/cifs-utils/idmap-plugin
75 dodir /etc/request-key.d
76 echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
77 > "${ED}/etc/request-key.d/cifs.idmap.conf"
81 dodir /etc/request-key.d
82 echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
83 > "${ED}/etc/request-key.d/cifs.upcall.conf"
88 # Inform about set-user-ID bit of mount.cifs
89 ewarn "setuid use flag was dropped due to multiple security implications"
90 ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
91 ewarn "You are free to set setuid flags by yourself"
93 # Inform about upcall usage
95 einfo "The cifs.idmap utility has been enabled by creating the"
96 einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
97 einfo "This enables you to get and set CIFS acls."
101 einfo "The cifs.upcall utility has been enabled by creating the"
102 einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
103 einfo "This enables you to mount DFS shares."