13 void drop_privileges(
void) {
14 priv_set_t *privs = priv_str_to_set(
"basic",
",", NULL);
17 perror(
"priv_str_to_set");
21 (void)priv_delset(privs, PRIV_FILE_LINK_ANY);
22 (void)priv_delset(privs, PRIV_PROC_EXEC);
23 (void)priv_delset(privs, PRIV_PROC_FORK);
24 (void)priv_delset(privs, PRIV_PROC_INFO);
25 (void)priv_delset(privs, PRIV_PROC_SESSION);
27 if (setppriv(PRIV_SET, PRIV_PERMITTED, privs) != 0) {
28 perror(
"setppriv(PRIV_SET, PRIV_PERMITTED)");
34 if (setppriv(PRIV_SET, PRIV_INHERITABLE, privs) != 0) {
35 perror(
"setppriv(PRIV_SET, PRIV_INHERITABLE)");
39 if (setppriv(PRIV_SET, PRIV_LIMIT, privs) != 0) {
40 perror(
"setppriv(PRIV_SET, PRIV_LIMIT)");