diff options
author | Rob Pierce <rob@cvs.openbsd.org> | 2022-02-15 23:16:01 +0000 |
---|---|---|
committer | Rob Pierce <rob@cvs.openbsd.org> | 2022-02-15 23:16:01 +0000 |
commit | 578221498a85cb3daba50e1815422dcd6de34679 (patch) | |
tree | 0d026764b6f8eb70367fbc8c1cc91d08f40b9771 /sys | |
parent | 376f2de13ec73b735663ba9764e7846d4030212e (diff) |
Reintroduce ps state flag 'c' indicating chrooted process (via PS_BITS).
Ok deraat@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 3 | ||||
-rw-r--r-- | sys/sys/proc.h | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 3f7403980d0..bfce966733e 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.354 2021/12/23 18:50:31 guenther Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.355 2022/02/15 23:16:00 rob Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -829,6 +829,7 @@ sys_chroot(struct proc *p, void *v, register_t *retval) vrele(old_cdir); } else fdp->fd_rdir = nd.ni_vp; + p->p_p->ps_flags |= PS_CHROOT; return (0); } diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 2ebe71d1728..ce1c451bbcd 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.325 2022/02/07 19:28:14 rob Exp $ */ +/* $OpenBSD: proc.h,v 1.326 2022/02/15 23:16:00 rob Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -277,6 +277,7 @@ struct process { #define PS_WXNEEDED 0x00200000 /* Process allowed to violate W^X */ #define PS_EXECPLEDGE 0x00400000 /* Has exec pledges */ #define PS_ORPHAN 0x00800000 /* Process is on an orphan list */ +#define PS_CHROOT 0x01000000 /* Process is chrooted */ #define PS_BITS \ ("\20" "\01CONTROLT" "\02EXEC" "\03INEXEC" "\04EXITING" "\05SUGID" \ @@ -284,7 +285,7 @@ struct process { "\013WAITED" "\014COREDUMP" "\015SINGLEEXIT" "\016SINGLEUNWIND" \ "\017NOZOMBIE" "\020STOPPED" "\021SYSTEM" "\022EMBRYO" "\023ZOMBIE" \ "\024NOBROADCASTKILL" "\025PLEDGE" "\026WXNEEDED" "\027EXECPLEDGE" \ - "\030ORPHAN") + "\030ORPHAN" "\031CHROOT") struct kcov_dev; |