summaryrefslogtreecommitdiff
path: root/gnu/system/privilege.scm
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2022-06-05 02:00:00 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2024-08-11 02:00:00 +0200
commit39471f2627bd63df0e9af02a46e5dda60e233ffc (patch)
tree0890fa3d313cad97eae7a3aebf93e973a8f44fdf /gnu/system/privilege.scm
parent902b15b24d6ea2a1e255b88dff7670e8a95cb9a9 (diff)
system: Add (gnu system privilege).
* gnu/system/privilege.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
Diffstat (limited to 'gnu/system/privilege.scm')
-rw-r--r--gnu/system/privilege.scm54
1 files changed, 54 insertions, 0 deletions
diff --git a/gnu/system/privilege.scm b/gnu/system/privilege.scm
new file mode 100644
index 00000000000..455a659a125
--- /dev/null
+++ b/gnu/system/privilege.scm
@@ -0,0 +1,54 @@
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
3;;; Copyright © 2022 Tobias Geerinckx-Rice <me@tobias.gr>
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu system privilege)
21 #:use-module (guix records)
22 #:export (privileged-program
23 privileged-program?
24 privileged-program-program
25 privileged-program-setuid?
26 privileged-program-setgid?
27 privileged-program-user
28 privileged-program-group))
29
30;;; Commentary:
31;;;
32;;; Data structures representing privileged programs: binaries with additional
33;;; permissions such as setuid/setgid. This is meant to be used both on the
34;;; host side and at run time--e.g., in activation snippets.
35;;;
36;;; Code:
37
38(define-record-type* <privileged-program>
39 privileged-program make-privileged-program
40 privileged-program?
41 ;; File name of the program to assign elevated privileges.
42 (program privileged-program-program) ;file-like
43 ;; Whether to set the setuid (‘set user ID’) bit.
44 (setuid? privileged-program-setuid? ;boolean
45 (default #f))
46 ;; Whether to set the setgid (‘set group ID’) bit.
47 (setgid? privileged-program-setgid? ;boolean
48 (default #f))
49 ;; The user name or ID this should be set to (defaults to root's).
50 (user privileged-program-user ;integer or string
51 (default 0))
52 ;; The group name or ID we want to set this to (defaults to root's).
53 (group privileged-program-group ;integer or string
54 (default 0)))