dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0089-BUILD-Use-separate-chown-to-make-changing-ownership-.patch

905b4d
From 29d7f951999d0c8aad33fd1d0cb25a9b50db693f Mon Sep 17 00:00:00 2001
905b4d
From: Jakub Hrozek <jhrozek@redhat.com>
905b4d
Date: Wed, 5 Nov 2014 17:57:44 +0100
905b4d
Subject: [PATCH 89/92] BUILD: Use separate chown to make changing ownership to
905b4d
 the sssd user non-fatal
905b4d
MIME-Version: 1.0
905b4d
Content-Type: text/plain; charset=UTF-8
905b4d
Content-Transfer-Encoding: 8bit
905b4d
905b4d
When the SSSD is built in the build system using a non-root user, the
905b4d
user doesn't exist in the build system and file ownership will be
905b4d
maintained by the downstream packaging instead.
905b4d
905b4d
We need to make sure that setting the ownership to the sssd user is a
905b4d
separate step from creating the directories in this case in order to
905b4d
make failure to set the ownership non-fatal.
905b4d
905b4d
Related:
905b4d
https://fedorahosted.org/sssd/ticket/2370
905b4d
905b4d
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
905b4d
---
905b4d
 Makefile.am | 35 ++++++++++++++++++-----------------
905b4d
 1 file changed, 18 insertions(+), 17 deletions(-)
905b4d
905b4d
diff --git a/Makefile.am b/Makefile.am
905b4d
index 5325d51e7240ae39a546e68b2a2aea202b3dfdfa..6ce3a42f3833fc9041efd908c2e3de4a85193d42 100644
905b4d
--- a/Makefile.am
905b4d
+++ b/Makefile.am
905b4d
@@ -82,11 +82,6 @@ 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
     AM_CFLAGS += -aux-info $@.X
905b4d
@@ -2798,6 +2793,18 @@ src/sysv/systemd/journal.conf: src/sysv/systemd/journal.conf.in Makefile
905b4d
 	@$(MKDIR_P) src/sysv/systemd/
905b4d
 	$(replace_script)
905b4d
 
905b4d
+SSSD_USER_DIRS = \
905b4d
+    $(DESTDIR)$(dbpath) \
905b4d
+    $(DESTDIR)$(mcpath) \
905b4d
+    $(DESTDIR)$(pipepath) \
905b4d
+    $(DESTDIR)$(pipepath)/private \
905b4d
+    $(DESTDIR)$(pubconfpath) \
905b4d
+    $(DESTDIR)$(pubconfpath)/krb5.include.d \
905b4d
+    $(DESTDIR)$(gpocachepath) \
905b4d
+    $(DESTDIR)$(sssdconfdir) \
905b4d
+    $(DESTDIR)$(logpath) \
905b4d
+    $(NULL)
905b4d
+
905b4d
 installsssddirs::
905b4d
 	$(MKDIR_P) \
905b4d
     $(DESTDIR)$(includedir) \
905b4d
@@ -2815,18 +2822,12 @@ installsssddirs::
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)$(pipepath) \
905b4d
-    $(DESTDIR)$(pipepath)/private \
905b4d
-    $(DESTDIR)$(pubconfpath) \
905b4d
-    $(DESTDIR)$(pubconfpath)/krb5.include.d \
905b4d
-    $(DESTDIR)$(gpocachepath) \
905b4d
-    $(DESTDIR)$(sssdconfdir) \
905b4d
-    $(DESTDIR)$(logpath) \
905b4d
-    $(NULL)
905b4d
+    $(SSSD_USER_DIRS) \
905b4d
+    $(NULL);
905b4d
+if SSSD_USER
905b4d
+	-chown $(SSSD_USER):$(SSSD_USER) \
905b4d
+	$(SSSD_USER_DIRS)
905b4d
+endif
905b4d
 
905b4d
 if HAVE_DOXYGEN
905b4d
 docs:
905b4d
-- 
905b4d
1.9.3
905b4d