From d26621371e6bf5040fe833f046ff81a1c7cac94b Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 24 Apr 2006 15:07:09 +0000 Subject: [PATCH] chown() and chmod() aren't available on Windows. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@793 fefdeb5f-60dc-0310-8127-8f9354f1896f --- configure.ac | 4 ++-- src/polypcore/util.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d6239f9..87dc2aa 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 615ea88..191fa80 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) -- 2.7.4