mirror of https://github.com/ericonr/sndio.git
check that socket path is a directory
This commit is contained in:
parent
e20bb8997d
commit
12dccf8463
|
@ -273,6 +273,8 @@ getbasepath(char *base, size_t size)
|
|||
umask(omask);
|
||||
if (stat(base, &sb) < 0)
|
||||
err(1, "stat(\"%s\")", base);
|
||||
if (!S_ISDIR(sb.st_mode))
|
||||
errx(1, "%s is not a directory", base);
|
||||
if (sb.st_uid != uid || (sb.st_mode & mask) != 0)
|
||||
errx(1, "%s has wrong permissions", base);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue