|
|
905b4d |
From edd6a6f65c1f1472632c263bdbd0946ff7fa8849 Mon Sep 17 00:00:00 2001
|
|
|
905b4d |
From: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
905b4d |
Date: Mon, 27 Oct 2014 16:14:51 +0100
|
|
|
905b4d |
Subject: [PATCH 92/92] BE: Become a regular user after initialization
|
|
|
905b4d |
|
|
|
905b4d |
Some parts of initialization (Kerberos ticket renewal, checking the
|
|
|
905b4d |
keytab for the right principal) still require the root privileges. Drop
|
|
|
905b4d |
privileges after initializing the back ends.
|
|
|
905b4d |
|
|
|
905b4d |
Related:
|
|
|
905b4d |
https://fedorahosted.org/sssd/ticket/2370
|
|
|
905b4d |
|
|
|
905b4d |
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
|
|
905b4d |
---
|
|
|
905b4d |
src/providers/data_provider_be.c | 13 +++++++++++++
|
|
|
905b4d |
1 file changed, 13 insertions(+)
|
|
|
905b4d |
|
|
|
905b4d |
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
|
|
|
905b4d |
index 2716e4a8b38f3ff9a5b48a861ecc31f18f9fcbce..267f5f1d89cdfd0d8c69f90bc44b0f06f7e007ff 100644
|
|
|
905b4d |
--- a/src/providers/data_provider_be.c
|
|
|
905b4d |
+++ b/src/providers/data_provider_be.c
|
|
|
905b4d |
@@ -2886,6 +2886,19 @@ int main(int argc, const char *argv[])
|
|
|
905b4d |
return 3;
|
|
|
905b4d |
}
|
|
|
905b4d |
|
|
|
905b4d |
+ ret = chown_debug_file(NULL, uid, gid);
|
|
|
905b4d |
+ if (ret != EOK) {
|
|
|
905b4d |
+ DEBUG(SSSDBG_MINOR_FAILURE,
|
|
|
905b4d |
+ "Cannot chown the debug files, debugging might not work!\n");
|
|
|
905b4d |
+ }
|
|
|
905b4d |
+
|
|
|
905b4d |
+ ret = become_user(uid, gid);
|
|
|
905b4d |
+ if (ret != EOK) {
|
|
|
905b4d |
+ DEBUG(SSSDBG_FUNC_DATA,
|
|
|
905b4d |
+ "Cannot become user [%"SPRIuid"][%"SPRIgid"].\n", uid, gid);
|
|
|
905b4d |
+ return ret;
|
|
|
905b4d |
+ }
|
|
|
905b4d |
+
|
|
|
905b4d |
DEBUG(SSSDBG_TRACE_FUNC, "Backend provider (%s) started!\n", be_domain);
|
|
|
905b4d |
|
|
|
905b4d |
/* loop on main */
|
|
|
905b4d |
--
|
|
|
905b4d |
1.9.3
|
|
|
905b4d |
|