An open API service indexing awesome lists of open source software.

https://github.com/oelin/is-chroot

Check whether the current process is running inside a chroot.
https://github.com/oelin/is-chroot

chroot ext2 ext3 ext4 linux

Last synced: 7 months ago
JSON representation

Check whether the current process is running inside a chroot.

Awesome Lists containing this project

README

          

# is-chroot

Check whether the current process is running inside a chroot. Currently only supports ext2, ext3 and ext4 file systems.

## Installation

```sh
npm i is-chroot
```

## Usage

```js
import isChroot from 'is-chroot'

isChroot()
```

Behind the scenes `isChroot()` checks whether the inode of `/` is exactly `2`. If this isn't the case and the file system is ext2, ext3 or ext4 then it's likely that the current process is running inside a chroot. Please note that this is [only a heuristic](https://stackoverflow.com/questions/75182/detecting-a-chroot-jail-from-within) and can be improved by considering additional factors.