1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools eutils linux-info multilib pam
8 DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
9 HOMEPAGE="https://wiki.samba.org/index.php/LinuxCIFS_utils"
10 SRC_URI="https://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
14 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-linux"
15 IUSE="+acl +ads +caps +caps-ng creds pam"
19 !<net-fs/samba-3.6_rc1
25 caps? ( !caps-ng? ( sys-libs/libcap ) )
26 caps? ( caps-ng? ( sys-libs/libcap-ng ) )
31 acl? ( >=net-fs/samba-4.0.0_alpha1 )
34 REQUIRED_USE="acl? ( ads )"
36 DOCS="doc/linux-cifs-client-guide.odt"
39 "${FILESDIR}/${P}-talloc.patch"
45 if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
46 ewarn "You must enable CIFS support in your kernel config, "
47 ewarn "to be able to mount samba shares. You can find it at"
50 ewarn " Network File Systems"
53 ewarn "and recompile your kernel ..."
60 if has_version app-crypt/heimdal ; then
61 # https://bugs.gentoo.org/612584
62 eapply "${FILESDIR}/${PN}-6.7-heimdal.patch"
69 ROOTSBINDIR="${EPREFIX}"/sbin \
71 $(use_enable acl cifsacl cifsidmap) \
72 $(use_enable ads cifsupcall) \
73 $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
74 $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
75 $(use_enable creds cifscreds) \
77 $(use_with pam pamdir $(getpam_mod_dir))
83 # remove empty directories
84 find "${ED}" -type d -print0 | xargs --null rmdir \
85 --ignore-fail-on-non-empty &>/dev/null
89 dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
90 /etc/cifs-utils/idmap-plugin
91 dodir /etc/request-key.d
92 echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
93 > "${ED}/etc/request-key.d/cifs.idmap.conf"
97 dodir /etc/request-key.d
98 echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
99 > "${ED}/etc/request-key.d/cifs.upcall.conf"
100 echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \
101 > "${ED}/etc/request-key.d/cifs.spnego.conf"
106 # Inform about set-user-ID bit of mount.cifs
107 ewarn "setuid use flag was dropped due to multiple security implications"
108 ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
109 ewarn "You are free to set setuid flags by yourself"
111 # Inform about upcall usage
113 einfo "The cifs.idmap utility has been enabled by creating the"
114 einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
115 einfo "This enables you to get and set CIFS acls."
119 einfo "The cifs.upcall utility has been enabled by creating the"
120 einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
121 einfo "This enables you to mount DFS shares."