1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools bash-completion-r1 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 ~sparc ~x86 ~x86-linux"
15 IUSE="+acl +ads +caps creds pam"
19 !<net-fs/samba-3.6_rc1
25 caps? ( sys-libs/libcap-ng )
29 BDEPEND="dev-python/docutils"
31 acl? ( >=net-fs/samba-4.0.0_alpha1 )
34 REQUIRED_USE="acl? ( ads )"
36 DOCS="doc/linux-cifs-client-guide.odt"
38 PATCHES=( "${FILESDIR}/${PN}-6.10-ln_in_destdir.patch" )
43 if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
44 ewarn "You must enable CIFS support in your kernel config, "
45 ewarn "to be able to mount samba shares. You can find it at"
48 ewarn " Network File Systems"
51 ewarn "and recompile your kernel ..."
58 if has_version app-crypt/heimdal ; then
59 # https://bugs.gentoo.org/612584
60 eapply "${FILESDIR}/${PN}-6.7-heimdal.patch"
69 $(use_enable acl cifsacl cifsidmap)
70 $(use_enable ads cifsupcall)
71 $(use_with caps libcap)
72 $(use_enable creds cifscreds)
74 $(use_with pam pamdir $(getpam_mod_dir))
76 ROOTSBINDIR="${EPREFIX}"/sbin \
77 econf "${myeconfargs[@]}"
83 # remove empty directories
84 find "${ED}" -type d -empty -delete || die
88 dosym ../../usr/$(get_libdir)/cifs-utils/idmapwb.so \
89 /etc/cifs-utils/idmap-plugin
90 dodir /etc/request-key.d
91 echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
92 > "${ED}/etc/request-key.d/cifs.idmap.conf"
96 dodir /etc/request-key.d
97 echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
98 > "${ED}/etc/request-key.d/cifs.upcall.conf"
99 echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \
100 > "${ED}/etc/request-key.d/cifs.spnego.conf"
103 dobashcomp bash-completion/smbinfo
107 # Inform about set-user-ID bit of mount.cifs
108 ewarn "setuid use flag was dropped due to multiple security implications"
109 ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
110 ewarn "You are free to set setuid flags by yourself"
112 # Inform about upcall usage
114 einfo "The cifs.idmap utility has been enabled by creating the"
115 einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
116 einfo "This enables you to get and set CIFS acls."
120 einfo "The cifs.upcall utility has been enabled by creating the"
121 einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
122 einfo "This enables you to mount DFS shares."