~zethra/stargazer

f28dbbcfaa443b8adb3642e31653270fa598f439 — Ben Aaron Goldberg 19 days ago 16a7fc9 master
Only do prctl on Linux

This libc call doesn't seem to be thing on FreeBSD at least.
1 files changed, 8 insertions(+), 1 deletions(-)

M src/cgi.rs
M src/cgi.rs => src/cgi.rs +8 -1
@@ 38,9 38,12 @@ use futures_lite::{
use is_executable::IsExecutable;
use log::{debug, error};
use sha2::{Digest, Sha256};
use std::{ffi::{OsStr, OsString}, time::Duration};
use std::{collections::HashMap, net::IpAddr};
use std::{
    ffi::{OsStr, OsString},
    time::Duration,
};
use std::{
    io::ErrorKind,
    path::{Path, PathBuf},
};


@@ 113,6 116,10 @@ pub async fn serve_cgi<'a>(
                cmd.uid(user.uid());
                cmd.gid(user.primary_group_id());
            }
        }
    }
    cfg_if::cfg_if! {
        if #[cfg(linux)] {
            unsafe {
                cmd.pre_exec(|| {
                    libc::prctl(libc::PR_SET_PDEATHSIG, libc::SIGHUP);