aboutsummaryrefslogtreecommitdiff
path: root/src/connection
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-04-16 15:29:29 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-04-16 15:29:29 -0700
commite2a3387cf777c5b190d70475e98ada83b9abbc4a (patch)
tree8e2018b8f38dedf0b849a0cfea588807ba0d63db /src/connection
parent09637e7c8918ce4d21bd7c703012baf792cc82b1 (diff)
downloadconsfigurator-e2a3387cf777c5b190d70475e98ada83b9abbc4a.tar.gz
drop plus signs & use underscores in C preprocessor constants
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection')
-rw-r--r--src/connection/chroot.lisp2
-rw-r--r--src/connection/linux-namespace.lisp20
2 files changed, 11 insertions, 11 deletions
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