[selinux-policy: 1338/3172] fixes for rhel4 genhomedircon.
Daniel J Walsh
dwalsh at fedoraproject.org
Thu Oct 7 21:01:09 UTC 2010
commit 185ab24144603c2d630d4388c1a68e0a9bfbad68
Author: Chris PeBenito <cpebenito at tresys.com>
Date: Fri Apr 7 15:01:10 2006 +0000
fixes for rhel4 genhomedircon.
refpolicy/Rules.monolithic | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/refpolicy/Rules.monolithic b/refpolicy/Rules.monolithic
index b698153..42c7659 100644
--- a/refpolicy/Rules.monolithic
+++ b/refpolicy/Rules.monolithic
@@ -171,8 +171,20 @@ enableaudit: $(POLICY_CONF)
#
$(FC): $(TMPDIR)/$(notdir $(FC)).tmp $(FCSORT)
$(verbose) $(FCSORT) $< $@
+ifeq "$(DISTRO)" "rhel4"
+# the old genhomedircon used in RHEL4 makes assumptions on
+# the directory strucure of the policy. need to set up a mini
+# environment with this structure for correct functioning.
+ @ mkdir -p $(TMPDIR)/rhel4/file_contexts
+ @ cp $@ $(TMPDIR)/rhel4/file_contexts
+ @ $(M4) $(M4PARAM) $(M4SUPPORT) $(USER_FILES) > $(TMPDIR)/rhel4/users
+ $(verbose) $(GREP) -v "^/root" $< $(TMPDIR)/rhel4/$(@F).root
+ $(verbose) ( cd $(TMPDIR)/rhel4/users ; $(GENHOMEDIRCON) . $(@F).root > $@ )
+ $(verbose) $(GREP) "^/root" $< >> $@
+else
$(verbose) $(GREP) -e HOME -e ROLE $@ > $(HOMEDIR_TEMPLATE)
$(verbose) $(SED) -i -e /HOME/d -e /ROLE/d $@
+endif
$(TMPDIR)/$(notdir $(FC)).tmp: $(M4SUPPORT) $(TMPDIR)/generated_definitions.conf $(ALL_FC_FILES)
ifeq ($(ALL_FC_FILES),)
@@ -191,9 +203,13 @@ $(FCPATH): $(FC) $(LOADPATH) $(USERPATH)/system.users
$(verbose) $(SETFILES) -q -c $(LOADPATH) $(FC)
@echo "Installing file_contexts."
@mkdir -p $(CONTEXTPATH)/files
+ifeq "$(DISTRO)" "rhel4"
+ $(verbose) install -m $(FC) $@
+else
$(verbose) install -m 644 $(FC) $(FCPATH)
$(verbose) install -m 644 $(HOMEDIR_TEMPLATE) $(HOMEDIRPATH)
$(verbose) $(GENHOMEDIRCON) -d $(TOPDIR) -t $(NAME) $(USEPWD)
+endif
########################################
#
More information about the scm-commits
mailing list