From e2a3387cf777c5b190d70475e98ada83b9abbc4a Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 16 Apr 2022 15:29:29 -0700 Subject: drop plus signs & use underscores in C preprocessor constants Signed-off-by: Sean Whitton --- src/connection/chroot.lisp | 2 +- src/connection/linux-namespace.lisp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/connection') diff --git a/src/connection/chroot.lisp b/src/connection/chroot.lisp index e40d7ca..80c79cb 100644 --- a/src/connection/chroot.lisp +++ b/src/connection/chroot.lisp @@ -120,7 +120,7 @@ should be the mount point, without the chroot's root prefixed.") (defmethod post-fork ((connection chroot.fork-connection)) (with-slots (into) connection #+linux - (progn (unshare +CLONE_NEWNS+) + (progn (unshare CLONE_NEWNS) (mrun "mount" "--make-rslave" (stripln (run "findmnt" "-nro" "TARGET" "-T" into))) (linux-chroot-mounts connection)) diff --git a/src/connection/linux-namespace.lisp b/src/connection/linux-namespace.lisp index 7693330..2924f2e 100644 --- a/src/connection/linux-namespace.lisp +++ b/src/connection/linux-namespace.lisp @@ -236,15 +236,15 @@ setgroups(2) is denied in the namespace." (linux-namespace-connection init-hooks-connection) ()) #+linux -(define-constant +namespace-types+ `(("user" . ,+CLONE_NEWUSER+) - ("cgroup" . ,+CLONE_NEWCGROUP+) - ("ipc" . ,+CLONE_NEWIPC+) - ("uts" . ,+CLONE_NEWUTS+) - ("net" . ,+CLONE_NEWNET+) - ("pid" . ,+CLONE_NEWPID+) - ("mnt" . ,+CLONE_NEWNS+) - ,@(and (boundp '+CLONE_NEWTIME+) - `(("time" . ,+CLONE_NEWTIME+)))) +(define-constant +namespace-types+ `(("user" . ,CLONE_NEWUSER) + ("cgroup" . ,CLONE_NEWCGROUP) + ("ipc" . ,CLONE_NEWIPC) + ("uts" . ,CLONE_NEWUTS) + ("net" . ,CLONE_NEWNET) + ("pid" . ,CLONE_NEWPID) + ("mnt" . ,CLONE_NEWNS) + ,@(and (boundp 'CLONE_NEWTIME) + `(("time" . ,CLONE_NEWTIME)))) :test #'equal) (define-error-retval-cfun () "setns" :int (fd :int) (type :int)) @@ -311,7 +311,7 @@ setgroups(2) is denied in the namespace." ;; indicates that the namespace we tried to join belongs ;; to a parent userns, in which case if we were ever ;; going to join it would have to have been on 1st pass. - if (and fd setuserns (not (eql type +CLONE_NEWUSER+))) + if (and fd setuserns (not (eql type CLONE_NEWUSER))) do (handler-case (setns fd type) (nix:eperm ())) else if fd do (setns fd type)) ;; If we entered new PID or time namespaces then need to fork -- cgit v1.2.3