Struct privdrop::PrivDrop[][src]

pub struct PrivDrop { /* fields omitted */ }

PrivDrop structure

Example

This example is not tested
privdrop::PrivDrop::default()
    .chroot("/var/empty")
    .user("nobody").unwrap()
    .apply()
    .unwrap_or_else(|e| { panic!("Failed to drop privileges: {}", e) });

Methods

impl PrivDrop
[src]

chroot() to a specific directory before switching to a non-root user

Set the name of a user to switch to

Set a group name to switch to, if different from the primary group of the user

Apply the changes

Trait Implementations

impl Default for PrivDrop
[src]

Returns the "default value" for a type. Read more

impl Clone for PrivDrop
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for PrivDrop
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for PrivDrop

impl Sync for PrivDrop