Skip to content

Commit

Permalink
BUILD: Use separate chown to make changing ownership to the sssd user…
Browse files Browse the repository at this point in the history
… non-fatal

When the SSSD is built in the build system using a non-root user, the
user doesn't exist in the build system and file ownership will be
maintained by the downstream packaging instead.

We need to make sure that setting the ownership to the sssd user is a
separate step from creating the directories in this case in order to
make failure to set the ownership non-fatal.

Related:
https://fedorahosted.org/sssd/ticket/2370

Reviewed-by: Lukáš Slebodník <[email protected]>
  • Loading branch information
jhrozek committed Nov 18, 2014
1 parent 35b4b21 commit f9ac9aa
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ INSTALL = @INSTALL@

SSSD_USER = @SSSD_USER@

INSTALL_USER_DIR_FLAGS = -d
if SSSD_USER
INSTALL_USER_DIR_FLAGS += -o $(SSSD_USER) -g $(SSSD_USER)
endif

AM_CFLAGS =
if WANT_AUX_INFO
AM_CFLAGS += -aux-info $@.X
Expand Down Expand Up @@ -2798,6 +2793,18 @@ src/sysv/systemd/journal.conf: src/sysv/systemd/journal.conf.in Makefile
@$(MKDIR_P) src/sysv/systemd/
$(replace_script)

SSSD_USER_DIRS = \
$(DESTDIR)$(dbpath) \
$(DESTDIR)$(mcpath) \
$(DESTDIR)$(pipepath) \
$(DESTDIR)$(pipepath)/private \
$(DESTDIR)$(pubconfpath) \
$(DESTDIR)$(pubconfpath)/krb5.include.d \
$(DESTDIR)$(gpocachepath) \
$(DESTDIR)$(sssdconfdir) \
$(DESTDIR)$(logpath) \
$(NULL)

installsssddirs::
$(MKDIR_P) \
$(DESTDIR)$(includedir) \
Expand All @@ -2815,18 +2822,12 @@ installsssddirs::
$(DESTDIR)$(sssddatadir) \
$(DESTDIR)$(sudolibdir) \
$(DESTDIR)$(autofslibdir) \
$(NULL); \
$(INSTALL) $(INSTALL_USER_DIR_FLAGS) \
$(DESTDIR)$(dbpath) \
$(DESTDIR)$(mcpath) \
$(DESTDIR)$(pipepath) \
$(DESTDIR)$(pipepath)/private \
$(DESTDIR)$(pubconfpath) \
$(DESTDIR)$(pubconfpath)/krb5.include.d \
$(DESTDIR)$(gpocachepath) \
$(DESTDIR)$(sssdconfdir) \
$(DESTDIR)$(logpath) \
$(NULL)
$(SSSD_USER_DIRS) \
$(NULL);
if SSSD_USER
-chown $(SSSD_USER):$(SSSD_USER) \
$(SSSD_USER_DIRS)
endif

if HAVE_DOXYGEN
docs:
Expand Down

0 comments on commit f9ac9aa

Please sign in to comment.