dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0024-BUILD-Add-a-config-option-for-sssd-user-own-private-.patch

905b4d
From f504126d3d54b5b1b5467b59616255ef4c46d1be Mon Sep 17 00:00:00 2001
905b4d
From: Jakub Hrozek <jhrozek@redhat.com>
905b4d
Date: Wed, 1 Oct 2014 14:47:09 +0200
905b4d
Subject: [PATCH 24/46] BUILD: Add a config option for sssd user, own private
905b4d
 directories as the user
905b4d
905b4d
Adds a new configure-time option that lets you select the user to run
905b4d
SSSD as. The default is 'root' for backwards compatibility.
905b4d
905b4d
The directories the deamon stores its private data at are also created
905b4d
as owned by this user during install time.
905b4d
905b4d
Reviewed-by: Pavel Reichl <preichl@redhat.com>
905b4d
Reviewed-by: Simo Sorce <simo@redhat.com>
905b4d
(cherry picked from commit bc13c352ba9c2877f1e9bc62e55ad60fc000a55d)
905b4d
---
905b4d
 Makefile.am        | 23 +++++++++++++++++------
905b4d
 configure.ac       |  1 +
905b4d
 src/conf_macros.m4 | 19 +++++++++++++++++++
905b4d
 3 files changed, 37 insertions(+), 6 deletions(-)
905b4d
905b4d
diff --git a/Makefile.am b/Makefile.am
905b4d
index b949c9c24070026570de970b545918a7eb279c6d..61bf5cf957d4024b67f48cf42f5735b5fa368945 100644
905b4d
--- a/Makefile.am
905b4d
+++ b/Makefile.am
905b4d
@@ -78,6 +78,14 @@ sudolibdir = @sudolibpath@
905b4d
 UNICODE_LIBS=@UNICODE_LIBS@
905b4d
 
905b4d
 MKDIR_P = @MKDIR_P@
905b4d
+INSTALL = @INSTALL@
905b4d
+
905b4d
+SSSD_USER = @SSSD_USER@
905b4d
+
905b4d
+INSTALL_USER_DIR_FLAGS = -d
905b4d
+if SSSD_USER
905b4d
+INSTALL_USER_DIR_FLAGS += -o $(SSSD_USER) -g $(SSSD_USER)
905b4d
+endif
905b4d
 
905b4d
 AM_CFLAGS =
905b4d
 if WANT_AUX_INFO
905b4d
@@ -2740,24 +2748,27 @@ installsssddirs::
905b4d
     $(DESTDIR)$(bindir) \
905b4d
     $(DESTDIR)$(sbindir) \
905b4d
     $(DESTDIR)$(mandir) \
905b4d
+    $(DESTDIR)$(pidpath) \
905b4d
     $(DESTDIR)$(pluginpath) \
905b4d
     $(DESTDIR)$(libdir)/ldb \
905b4d
     $(DESTDIR)$(dbuspolicydir) \
905b4d
     $(DESTDIR)$(dbusservicedir) \
905b4d
-    $(DESTDIR)$(pipepath)/private \
905b4d
     $(DESTDIR)$(sssdlibdir) \
905b4d
     $(DESTDIR)$(pkglibdir) \
905b4d
-    $(DESTDIR)$(sssdconfdir) \
905b4d
     $(DESTDIR)$(sssddatadir) \
905b4d
+    $(DESTDIR)$(sudolibdir) \
905b4d
+    $(DESTDIR)$(autofslibdir) \
905b4d
+    $(NULL); \
905b4d
+	$(INSTALL) $(INSTALL_USER_DIR_FLAGS) \
905b4d
     $(DESTDIR)$(dbpath) \
905b4d
     $(DESTDIR)$(mcpath) \
905b4d
-    $(DESTDIR)$(pidpath) \
905b4d
-    $(DESTDIR)$(logpath) \
905b4d
+    $(DESTDIR)$(pipepath) \
905b4d
+    $(DESTDIR)$(pipepath)/private \
905b4d
     $(DESTDIR)$(pubconfpath) \
905b4d
     $(DESTDIR)$(pubconfpath)/krb5.include.d \
905b4d
     $(DESTDIR)$(gpocachepath) \
905b4d
-    $(DESTDIR)$(sudolibdir) \
905b4d
-    $(DESTDIR)$(autofslibdir) \
905b4d
+    $(DESTDIR)$(sssdconfdir) \
905b4d
+    $(DESTDIR)$(logpath) \
905b4d
     $(NULL)
905b4d
 
905b4d
 if HAVE_DOXYGEN
905b4d
diff --git a/configure.ac b/configure.ac
905b4d
index e6745cb454624d1d62e1a827c2fbf557f6502ae9..e5ec204ad9671d15deb1830c60168e066a66f198 100644
905b4d
--- a/configure.ac
905b4d
+++ b/configure.ac
905b4d
@@ -137,6 +137,7 @@ WITH_SAMBA
905b4d
 WITH_NFS
905b4d
 WITH_NFS_LIB_PATH
905b4d
 WITH_LIBWBCLIENT
905b4d
+WITH_SSSD_USER
905b4d
 
905b4d
 m4_include([src/external/pkg.m4])
905b4d
 m4_include([src/external/libpopt.m4])
905b4d
diff --git a/src/conf_macros.m4 b/src/conf_macros.m4
905b4d
index 4aa58138c85db9266fd3f1765fc357b3fd104941..fbee81f56e484b618379f7c987ecee50ae48917e 100644
905b4d
--- a/src/conf_macros.m4
905b4d
+++ b/src/conf_macros.m4
905b4d
@@ -737,3 +737,22 @@ AC_DEFUN([WITH_NFS_LIB_PATH],
905b4d
     fi
905b4d
     AC_SUBST(nfslibpath)
905b4d
   ])
905b4d
+
905b4d
+AC_DEFUN([WITH_SSSD_USER],
905b4d
+  [ AC_ARG_WITH([sssd-user],
905b4d
+                [AS_HELP_STRING([--with-sssd-user=<user>],
905b4d
+                                [User for running SSSD (root)]
905b4d
+                               )
905b4d
+                ]
905b4d
+               )
905b4d
+
905b4d
+    SSSD_USER=root
905b4d
+
905b4d
+    if test x"$with_sssd_user" != x; then
905b4d
+        SSSD_USER=$with_sssd_user
905b4d
+    fi
905b4d
+
905b4d
+    AC_SUBST(SSSD_USER)
905b4d
+    AC_DEFINE_UNQUOTED(SSSD_USER, "$SSSD_USER", ["The default user to run SSSD as"])
905b4d
+    AM_CONDITIONAL([SSSD_USER], [test x"$with_sssd_user" != x])
905b4d
+  ])
905b4d
-- 
905b4d
1.9.3
905b4d