diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2023-07-23 02:00:00 +0200 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2024-08-11 02:00:00 +0200 |
| commit | 71f0676a295841e2cc662eec0d3e9b7e69726035 (patch) | |
| tree | a39d569981af5fbe9b19634a935c536709698915 /gnu/system | |
| parent | 4e58dfee6c7456d1e662f66041b8a157efe8710a (diff) | |
privilege: Add POSIX capabilities(7) support.
* gnu/system/privilege.scm (<privileged-program>): Add a field
representing the program's POSIX capabilities.
(privileged-program-capabilities): New public procedure.
* doc/guix.texi (Privileged Programs): Document it.
* gnu/build/activation.scm (activate-privileged-programs): Take a LIBCAP
package argument providing setcap(8) to apply said capabilities.
* gnu/services.scm (privileged-program->activation-gexp): Pass said
package argument where supported. Include privileged-program-capabilities
in the compatibility hack.
Diffstat (limited to 'gnu/system')
| -rw-r--r-- | gnu/system/privilege.scm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gnu/system/privilege.scm b/gnu/system/privilege.scm index 455a659a125..d89d5d5d1c3 100644 --- a/gnu/system/privilege.scm +++ b/gnu/system/privilege.scm | |||
| @@ -25,13 +25,14 @@ | |||
| 25 | privileged-program-setuid? | 25 | privileged-program-setuid? |
| 26 | privileged-program-setgid? | 26 | privileged-program-setgid? |
| 27 | privileged-program-user | 27 | privileged-program-user |
| 28 | privileged-program-group)) | 28 | privileged-program-group |
| 29 | privileged-program-capabilities)) | ||
| 29 | 30 | ||
| 30 | ;;; Commentary: | 31 | ;;; Commentary: |
| 31 | ;;; | 32 | ;;; |
| 32 | ;;; Data structures representing privileged programs: binaries with additional | 33 | ;;; Data structures representing privileged programs: binaries with additional |
| 33 | ;;; permissions such as setuid/setgid. This is meant to be used both on the | 34 | ;;; permissions such as setuid/setgid, or POSIX capabilities. This is meant to |
| 34 | ;;; host side and at run time--e.g., in activation snippets. | 35 | ;;; be used both on the host side and at run time--e.g., in activation snippets. |
| 35 | ;;; | 36 | ;;; |
| 36 | ;;; Code: | 37 | ;;; Code: |
| 37 | 38 | ||
| @@ -51,4 +52,7 @@ | |||
| 51 | (default 0)) | 52 | (default 0)) |
| 52 | ;; The group name or ID we want to set this to (defaults to root's). | 53 | ;; The group name or ID we want to set this to (defaults to root's). |
| 53 | (group privileged-program-group ;integer or string | 54 | (group privileged-program-group ;integer or string |
| 54 | (default 0))) | 55 | (default 0)) |
| 56 | ;; POSIX capabilities in cap_from_text(3) form (defaults to #f: none). | ||
| 57 | (capabilities privileged-program-capabilities ;string or #f | ||
| 58 | (default #f))) | ||
