Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 1
    On what filesystems does this heuristic work? Commented Nov 9, 2011 at 11:36
  • Tested on ext3 and hfs. Commented Nov 9, 2011 at 11:52
  • So I was fooling around, and I think I've found a more reliable method that doesn't require root permissions (Linux only). I'm still open to counter-examples or more portable methods. Commented Nov 9, 2011 at 19:15
  • 6
    This is true for ext[234], but not of all filesystems. It also only tests that your root is the root of the filesystem, which may not be mounted as the real root. In other words, if you mount another partition in /jail and chroot /jail, then it will look like the real root to this test. Commented Nov 9, 2011 at 19:26
  • 1
    @AdamKatz Apparently not. Tested in openbsd 6.0-stable, the inode number is still 2 for the actual root path while it's a random number for the chroot. Commented Sep 16, 2016 at 3:11