mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:28:13 +00:00
Kernel+Userland: Remove chroot functionality
We are not using this for anything and it's just been sitting there gathering dust for well over a year, so let's stop carrying all this complexity around for no good reason.
This commit is contained in:
parent
96d5d017b7
commit
1b739a72c2
19 changed files with 3 additions and 289 deletions
|
@ -1,33 +0,0 @@
|
|||
## Name
|
||||
|
||||
chroot, chroot\_with\_mount\_flags - change filesystem root
|
||||
|
||||
## Synopsis
|
||||
|
||||
```**c++
|
||||
#include <unistd.h>
|
||||
|
||||
int chroot(const char* path);
|
||||
int chroot_with_mount_flags(const char* path, int mount_flags);
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
`chroot()` changes the filesystem root of the current process to a new directory specified by `path`.
|
||||
|
||||
`chroot_with_mount_flags()` additionally applies the given `mount_flags` to the new root directory
|
||||
of the current process as if it was a separate mount. All the same flags as for [`mount`(2)](mount.md)
|
||||
are accepted, except `MS_BIND` doesn't make sense for chroots. Additionally, the value -1 is accepted,
|
||||
and makes `chroot_with_mount_flags()` behave like regular `chroot()`.
|
||||
|
||||
## Errors
|
||||
|
||||
* `EPERM`: The current process does not have superuser privileges.
|
||||
* `EFAULT`: `path` is not in readable memory.
|
||||
|
||||
All of the usual path resolution errors may also occur.
|
||||
|
||||
## See also
|
||||
|
||||
* [`chroot`(8)](../man8/chroot.md)
|
||||
* [`mount`(2)](mount.md)
|
|
@ -1,36 +0,0 @@
|
|||
## Name
|
||||
|
||||
chroot - run a shell with a different filesystem root
|
||||
|
||||
## Synopsis
|
||||
|
||||
```**sh
|
||||
# chroot <path> [program] [-o options]
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
This program uses the [`chroot`(2)](../man2/chroot.md) syscall to switch into a
|
||||
different filesystem root and spawn a shell inside it.
|
||||
|
||||
It runs the given *program* (by default, `/bin/Shell`) inside the new root.
|
||||
Mount options can be given in the same format as for [`mount`(8)](mount.md).
|
||||
|
||||
## Examples
|
||||
|
||||
```sh
|
||||
# chroot /var/chroot
|
||||
# pwd
|
||||
/
|
||||
```
|
||||
|
||||
```sh
|
||||
# chroot -u 200:200 /var/chroot
|
||||
$ id
|
||||
uid=200(nona) gid=200(n/a)
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
* [`chroot`(2)](../man2/chroot.md)
|
||||
* [`mount`(8)](mount.md)
|
Loading…
Add table
Add a link
Reference in a new issue