#openbsd #security #ffi

priv_sep

FFI for pledge(2) and unveil(2) on OpenBSD

17 releases (5 stable)

2.2.0 Feb 25, 2025
2.1.0 Sep 6, 2024
2.0.0 Aug 21, 2024
1.0.1 Mar 27, 2024
0.4.0 Jul 26, 2023

#140 in Operating systems

Download history 1/week @ 2024-11-13 2/week @ 2024-11-20 4/week @ 2024-12-04 10/week @ 2024-12-11 3/week @ 2025-02-05 65/week @ 2025-02-19 71/week @ 2025-02-26

139 downloads per month
Used in 2 crates

MIT/Apache

45KB
860 lines

priv_sep

git crates.io docs.rs

priv_sep is a library for privilege separation. It is currently designed around pledge(2) and unveil(2) for OpenBSD, but in the future may contain functionality for Linux's seccomp(2).

Pledge

Calls to pledge(2) are done via Promises::pledge and pledge_none.

Note that since the use of execpromises is quite rare, NULL is always used for it.

Unveil

Calls to unveil(2) are done via Permissions::unveil and unveil_no_more.

Errors

Any error returned from the underlying system call is propagated via Error.

Minimum Supported Rust Version (MSRV)

This will frequently be updated to be the same as stable. Specifically, any time stable is updated and that update has "useful" features or compilation no longer succeeds (e.g., due to new compiler lints), then MSRV will be updated.

MSRV changes will correspond to a SemVer minor version bump.

SemVer Policy

  • All on-by-default features of this library are covered by SemVer
  • MSRV is considered exempt from SemVer as noted above

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Before any PR is sent, cargo clippy and cargo t should be run for both --no-default-features and --all-features. Additionally RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features should be run to ensure documentation can be built.

Status

This package will be actively maintained to stay in-sync with the latest version of OpenBSD; as a result, the crate is only tested on the x86_64-unknown-openbsd target. While OpenBSD supports both the most recent -release/-stable release as well as the previous version, only the most recent version will be supported by this library. If using -stable, it may be necessary to build the rust port from -current.

Dependencies