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.
- Host: GitHub
- URL: https://github.com/oelin/is-chroot
- Owner: oelin
- License: mit
- Created: 2023-02-04T10:04:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-04T10:05:14.000Z (over 2 years ago)
- Last Synced: 2025-02-22T00:38:04.584Z (8 months ago)
- Topics: chroot, ext2, ext3, ext4, linux
- Language: JavaScript
- Homepage: https://npmjs.com/is-chroot
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.