summaryrefslogtreecommitdiffstats
path: root/src/util/server.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-10-20 13:59:49 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-10-20 21:43:45 +0200
commit4546e283498ffe2511cb566b9159714c671e326b (patch)
treebf4f149d7423f0110cb5d968a44c178acc9c9371 /src/util/server.c
parentac40d2f2b2b2fc35c95389f5e28febd580bd2b7a (diff)
downloadsssd-4546e283498ffe2511cb566b9159714c671e326b.tar.gz
sssd-4546e283498ffe2511cb566b9159714c671e326b.tar.xz
sssd-4546e283498ffe2511cb566b9159714c671e326b.zip
SSSD: Chown the log files
We need to chown the log files before dropping root to make sure they are usable by the SSSD user. Unfortunately, we can't just rely on passing the fd opened by root, because we need to be also able to rotate the log files. Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/util/server.c')
-rw-r--r--src/util/server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/server.c b/src/util/server.c
index 3a84dee0c..a908470cd 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -427,6 +427,12 @@ int server_setup(const char *name, int flags,
struct tevent_signal *tes;
struct logrotate_ctx *lctx;
+ ret = chown_debug_file(NULL, uid, gid);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE,
+ "Cannot chown the debug files, debugging might not work!\n");
+ }
+
ret = become_user(uid, gid);
if (ret != EOK) {
DEBUG(SSSDBG_FUNC_DATA,