From 600df5068c5f49a102b74468a4e8d55152e8e1e6 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 25 Jun 2022 09:05:06 -0700 Subject: 'SETNS POST-FORK: use MAPL, hopefully in favour of readability Signed-off-by: Sean Whitton --- src/connection/linux-namespace.lisp | 13 +++++++------ 1 file 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 -- cgit v1.2.3