summaryrefslogtreecommitdiff
path: root/gnu/system
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/privilege.scm10
-rw-r--r--gnu/system/setuid.scm8
2 files changed, 11 insertions, 7 deletions
diff --git a/gnu/system/privilege.scm b/gnu/system/privilege.scm
index d89d5d5d1c3..fe6e60ad7c4 100644
--- a/gnu/system/privilege.scm
+++ b/gnu/system/privilege.scm
@@ -26,7 +26,9 @@
privileged-program-setgid?
privileged-program-user
privileged-program-group
- privileged-program-capabilities))
+ privileged-program-capabilities
+
+ file-like->setuid-program))
;;; Commentary:
;;;
@@ -56,3 +58,9 @@
;; POSIX capabilities in cap_from_text(3) form (defaults to #f: none).
(capabilities privileged-program-capabilities ;string or #f
(default #f)))
+
+(define (file-like->setuid-program program)
+ "Simple wrapper to facilitate MAPping over a list of file-like objects and
+make them setuid, a pattern just common enough to justify a special helper."
+ (privileged-program (program program)
+ (setuid? #t)))
diff --git a/gnu/system/setuid.scm b/gnu/system/setuid.scm
index 4dd0cc89624..097797ce8d7 100644
--- a/gnu/system/setuid.scm
+++ b/gnu/system/setuid.scm
@@ -21,15 +21,14 @@
#:use-module (gnu system privilege)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
+ #:re-export (file-like->setuid-program)
#:export (setuid-program
setuid-program?
setuid-program-program
setuid-program-setuid?
setuid-program-setgid?
setuid-program-user
- setuid-program-group
-
- file-like->setuid-program))
+ setuid-program-group))
;;; Commentary:
;;;
@@ -56,6 +55,3 @@
(define setuid-program-setgid? privileged-program-setgid?)
(define setuid-program-user privileged-program-user)
(define setuid-program-group privileged-program-group)
-
-(define (file-like->setuid-program program)
- (setuid-program (program program)))