diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/polypcore/util.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index d6239f97..87dc2aab 100644 --- a/configure.ac +++ b/configure.ac @@ -219,8 +219,8 @@ AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])]) AC_FUNC_FORK AC_FUNC_GETGROUPS AC_FUNC_SELECT_ARGTYPES -AC_CHECK_FUNCS([getaddrinfo getgrgid_r getpwuid_r gettimeofday getuid \ - inet_ntop inet_pton nanosleep setpgid setsid sigaction sleep]) +AC_CHECK_FUNCS([chmod chown getaddrinfo getgrgid_r getpwuid_r gettimeofday \ + getuid inet_ntop inet_pton nanosleep setpgid setsid sigaction sleep]) AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0]) AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1") diff --git a/src/polypcore/util.c b/src/polypcore/util.c index 615ea881..191fa809 100644 --- a/src/polypcore/util.c +++ b/src/polypcore/util.c @@ -140,8 +140,12 @@ int pa_make_secure_dir(const char* dir) { if (errno != EEXIST) return -1; +#ifdef HAVE_CHOWN chown(dir, getuid(), getgid()); +#endif +#ifdef HAVE_CHMOD chmod(dir, 0700); +#endif #ifdef HAVE_LSTAT if (lstat(dir, &st) < 0) |