Commit graph

3 commits

Author SHA1 Message Date
Tim Schumacher
5f99934dce Userland: Consolidate most PATH resolving into a single implementation
We previously had at least three different implementations for resolving
executables in the PATH, all of which had slightly different
characteristics.

Merge those into a single implementation to keep the behaviour
consistent, and maybe to make that implementation more configurable in
the future.
2022-08-23 19:00:04 +01:00
Itamar
db11cfa2c5 Utilities+LibELF: Temporary promises for dynamic linker in "pledge"
This adds a "temporary promises for the dynamic-linker" flag ('-d')
to the "pledge" utility.

Example usage:
pledge -d -p "stdio rpath" id

Without the '-d' flag, id would crash because the dynamic linker
requires 'prot_exec'.

When this flag is used and the program to be run is dynamically linked,
"pledge" adds promises that are required by the dynamic linker
to the promise set provided by the user.

The dynamic linker will later "give up" the pledge promises it no
longer requires.
2022-07-21 16:40:11 +02:00
Andreas Kling
ed9b2a85ed Utilities: Add "pledge" utility for launching a sandboxed command
This new command allows you to run any command with an initial set
of pledge promises.

Note that dynamically linked executables won't be able to bootstrap
without at least "stdio rpath prot_exec".

Inspired by http://justine.lol/pledge/ :^)
2022-07-14 23:27:19 +02:00