better error message if getpwnam fails

This commit is contained in:
Alexandre Ratchov 2010-09-09 08:35:23 +02:00
parent 6078ffd6b8
commit c7be174526
1 changed files with 1 additions and 1 deletions

View File

@ -392,7 +392,7 @@ privdrop(void)
struct stat sb;
if ((pw = getpwnam(SNDIO_USER)) == NULL)
err(1, "getpwnam");
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)