Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] cifs-utils: fix libcap-ng usage
@ 2020-12-17  7:09 lane-brain
  2020-12-17 13:48 ` ericonr
  2020-12-17 13:48 ` [PR PATCH] [Closed]: " ericonr
  0 siblings, 2 replies; 3+ messages in thread
From: lane-brain @ 2020-12-17  7:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

There is a new pull request by lane-brain against master on the void-packages repository

https://github.com/lane-brain/void-packages cifs-utils-6.11_2
https://github.com/void-linux/void-packages/pull/27219

cifs-utils: fix libcap-ng usage
The new libcap-ng 0.8.2 recently committed to master breaks this package. I pulled the commit patch from the project repo and bumped the revision.

Refer to:
#27216

A patch file from https://github.com/void-linux/void-packages/pull/27219.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cifs-utils-6.11_2-27219.patch --]
[-- Type: text/x-diff, Size: 2837 bytes --]

From 03e1da55c25bc93cca0d67f83a09a2b193d56c26 Mon Sep 17 00:00:00 2001
From: lane-brain <lane@mailbox.org>
Date: Thu, 17 Dec 2020 01:58:12 -0500
Subject: [PATCH] libcap-ng patch fix for cifs-utils 6.11

---
 .../cifs-utils/patches/libcap-ng-fix.patch    | 47 +++++++++++++++++++
 srcpkgs/cifs-utils/template                   |  2 +-
 2 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/cifs-utils/patches/libcap-ng-fix.patch

diff --git a/srcpkgs/cifs-utils/patches/libcap-ng-fix.patch b/srcpkgs/cifs-utils/patches/libcap-ng-fix.patch
new file mode 100644
index 00000000000..6b6604ad1cb
--- /dev/null
+++ b/srcpkgs/cifs-utils/patches/libcap-ng-fix.patch
@@ -0,0 +1,47 @@
+From fcef79bc705b70862326e1394dfe77295086bcbb Mon Sep 17 00:00:00 2001
+From: Jonas Witschel <diabonas@archlinux.org>
+Date: Sat, 21 Nov 2020 12:11:44 +0100
+Subject: [PATCH] mount.cifs: update the cap bounding set only when CAP_SETPCAP
+ is given
+
+libcap-ng 0.8.1 tightened the error checking on capng_apply, returning an error
+of -4 when trying to update the capability bounding set without having the
+CAP_SETPCAP capability to be able to do so. Previous versions of libcap-ng
+silently skipped updating the bounding set and only updated the normal
+CAPNG_SELECT_CAPS capabilities instead.
+
+Check beforehand whether we have CAP_SETPCAP, in which case we can use
+CAPNG_SELECT_BOTH to update both the normal capabilities and the bounding set.
+Otherwise, we can at least update the normal capabilities, but refrain from
+trying to update the bounding set to avoid getting an error.
+
+Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
+---
+ mount.cifs.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git mount.cifs.c mount.cifs.c
+index 81bdbc8..2474e98 100644
+--- mount.cifs.c
++++ mount.cifs.c
+@@ -347,6 +347,8 @@ static int set_password(struct parsed_mount_info *parsed_info, const char *src)
+ static int
+ drop_capabilities(int parent)
+ {
++	capng_select_t set = CAPNG_SELECT_CAPS;
++
+ 	capng_setpid(getpid());
+ 	capng_clear(CAPNG_SELECT_BOTH);
+ 	if (parent) {
+@@ -364,7 +366,10 @@ drop_capabilities(int parent)
+ 			return EX_SYSERR;
+ 		}
+ 	}
+-	if (capng_apply(CAPNG_SELECT_BOTH)) {
++	if (capng_have_capability(CAPNG_EFFECTIVE, CAP_SETPCAP)) {
++		set = CAPNG_SELECT_BOTH;
++	}
++	if (capng_apply(set)) {
+ 		fprintf(stderr, "Unable to apply new capability set.\n");
+ 		return EX_SYSERR;
+ 	}
diff --git a/srcpkgs/cifs-utils/template b/srcpkgs/cifs-utils/template
index 6ca4f30db5d..6a2340931bc 100644
--- a/srcpkgs/cifs-utils/template
+++ b/srcpkgs/cifs-utils/template
@@ -1,7 +1,7 @@
 # Template file for 'cifs-utils'
 pkgname=cifs-utils
 version=6.11
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-systemd"
 make_install_args="ROOTSBINDIR=/usr/bin"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cifs-utils: fix libcap-ng usage
  2020-12-17  7:09 [PR PATCH] cifs-utils: fix libcap-ng usage lane-brain
@ 2020-12-17 13:48 ` ericonr
  2020-12-17 13:48 ` [PR PATCH] [Closed]: " ericonr
  1 sibling, 0 replies; 3+ messages in thread
From: ericonr @ 2020-12-17 13:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/27219#issuecomment-747449274

Comment:
Superseded by https://github.com/void-linux/void-packages/pull/27227

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PR PATCH] [Closed]: cifs-utils: fix libcap-ng usage
  2020-12-17  7:09 [PR PATCH] cifs-utils: fix libcap-ng usage lane-brain
  2020-12-17 13:48 ` ericonr
@ 2020-12-17 13:48 ` ericonr
  1 sibling, 0 replies; 3+ messages in thread
From: ericonr @ 2020-12-17 13:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

There's a closed pull request on the void-packages repository

cifs-utils: fix libcap-ng usage
https://github.com/void-linux/void-packages/pull/27219

Description:
The new libcap-ng 0.8.2 recently committed to master breaks this package. I pulled the commit patch from the project repo and bumped the revision.

Refer to:
#27216

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-17 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17  7:09 [PR PATCH] cifs-utils: fix libcap-ng usage lane-brain
2020-12-17 13:48 ` ericonr
2020-12-17 13:48 ` [PR PATCH] [Closed]: " ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).