From 857707b2276c7bc24580050e23c3932b386f8df6 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sun, 7 Oct 2012 15:55:52 +0200 Subject: [PATCH] allow sndio anonymouse uid to be changed; dont check its home directory --- sndiod/sndiod.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sndiod/sndiod.c b/sndiod/sndiod.c index e7fb409..b21bbae 100644 --- a/sndiod/sndiod.c +++ b/sndiod/sndiod.c @@ -46,12 +46,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 /* * sample rate if no ``-r'' is used @@ -244,14 +248,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) ||