Remove unused direct privileged helper APIs

This commit is contained in:
2026-04-13 16:47:07 +02:00
parent ca2276d8cc
commit 31d601b994
-52
View File
@@ -34,14 +34,8 @@
path-basename
read-lines
run-command
run-privileged-command
run-privileged-shell-command
privileged-command-output
default-assembly-privileged-policy
assembly-privileged-policy-allows-install-target-kind?
run-assembly-privileged-command
run-assembly-privileged-shell-command
assembly-privileged-command-output
run-assembly-privileged-script
store-reference-closure
copy-store-items-into-rootfs
@@ -295,31 +289,6 @@
(define (shell-quote text)
(string-append "'" (string-replace-all text "'" "'\"'\"'") "'"))
(define (command->shell-fragment program args)
(string-join (map shell-quote (cons program args)) " "))
(define (privileged-command-prefix)
(or (getenv "FRUIX_PRIVILEGED_COMMAND")
"sudo -n"))
(define (run-privileged-command program . args)
(run-command "sh" "-c"
(string-append (privileged-command-prefix)
" "
(command->shell-fragment program args))))
(define (run-privileged-shell-command command)
(run-command "sh" "-c"
(string-append (privileged-command-prefix)
" sh -c "
(shell-quote command))))
(define (privileged-command-output program . args)
(command-output "sh" "-c"
(string-append (privileged-command-prefix)
" "
(command->shell-fragment program args))))
(define assembly-privileged-policy-version "1")
(define assembly-privileged-policy-name "assembly")
(define assembly-privileged-policy-operations
@@ -384,27 +353,6 @@
(unless (assembly-privileged-policy-allows-operation? policy operation)
(error "assembly privileged policy forbids operation" operation policy)))
(define (run-assembly-privileged-command policy operation program . args)
(ensure-assembly-privileged-policy-allows-operation policy operation)
(run-command "sh" "-c"
(string-append (assembly-privileged-policy-command-prefix policy)
" "
(command->shell-fragment program args))))
(define (run-assembly-privileged-shell-command policy operation command)
(ensure-assembly-privileged-policy-allows-operation policy operation)
(run-command "sh" "-c"
(string-append (assembly-privileged-policy-command-prefix policy)
" sh -c "
(shell-quote command))))
(define (assembly-privileged-command-output policy operation program . args)
(ensure-assembly-privileged-policy-allows-operation policy operation)
(command-output "sh" "-c"
(string-append (assembly-privileged-policy-command-prefix policy)
" "
(command->shell-fragment program args))))
(define assembly-privileged-script-metadata-version "1")
(define* (assembly-privileged-script-metadata policy name operations script)