Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jul 2019 17:43:26 -0700
From:      Yuri <yuri@rawbw.com>
To:        Freebsd hackers list <freebsd-hackers@FreeBSD.org>
Subject:   What is the best way for the process to determine that it runs in jail?
Message-ID:  <bafb7230-6e18-39d6-3ba4-ec3f7fac1cb1@rawbw.com>

next in thread | raw e-mail | index | archive | help
I found online that it is possible to stat the root folder and find its 
inode number.

The inode number is 2 when the root is on UFS, and 4 if the root is on ZFS.

This looks pretty hackish to me. Is this reliable?

Is there a better/best way?


Thank you,

Yuri





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bafb7230-6e18-39d6-3ba4-ec3f7fac1cb1>