dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone
Blob Blame History Raw
From f39e5c757a4f3b244d0372f5a57e1714bc890bc3 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Fri, 17 Oct 2014 17:30:07 +0200
Subject: [PATCH 38/46] AUTOFS: Run the autofs responder as the SSSD user

Reviewed-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
(cherry picked from commit 287cc55b9086dd3c4e2a5fb84784e09767860142)
---
 src/monitor/monitor.c            | 3 ++-
 src/responder/autofs/autofssrv.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 2f622e571478b2a71ef29ed518ca3b80c077b766..4e461aa78e47ec6cedb77dd030f72c273a00a495 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1063,7 +1063,8 @@ static errno_t get_ping_config(struct mt_ctx *ctx, const char *path,
 static bool svc_supported_as_nonroot(const char *svc_name)
 {
     if ((strcmp(svc_name, "nss") == 0)
-        || (strcmp(svc_name, "pam") == 0)) {
+        || (strcmp(svc_name, "pam") == 0)
+        || (strcmp(svc_name, "autofs") == 0)) {
         return true;
     }
     return false;
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c
index 12a7a777e214fa4c3821eb58ff602b3f3efb987a..44474ee0858d92fb5965de07773e3ad1e020ebfd 100644
--- a/src/responder/autofs/autofssrv.c
+++ b/src/responder/autofs/autofssrv.c
@@ -238,7 +238,7 @@ int main(int argc, const char *argv[])
     /* set up things like debug, signals, daemonization, etc... */
     debug_log_file = "sssd_autofs";
 
-    ret = server_setup("sssd[autofs]", 0, 0, 0,
+    ret = server_setup("sssd[autofs]", 0, uid, gid,
                        CONFDB_AUTOFS_CONF_ENTRY, &main_ctx);
     if (ret != EOK) {
         return 2;
-- 
1.9.3