From: balejk <balejk@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] cdrtools: set capabilities
Date: Wed, 22 Jun 2022 16:09:52 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-37640@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]
There is a new pull request by balejk against master on the void-packages repository
https://github.com/balejk/void-packages cdrtools
https://github.com/void-linux/void-packages/pull/37640
cdrtools: set capabilities
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
---
Some programs of the `cdrtools` suite require certain special privileges to function properly - installing the `cdrtools` package from the Void repository, I'm not able to use for instance the `cdrecord` command obtaining "insufficient privileges" errors. It makes sense to me that it should be possible to use these commands as a normal user without requiring root access.
To achieve this without having to make the respective binaries SUID, [it is recommended](http://cdrtools.sourceforge.net/private/cdrecord.html) to make use of Linux capabilities. I have used the settings published in the [release notes](https://sourceforge.net/projects/cdrtools/files/AN-3.01/view) of `cdrtools` which is also what [Arch Linux does](https://github.com/archlinux/svntogit-community/blob/packages/cdrtools/trunk/cdrtools.install). The programs should be capabilities-aware and should drop the relevant privileges as soon as they are not needed anymore - some relevant discussion can be found [here](https://bugs.archlinux.org/task/67265) and [here](https://bugzilla.opensuse.org/show_bug.cgi?id=550021).
A patch file from https://github.com/void-linux/void-packages/pull/37640.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cdrtools-37640.patch --]
[-- Type: text/x-diff, Size: 1536 bytes --]
From 8b35c047f02f345f798af7432c0548df3c1bd09a Mon Sep 17 00:00:00 2001
From: Karel Balej <balejk@matfyz.cz>
Date: Wed, 22 Jun 2022 15:24:59 +0200
Subject: [PATCH] cdrtools: set capabilities
---
srcpkgs/cdrtools/INSTALL | 6 ++++++
srcpkgs/cdrtools/template | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/cdrtools/INSTALL
diff --git a/srcpkgs/cdrtools/INSTALL b/srcpkgs/cdrtools/INSTALL
new file mode 100644
index 000000000000..daf6dc6478e2
--- /dev/null
+++ b/srcpkgs/cdrtools/INSTALL
@@ -0,0 +1,6 @@
+if [ "$ACTION" = "post" ]
+then
+ setcap cap_sys_resource,cap_dac_override,cap_sys_admin,cap_sys_nice,cap_net_bind_service,cap_ipc_lock,cap_sys_rawio+ep /usr/bin/cdrecord
+ setcap cap_dac_override,cap_sys_admin,cap_sys_nice,cap_net_bind_service,cap_sys_rawio+ep /usr/bin/cdda2wav
+ setcap cap_dac_override,cap_sys_admin,cap_net_bind_service,cap_sys_rawio+ep /usr/bin/readcd
+fi
diff --git a/srcpkgs/cdrtools/template b/srcpkgs/cdrtools/template
index 65888a46906e..3f13179a8f00 100644
--- a/srcpkgs/cdrtools/template
+++ b/srcpkgs/cdrtools/template
@@ -1,11 +1,12 @@
# Template file for 'cdrtools'
pkgname=cdrtools
version=3.02a09
-revision=2
+revision=3
wrksrc="${pkgname}-${version%a*}"
build_helper=qemu
hostmakedepends="smake"
makedepends="acl-devel libcap-devel e2fsprogs-devel"
+depends="libcap-progs"
conf_files="/etc/default/rscsi /etc/default/cdrecord"
short_desc="Highly portable CD/DVD/BluRay command line recording software"
maintainer="Orphaned <orphan@voidlinux.org>"
next reply other threads:[~2022-06-22 14:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 14:09 balejk [this message]
2022-06-24 4:11 ` [PR PATCH] [Merged]: " sgn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-37640@inbox.vuxu.org \
--to=balejk@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).