diff options
author | Narrat | 2021-08-02 17:26:26 +0200 |
---|---|---|
committer | Narrat | 2021-08-02 17:26:26 +0200 |
commit | 010f678c9a4e307922da4fd600b330819646c3c2 (patch) | |
tree | 042dfcca4377e8ed6ee6226e2af8c0118969f7c5 | |
parent | 9e7d5c4606b7f3c0b0ec22b0d579334a9d1ff0ca (diff) | |
download | aur-010f678c9a4e307922da4fd600b330819646c3c2.tar.gz |
util-linux-aes: Follow Arch
There are two breaking changes with 2.37.1, for which patches got added.
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 0001-sulogin-fix-getpasswd.patch | 23 | ||||
-rw-r--r-- | 0002-libmount-fix-setgroups-use.patch | 38 | ||||
-rwxr-xr-x | PKGBUILD | 10 |
4 files changed, 75 insertions, 2 deletions
@@ -1,7 +1,7 @@ pkgbase = util-linux-aes pkgdesc = Miscellaneous system utilities for Linux, with loop-AES support pkgver = 2.37.1 - pkgrel = 1 + pkgrel = 3 url = https://github.com/karelzak/util-linux install = util-linux-aes.install arch = x86_64 @@ -18,6 +18,8 @@ pkgbase = util-linux-aes source = http://loop-aes.sourceforge.net/updates/util-linux-2.37-20210620.diff.bz2 source = http://loop-aes.sourceforge.net/updates/util-linux-2.37-20210620.diff.bz2.sign source = util-linux-aes.modules + source = 0001-sulogin-fix-getpasswd.patch + source = 0002-libmount-fix-setgroups-use.patch source = pam-login source = pam-common source = pam-runuser @@ -33,6 +35,8 @@ pkgbase = util-linux-aes sha256sums = 0a78ea9a05191b1ddaeedc8c8d8ae053f9ed4e7cd2f39ef4b3bc356e552c98a2 sha256sums = SKIP sha256sums = 560ca858961eb997a216ce6b419d900e84688591abf4584ef30c9323ba06fffd + sha256sums = 00d526cfaca8979e433c7379c634cf14e700322f0ed0c5a7996af1c900147268 + sha256sums = 56fbc491b999aa18113237f28d399045a6d66678353b3619ab8da2f8518d2a4d sha256sums = 99cd77f21ee44a0c5e57b0f3670f711a00496f198fc5704d7e44f5d817c81a0f sha256sums = 57e057758944f4557762c6def939410c04ca5803cbdd2bfa2153ce47ffe7a4af sha256sums = 48d6fba767631e3dd3620cf02a71a74c5d65a525d4c4ce4b5a0b7d9f41ebfea1 diff --git a/0001-sulogin-fix-getpasswd.patch b/0001-sulogin-fix-getpasswd.patch new file mode 100644 index 000000000000..ef6f5f4b21d0 --- /dev/null +++ b/0001-sulogin-fix-getpasswd.patch @@ -0,0 +1,23 @@ +From 3c466f7c353beb3076a2be8fb2931b9951430128 Mon Sep 17 00:00:00 2001 +From: Karel Zak <kzak@redhat.com> +Date: Thu, 29 Jul 2021 21:28:00 +0200 +Subject: [PATCH] sulogin: fix getpasswd() + +Fixes: https://github.com/karelzak/util-linux/issues/1400 +Signed-off-by: Karel Zak <kzak@redhat.com> +--- + login-utils/sulogin.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c +index 3016ef483..4d48943ad 100644 +--- a/login-utils/sulogin.c ++++ b/login-utils/sulogin.c +@@ -621,6 +621,7 @@ static char *getpasswd(struct console *con) + cp = &con->cp; + tty = con->tio; + ++ ret = pass; + tty.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY); + tty.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP|ISIG); + tc = (tcsetattr(fd, TCSAFLUSH, &tty) == 0); diff --git a/0002-libmount-fix-setgroups-use.patch b/0002-libmount-fix-setgroups-use.patch new file mode 100644 index 000000000000..ebde207986b9 --- /dev/null +++ b/0002-libmount-fix-setgroups-use.patch @@ -0,0 +1,38 @@ +From 420e914c4cc4c2ba34fd75790ea194d7f4a47d2c Mon Sep 17 00:00:00 2001 +From: Karel Zak <kzak@redhat.com> +Date: Thu, 29 Jul 2021 11:50:48 +0200 +Subject: [PATCH] libmount: fix setgroups() use + +* keep process in single supplementary group, which is the real group ID for the process + +* make sure we have rights to call setgroups(), requires group permissions + +Fixes: https://github.com/karelzak/util-linux/issues/1398 +Signed-off-by: Karel Zak <kzak@redhat.com> +--- + include/c.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/include/c.h b/include/c.h +index c1e4c5ffc..a4504e3ba 100644 +--- a/include/c.h ++++ b/include/c.h +@@ -340,14 +340,16 @@ static inline size_t get_hostname_max(void) + + static inline int drop_permissions(void) + { ++ gid_t newgid = getgid(); ++ + errno = 0; + + /* drop supplementary groups */ +- if (setgroups(0, NULL) != 0) ++ if (geteuid() == 0 && setgroups(1, &newgid) != 0) + goto fail; + + /* drop GID */ +- if (setgid(getgid()) < 0) ++ if (setgid(newgid) < 0) + goto fail; + + /* drop UID */ @@ -11,7 +11,7 @@ pkgname=(util-linux-aes util-linux-libs-aes) _pkgmajor=2.37 _realver=${_pkgmajor}.1 pkgver=${_realver/-/} -pkgrel=1 +pkgrel=3 pkgdesc='Miscellaneous system utilities for Linux, with loop-AES support' url='https://github.com/karelzak/util-linux' #url="http://sourceforge.net/projects/loop-aes/" @@ -26,6 +26,8 @@ source=("https://www.kernel.org/pub/linux/utils/util-linux/v$_pkgmajor/${_basena #"${_basename}-${pkgver}.diff" http://loop-aes.sourceforge.net/updates/${_basename}-${_pkgmajor}-20210620.diff.bz2{,.sign} "${pkgname}.modules" + '0001-sulogin-fix-getpasswd.patch' + '0002-libmount-fix-setgroups-use.patch' pam-{login,common,runuser,su} 'util-linux-aes.sysusers' '60-rfkill.rules' @@ -36,6 +38,8 @@ sha256sums=('8e4bd42053b726cf86eb4d13a73bc1d9225a2c2e1a2e0d2a891f1020f83e6b76' '0a78ea9a05191b1ddaeedc8c8d8ae053f9ed4e7cd2f39ef4b3bc356e552c98a2' 'SKIP' '560ca858961eb997a216ce6b419d900e84688591abf4584ef30c9323ba06fffd' + '00d526cfaca8979e433c7379c634cf14e700322f0ed0c5a7996af1c900147268' + '56fbc491b999aa18113237f28d399045a6d66678353b3619ab8da2f8518d2a4d' '99cd77f21ee44a0c5e57b0f3670f711a00496f198fc5704d7e44f5d817c81a0f' '57e057758944f4557762c6def939410c04ca5803cbdd2bfa2153ce47ffe7a4af' '48d6fba767631e3dd3620cf02a71a74c5d65a525d4c4ce4b5a0b7d9f41ebfea1' @@ -47,6 +51,10 @@ sha256sums=('8e4bd42053b726cf86eb4d13a73bc1d9225a2c2e1a2e0d2a891f1020f83e6b76' prepare() { cd "$_basename-$pkgver" + + patch -Np1 < ../0001-sulogin-fix-getpasswd.patch + patch -Np1 < ../0002-libmount-fix-setgroups-use.patch + #patch -Np1 -i "../${_basename}-${pkgver}.diff" patch -Np1 -i "../${_basename}-${_pkgmajor}-20210620.diff" autoreconf -i |