summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/core-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-21 13:55:52 +0200
committerLennart Poettering <lennart@poettering.net>2008-06-21 13:55:52 +0200
commit2199b8e1adb3e9395e629da6a3b180d5e1ba15f0 (patch)
treea059523fd96c8be97978ea7df7136eb59e9d1365 /src/pulsecore/core-util.c
parentd0e26a519f7f8fd0f31948623322c913c55f817b (diff)
Properly check for home directory
Diffstat (limited to 'src/pulsecore/core-util.c')
-rw-r--r--src/pulsecore/core-util.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 32173522..d259fb16 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -1179,19 +1179,17 @@ static char *get_dir(mode_t m, const char *env_name) {
return NULL;
}
- d = pa_sprintf_malloc("%s" PA_PATH_SEP ".pulse", h);
-
- if (stat(d, &st) < 0) {
- pa_log_error("Failed to state home directory %s: %s", d, pa_cstrerror(errno));
- pa_xfree(d);
+ if (stat(h, &st) < 0) {
+ pa_log_error("Failed to stat home directory %s: %s", h, pa_cstrerror(errno));
return NULL;
}
if (st.st_uid != getuid()) {
pa_log_error("Home directory %s not ours.", d);
- pa_xfree(d);
return NULL;
}
+
+ d = pa_sprintf_malloc("%s" PA_PATH_SEP ".pulse", h);
}
if (pa_make_secure_dir(d, m, (pid_t) -1, (pid_t) -1) < 0) {