aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-06-25 09:05:06 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-06-25 11:48:43 -0700
commit600df5068c5f49a102b74468a4e8d55152e8e1e6 (patch)
tree1812266d9b5d0d5be4971d39aac9fe7bee18664d
parent499a06d9920dddae517eabb7bc343ae211d1d309 (diff)
downloadconsfigurator-600df5068c5f49a102b74468a4e8d55152e8e1e6.tar.gz
'SETNS POST-FORK: use MAPL, hopefully in favour of readability
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/connection/linux-namespace.lisp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/connection/linux-namespace.lisp b/src/connection/linux-namespace.lisp
index a17b4e4..71a34db 100644
--- a/src/connection/linux-namespace.lisp
+++ b/src/connection/linux-namespace.lisp
@@ -301,12 +301,13 @@ setgroups(2) is denied in the namespace."
;; errors only of type EPERM, and see below about EPERM in the
;; second pass.
(when setuserns
- (loop for cell on (cdr ns-fds)
- do (handler-case (setns (caar cell) (cdar cell))
- (nix:eperm ())
- (:no-error (&rest ignore)
- (declare (ignore ignore))
- (rplaca (car cell) nil)))))
+ (mapl (lambda (ns-fds)
+ (handler-case (setns (caar ns-fds) (cdar ns-fds))
+ (nix:eperm ())
+ (:no-error (&rest ignore)
+ (declare (ignore ignore))
+ (rplaca (car ns-fds) nil))))
+ (cdr ns-fds)))
(loop for (fd . type) in ns-fds
;; Accept failures due to insufficient capabilities which
;; occur after we've entered the new userns, as that