Compare commits
6 Commits
62ce288524
...
800a097903
Author | SHA1 | Date | |
---|---|---|---|
800a097903 | |||
1ccdc65d30 | |||
df0a236f81 | |||
e385d873ec | |||
73a75a32df | |||
b8e5901d97 |
@ -95,7 +95,7 @@ fn main() -> ExitCode {
|
||||
|
||||
#[cfg(target_os="openbsd")] {
|
||||
let promises = Promises::new("stdio unveil");
|
||||
if let Err(e) = pledge(Some(promises), None) {
|
||||
if let Err(e) = pledge(Some(promises), Some(Promises::default())) {
|
||||
return err(&argv[0], e.strerror(), Some(EX_OSERR));
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ fn main() -> ExitCode {
|
||||
|
||||
#[cfg(target_os="openbsd")] {
|
||||
let promises = Promises::new("stdio unveil");
|
||||
if let Err(e) = pledge(Some(promises), None) {
|
||||
if let Err(e) = pledge(Some(promises), Some(Promises::default())) {
|
||||
return err(&argv[0], e.strerror(), EX_OSERR);
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,10 @@ impl Promises {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Promises {
|
||||
fn default() -> Self { Promises::new("") }
|
||||
}
|
||||
|
||||
pub fn pledge(
|
||||
promises: Option<Promises>, execpromises: Option<Promises>
|
||||
) -> Result<(), Error> {
|
||||
|
@ -62,7 +62,7 @@ fn main() -> ExitCode {
|
||||
|
||||
#[cfg(target_os="openbsd")] {
|
||||
let promises = Promises::new("cpath rpath stdio unveil wpath");
|
||||
if let Err(e) = pledge(Some(promises), None) {
|
||||
if let Err(e) = pledge(Some(promises), Some(Promises::default())) {
|
||||
return err(&argv[0], e, Some(EX_OSERR));
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ fn main() -> ExitCode {
|
||||
|
||||
#[cfg(target_os="openbsd")] {
|
||||
let promises = Promises::new("stdio unveil");
|
||||
if let Err(e) = pledge(Some(promises), None) {
|
||||
if let Err(e) = pledge(Some(promises), Some(Promises::default())) {
|
||||
return err(&argv[0], &e, Some(EX_OSERR));
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ fn main() -> ExitCode {
|
||||
|
||||
#[cfg(target_os="openbsd")] {
|
||||
let promises = Promises::new("stdio unveil");
|
||||
if let Err(e) = pledge(Some(promises), None) {
|
||||
if let Err(e) = pledge(Some(promises), Some(Promises::default())) {
|
||||
return err(&argv[0], e, EX_OSERR);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user