From 983c8433a23795e3194dcd4896de4ed5c57cf420 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sun, 7 Oct 2012 15:50:49 +0200 Subject: [PATCH] allow sndiod user to be changed, dont check its home directory --- aucat/aucat.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/aucat/aucat.c b/aucat/aucat.c index e197c0d..ca7a2fe 100644 --- a/aucat/aucat.c +++ b/aucat/aucat.c @@ -51,12 +51,16 @@ /* * unprivileged user name */ +#ifndef SNDIO_USER #define SNDIO_USER "_sndio" +#endif /* * priority when run as root */ +#ifndef SNDIO_PRIO #define SNDIO_PRIO (-20) +#endif #define PROG_AUCAT "aucat" #define PROG_SNDIOD "sndiod" @@ -321,14 +325,9 @@ void privdrop(void) { struct passwd *pw; - struct stat sb; if ((pw = getpwnam(SNDIO_USER)) == NULL) errx(1, "unknown user %s", SNDIO_USER); - if (stat(pw->pw_dir, &sb) < 0) - err(1, "stat(\"%s\")", pw->pw_dir); - if (sb.st_uid != 0 || (sb.st_mode & 022) != 0) - errx(1, "%s has wrong permissions", pw->pw_dir); if (setpriority(PRIO_PROCESS, 0, SNDIO_PRIO) < 0) err(1, "setpriority"); if (setgroups(1, &pw->pw_gid) ||