ladybird/Kernel/FileSystem
Andreas Kling 0569123ad7 Kernel: Add a basic implementation of unveil()
This syscall is a complement to pledge() and adds the same sort of
incremental relinquishing of capabilities for filesystem access.

The first call to unveil() will "drop a veil" on the process, and from
now on, only unveiled parts of the filesystem are visible to it.

Each call to unveil() specifies a path to either a directory or a file
along with permissions for that path. The permissions are a combination
of the following:

- r: Read access (like the "rpath" promise)
- w: Write access (like the "wpath" promise)
- x: Execute access
- c: Create/remove access (like the "cpath" promise)

Attempts to open a path that has not been unveiled with fail with
ENOENT. If the unveiled path lacks sufficient permissions, it will fail
with EACCES.

Like pledge(), subsequent calls to unveil() with the same path can only
remove permissions, not add them.

Once you call unveil(nullptr, nullptr), the veil is locked, and it's no
longer possible to unveil any more paths for the process, ever.

This concept comes from OpenBSD, and their implementation does various
things differently, I'm sure. This is just a first implementation for
SerenityOS, and we'll keep improving on it as we go. :^)
2020-01-20 22:12:04 +01:00
..
Custody.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Custody.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
DevPtsFS.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
DevPtsFS.h Kernel: Fix identifier casing 2020-01-18 23:51:22 +01:00
DiskBackedFileSystem.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
DiskBackedFileSystem.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
ext2_fs.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
ext2_types.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Ext2FileSystem.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Ext2FileSystem.h Kernel: Fix identifier casing 2020-01-18 23:51:22 +01:00
FIFO.cpp Kernel: Make DoubleBuffer use a KBuffer instead of kmalloc()ing 2020-01-20 16:08:49 +01:00
FIFO.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
File.cpp Kernel: Move setting file flags and r/w mode to VFS::open() 2020-01-18 23:51:22 +01:00
File.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
FileDescription.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
FileDescription.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
FileSystem.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
FileSystem.h Kernel: Fix identifier casing 2020-01-18 23:51:22 +01:00
Inode.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Inode.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
InodeFile.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
InodeFile.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
InodeIdentifier.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
InodeMetadata.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
InodeWatcher.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
InodeWatcher.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
ProcFS.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
ProcFS.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
TmpFS.cpp TmpFS: Grow the underlying inode buffer with 2x factor when written to 2020-01-19 14:01:32 +01:00
TmpFS.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
VirtualFileSystem.cpp Kernel: Add a basic implementation of unveil() 2020-01-20 22:12:04 +01:00
VirtualFileSystem.h Kernel: Add a basic implementation of unveil() 2020-01-20 22:12:04 +01:00