#privileges #unix #daemon #user-id #security #service #group-id

drop-root

Set a user id and group (using the names) id to drop root privileges

3 releases (1 stable)

1.0.0 Dec 10, 2024
0.1.1 Nov 13, 2020
0.1.0 Nov 12, 2020

#290 in FFI

Download history 1/week @ 2024-11-13 5/week @ 2024-11-20 125/week @ 2024-12-04 69/week @ 2024-12-11 33/week @ 2024-12-18 1/week @ 2025-01-08 5/week @ 2025-02-05 42/week @ 2025-02-12 11/week @ 2025-02-19 4/week @ 2025-02-26

62 downloads per month

Unlicense

7KB
107 lines

Drop root

Set a user id and group id, using the names, to drop root privileges.

Example

use drop_root::set_user_group;

fn main() {
    // ...
    set_user_group("nobody", "nogroup");
    // ...
}

Testing

It's tested on Linux. Tests that require run as root are ignored by default, and executed one by one.

Dependencies

~130KB