git: jail: Implement read-only sysctl "jail.jailed"

Aaron LI aly at
Mon Jun 17 18:52:40 PDT 2019

commit 4e558034a6febf3a5bba02db3c73eca402cd4d98
Author: Aaron LI <aly at>
Date:   Mon Jun 17 22:05:41 2019 +0800

    jail: Implement read-only sysctl "jail.jailed"
    Implement the read-only sysctl entry 'jail.jailed', which can be used to
    determine if a process is running inside a jail (value is 1) or not
    (value is 0).
    NOTE: The current FreeBSD has such a sysctl entry called
    'security.jail.jailed'.  However, DragonFly BSD doesn't not have any
    'security.jail.*' but only 'jail.*' sysctl entries.
    Meanwhile, update /etc/rc to use this new sysctl entry to better deal
    with the rc scripts with the 'nojail' keyword.
    Also document this sysctl entry in the jail.8 man page.
    This commit is based mostly on FreeBSD as well as the patch in bug
    report #118.
    Reviewed-by: dillon, mjg (Mateusz Guzik)
    Bug-report: #118

Summary of changes:
 etc/rc               |  7 ++++++-
 sys/kern/kern_jail.c | 15 +++++++++++++++
 usr.sbin/jail/jail.8 |  5 ++++-
 3 files changed, 25 insertions(+), 2 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list