commit a8154af4f4f9629f8981334f0129a7d634ed6c4c
parent 3fcbebcff12a01e87595b233252bfae039b99723
Author: Zack Newman <zack@philomathiclife.com>
Date: Sun, 10 Nov 2024 14:51:04 -0700
fix priv_sep
Diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/main.rs b/src/main.rs
@@ -155,7 +155,7 @@ impl From<Parse> for E {
/// to run. Specifically, the `Promise`s `Exec`, `Proc`, `Rpath`, `Stdio`, and `Unveil`
/// are passed.
#[cfg(target_os = "openbsd")]
-fn pledge_init() -> Result<Promises<5>, Error> {
+fn pledge_init() -> Result<Promises, Error> {
let promises = Promises::new([
Promise::Exec,
Promise::Proc,
@@ -179,9 +179,8 @@ const fn pledge_init() -> Result<Zst, Infallible> {
}
/// Removes `Promise::Unveil`.
#[cfg(target_os = "openbsd")]
-fn pledge_away_unveil(promises: &mut Promises<5>) -> Result<(), Error> {
- promises.remove(Promise::Unveil);
- promises.pledge()
+fn pledge_away_unveil(promises: &mut Promises) -> Result<(), Error> {
+ promises.remove_then_pledge(Promise::Unveil)
}
/// No-op that returns `Ok`.
#[expect(
@@ -194,9 +193,8 @@ fn pledge_away_unveil(_: &mut Zst) -> Result<(), Infallible> {
}
/// Removes all `Promise`s except `Stdio`.
#[cfg(target_os = "openbsd")]
-fn pledge_away_all_but_stdio(promises: &mut Promises<5>) -> Result<(), Error> {
- promises.retain([Promise::Stdio]);
- promises.pledge()
+fn pledge_away_all_but_stdio(promises: &mut Promises) -> Result<(), Error> {
+ promises.retain_then_pledge([Promise::Stdio])
}
/// No-op that returns `Ok`.
#[expect(