summaryrefslogtreecommitdiff
path: root/net-fs/cifs-utils
diff options
context:
space:
mode:
Diffstat (limited to 'net-fs/cifs-utils')
-rw-r--r--net-fs/cifs-utils/Manifest3
-rw-r--r--net-fs/cifs-utils/cifs-utils-6.15.ebuild138
-rw-r--r--net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch80
3 files changed, 221 insertions, 0 deletions
diff --git a/net-fs/cifs-utils/Manifest b/net-fs/cifs-utils/Manifest
index 86eecb69be52..188fc4c1a26a 100644
--- a/net-fs/cifs-utils/Manifest
+++ b/net-fs/cifs-utils/Manifest
@@ -1,6 +1,9 @@
AUX cifs-utils-6.12-ln_in_destdir.patch 629 BLAKE2B aa901b00c41a58ae21d948b3eece79914dc78782fcd49afc27ba8d7fa061f8aec43d187ce1302d67b5e5fc2cce113906545b9ae9920704f29ad3758a71079994 SHA512 354e33c91b0678e08ba9dabd989a5afdb2e558fa71dc427b283f9b987f94908d9b696c95a7e608e13f26497a52e7e8bf973290a84b2024ac9bc817ba512adf26
+AUX cifs-utils-6.15-musl.patch 2215 BLAKE2B 251be73f341d4573aa509915e364680fc6d85ed720ad5682812cd6ba418a64bd7c397bd742cd999cea52fda0e07d668e796383f034c5ccb1639764f93d050e9e SHA512 902deb413bbc7f34d9933fcae9c48c73bb2fb2aaca22b5ef3efd394bb2d550456548c08087db41a96a60f3e1ed945127ba242dc980b286dbf3abad1b0694c605
AUX cifs-utils-6.7-heimdal.patch 904 BLAKE2B de816117010e71ced5ad094e8ed3537b672b37a0e8ac0b999aa7aaf180ac051f6745ee68373948b266ad359e1ba3b58552eda6314b5a4339673bd04656ab6090 SHA512 e3364e05fba6aff57ea2f09b530692f4f5ec95213e91794388fff9382d210db9bacb28dae1440d3b35a570c0b3bc21084a067e0ce8333febd5246c52aa9260ae
DIST cifs-utils-6.13-kerberos_mount_regression_fix.patch.xz 4336 BLAKE2B de268f815ee4fbb750bf8b7d7110a69a808682c239a7c9196468ecc4d55a26eed3b63f8d8539569e16131060f57de389ef92e1063283eb2f41e65be00ed21bb1 SHA512 13d1fb8ff7c31100bfa481e647e9d3b90d61633173b3a71683246d7bb4b68c7e147d21697a17b7ad60e1ac8da2d48d6f4b51762370536a32d14da6c9a6db7e5e
DIST cifs-utils-6.13.tar.bz2 414584 BLAKE2B 5133ea39fc65acaf2a9791f8ac97dee681dd12f509e0abd095542ce663e7c62002b033dcf35f0a8eec214cb9940597fb568fd50d4cfe5271ca4e433afbe1a7bc SHA512 1337ac4b69f0c3e8d0241eb608207ba81dfa35f84c661649d25da78637882c4d73467b0f632be0bd120362e0b786e40eb340bffcf21c8a09629c441100fd10de
+DIST cifs-utils-6.15.tar.bz2 416592 BLAKE2B 8af926bf255c5b3a66bf52ccca99632aacb9ed1c83ad7db5543b32df2f3bcd4be9a9cd17b744ec115d1568d07084e2bd2d03849aa9ab97cff2862f39bcf137b8 SHA512 eedb8066563db584595a8ba7cb7a603e6b763ac2c1261430d605c327fcc5a831acd48b58ea55dd243af778dfdc827ab8c6daf4015764ff550dcffc2182773510
EBUILD cifs-utils-6.13-r1.ebuild 3606 BLAKE2B 398bc6c882a00d7cecb5315a2f2ea6f16b5a580f37f7d5759c25b35f52e314fd35502f4bbaadd0871905c87e4918e97cee728f4d36795d02981f88752686daac SHA512 be39a907aa792ae30603d8db37a08629a4719e8b2eef78603c47b94b464a0780e25b5bb6c40f6d128ddc0a7bca188267e3ba7a6fc180a0b6188c228ae9091c03
+EBUILD cifs-utils-6.15.ebuild 3462 BLAKE2B 26534380a4e18106dee5f08f7479dca69337c200a8302867900f4d0c8b9e397202fb628ec0ca8e39eec90e8b7959a38045ed1ee066d520eea58b201424457a03 SHA512 66832ae0562c98c77a8c011ade50bb33135e0b2cd8d2106e50923761444db6bc5fe6eab139bf3fd0694e274491c007d895c244051d5e6f446e7a2c512bbb06c0
MISC metadata.xml 967 BLAKE2B dc6654b412c77f2e95cad9cfa2d4e4465d3292b546d55ddc04ad1b3d5b8220bbe4ef0b0d1409fb2f5da99851d45567667935057f5d5c15dad4e2cf26e3ce0e00 SHA512 c6b0fbdd9d776695032cd4a3e109717dfa7cd07b1456da8264dc0688fcfa158d1f4a73758ee24ba318f14e7a321811bd24f688ca3c39156b304028566315b650
diff --git a/net-fs/cifs-utils/cifs-utils-6.15.ebuild b/net-fs/cifs-utils/cifs-utils-6.15.ebuild
new file mode 100644
index 000000000000..47128fb754a5
--- /dev/null
+++ b/net-fs/cifs-utils/cifs-utils-6.15.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit autotools bash-completion-r1 linux-info pam python-single-r1
+
+DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
+HOMEPAGE="https://wiki.samba.org/index.php/LinuxCIFS_utils"
+SRC_URI="https://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
+IUSE="+acl +ads +caps creds pam +python systemd"
+
+RDEPEND="
+ sys-apps/keyutils:=
+ ads? (
+ sys-libs/talloc
+ virtual/krb5
+ )
+ caps? ( sys-libs/libcap-ng )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="dev-python/docutils"
+PDEPEND="
+ acl? ( >=net-fs/samba-4.0.0_alpha1 )
+"
+
+REQUIRED_USE="
+ acl? ( ads )
+ python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+DOCS="doc/linux-cifs-client-guide.odt"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-6.12-ln_in_destdir.patch" #766594
+ "${FILESDIR}/${PN}-6.15-musl.patch"
+)
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
+ ewarn "You must enable CIFS support in your kernel config, "
+ ewarn "to be able to mount samba shares. You can find it at"
+ ewarn
+ ewarn " File systems"
+ ewarn " Network File Systems"
+ ewarn " CIFS support"
+ ewarn
+ ewarn "and recompile your kernel ..."
+ fi
+
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ if has_version app-crypt/heimdal ; then
+ # https://bugs.gentoo.org/612584
+ eapply "${FILESDIR}/${PN}-6.7-heimdal.patch"
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --enable-man
+ --enable-smbinfo
+ $(use_enable acl cifsacl cifsidmap)
+ $(use_enable ads cifsupcall)
+ $(use_with caps libcap)
+ $(use_enable creds cifscreds)
+ $(use_enable pam)
+ $(use_with pam pamdir $(getpam_mod_dir))
+ $(use_enable python pythontools)
+ # mount.cifs can get passwords from systemd
+ $(use_enable systemd)
+ )
+ ROOTSBINDIR="${EPREFIX}"/sbin \
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ # remove empty directories
+ find "${ED}" -type d -empty -delete || die
+
+ if use acl ; then
+ dodir /etc/cifs-utils
+ dosym ../../usr/$(get_libdir)/cifs-utils/idmapwb.so \
+ /etc/cifs-utils/idmap-plugin
+ dodir /etc/request-key.d
+ echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
+ > "${ED}/etc/request-key.d/cifs.idmap.conf"
+ fi
+
+ if use ads ; then
+ dodir /etc/request-key.d
+ echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
+ > "${ED}/etc/request-key.d/cifs.upcall.conf"
+ echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \
+ > "${ED}/etc/request-key.d/cifs.spnego.conf"
+ fi
+
+ dobashcomp bash-completion/smbinfo
+ python_fix_shebang "${ED}"
+}
+
+pkg_postinst() {
+ # Inform about set-user-ID bit of mount.cifs
+ ewarn "setuid use flag was dropped due to multiple security implications"
+ ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
+ ewarn "You are free to set setuid flags by yourself"
+
+ # Inform about upcall usage
+ if use acl ; then
+ einfo "The cifs.idmap utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
+ einfo "This enables you to get and set CIFS acls."
+ fi
+
+ if use ads ; then
+ einfo "The cifs.upcall utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
+ einfo "This enables you to mount DFS shares."
+ fi
+}
diff --git a/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch b/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch
new file mode 100644
index 000000000000..f17cc68bdaca
--- /dev/null
+++ b/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch
@@ -0,0 +1,80 @@
+https://marc.info/?l=linux-cifs&m=165604639613381&w=2
+
+From c267ecf6a1c2152e640897d30cc0e8f637a8ef76 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 24 Jun 2022 05:25:23 +0100
+Subject: [PATCH 1/2] getcifsacl, setcifsacl: add missing <linux/limits.h>
+ include for XATTR_SIZE_MAX
+
+Needed to build on musl. It only works on glibc because of transitive includes
+(which could break in future).
+
+Example failure:
+```
+getcifsacl.c: In function 'getcifsacl':
+getcifsacl.c:429:24: error: 'XATTR_SIZE_MAX' undeclared (first use in this function)
+ 429 | if (bufsize >= XATTR_SIZE_MAX) {
+ | ^~~~~~~~~~~~~~
+```
+
+Bug: https://bugs.gentoo.org/842195
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/getcifsacl.c
++++ b/getcifsacl.c
+@@ -34,6 +34,7 @@
+ #include <errno.h>
+ #include <limits.h>
+ #include <ctype.h>
++#include <linux/limits.h>
+ #include <sys/xattr.h>
+ #include "cifsacl.h"
+ #include "idmap_plugin.h"
+--- a/setcifsacl.c
++++ b/setcifsacl.c
+@@ -48,6 +48,7 @@
+ #include <errno.h>
+ #include <limits.h>
+ #include <ctype.h>
++#include <linux/limits.h>
+ #include <sys/xattr.h>
+
+ #include "cifsacl.h"
+From d1a36cc4caa541d1f0f9a3426a5202b680cf7ff8 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 24 Jun 2022 05:26:54 +0100
+Subject: [PATCH 2/2] getcifsacl, setcifsacl: add missing <endian.h> include
+ for le32toh
+
+Needed to fix build on musl libc. It only works by chance on glibc
+because of transitive includes (which could break at any time).
+
+Example failure:
+```
+getcifsacl.c: In function 'print_ace':
+getcifsacl.c:284:16: warning: implicit declaration of function 'le16toh' [-Wimplicit-function-declaration]
+ 284 | size = le16toh(pace->size);
+ | ^~~~~~~
+```
+
+Bug: https://bugs.gentoo.org/842195
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/getcifsacl.c
++++ b/getcifsacl.c
+@@ -23,6 +23,7 @@
+ #include "config.h"
+ #endif /* HAVE_CONFIG_H */
+
++#include <endian.h>
+ #include <string.h>
+ #include <getopt.h>
+ #include <stdint.h>
+--- a/setcifsacl.c
++++ b/setcifsacl.c
+@@ -38,6 +38,7 @@
+ #include "config.h"
+ #endif /* HAVE_CONFIG_H */
+
++#include <endian.h>
+ #include <string.h>
+ #include <getopt.h>
+ #include <stdint.h>