summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-04-22 14:31:47 +0000
committerLennart Poettering <lennart@poettering.net>2006-04-22 14:31:47 +0000
commit0cc2e04157bd4fc6838b3690bd6387fcb3ee4587 (patch)
tree7ae0bba61477fdbe3f372046b03db43f8e1071c4 /src
parenta7c5ed19948915a1930ea19ae2c11b5486542cb0 (diff)
chown() and chmod() /tmp/.esd/ before checking if everything is ok with it
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@770 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
-rw-r--r--src/polypcore/util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/polypcore/util.c b/src/polypcore/util.c
index b37a25a3..8418a692 100644
--- a/src/polypcore/util.c
+++ b/src/polypcore/util.c
@@ -140,13 +140,16 @@ int pa_make_secure_dir(const char* dir) {
if (errno != EEXIST)
return -1;
+ chown(dir, getuid(), getgid());
+ chmod(dir, 0700);
+
#ifdef HAVE_LSTAT
if (lstat(dir, &st) < 0)
#else
if (stat(dir, &st) < 0)
#endif
goto fail;
-
+
#ifndef OS_IS_WIN32
if (!S_ISDIR(st.st_mode) || (st.st_uid != getuid()) || ((st.st_mode & 0777) != 0700))
goto fail;