Skip to main content

set_dumpable

Function set_dumpable 

Source
pub fn set_dumpable(dumpable: bool) -> Result<(), CoreError>
Expand description

Set the process’s PR_SET_DUMPABLE flag.

dumpable = false is daemon self-hardening (A17-02): the process cannot produce core dumps and its /proc/self memory is not readable by children via process_vm_readv/pidfd_getfd. Used together with set_ptracer to make a privileged daemon resistant to child tracing. The flag is inherited by fork children, which is fine for the exec jobs (they drop privileges under setresuid anyway).

§Errors

  • EINVAL: unsupported PR_SET_DUMPABLE value (only 0/1 are valid).