use setgid() and setuid()

This commit is contained in:
Alexandre Ratchov 2016-10-24 17:05:47 +02:00
parent 4dcfed9dce
commit 017e60c967
1 changed files with 2 additions and 2 deletions

View File

@ -511,8 +511,8 @@ main(int argc, char **argv)
if (setpriority(PRIO_PROCESS, 0, SNDIO_PRIO) < 0)
err(1, "setpriority");
if (setgroups(1, &pw->pw_gid) ||
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid))
setgid(pw->pw_gid) ||
setuid(pw->pw_uid))
err(1, "cannot drop privileges");
}
for (;;) {