genhomedircon is no longer a script, but a link to semodule

This commit is contained in:
Dan Walsh 2013-10-09 17:54:02 -04:00 committed by Stephen Smalley
parent 790ae0a0e2
commit 91d0de4adf
4 changed files with 15 additions and 16 deletions

View File

@ -9,23 +9,12 @@ LOCALEDIR ?= $(PREFIX)/share/locale
.PHONY: all genhomedircon
all: fixfiles genhomedircon chcat
genhomedircon:
@echo "#!/bin/sh" > genhomedircon
@echo >> genhomedircon
@if [ -z "${SEMODULE_PATH}" ]; then \
echo "${USRSBINDIR}/semodule -Bn" >> genhomedircon; \
else \
echo "${SEMODULE_PATH}/semodule -Bn" >> genhomedircon; \
fi
install: all
-mkdir -p $(BINDIR)
install -m 755 chcat $(BINDIR)
install -m 755 fixfiles $(SBINDIR)
install -m 755 genhomedircon $(USRSBINDIR)
-mkdir -p $(MANDIR)/man8
install -m 644 fixfiles.8 $(MANDIR)/man8/
install -m 644 genhomedircon.8 $(MANDIR)/man8/
install -m 644 chcat.8 $(MANDIR)/man8/
clean:

View File

@ -11,7 +11,7 @@ LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
SEMODULE_OBJS = semodule.o
.PHONY: all semodule_path
all: semodule semodule_path
all: semodule semodule_path genhomedircon
semodule_path:
@echo -n $(SBINDIR) > ../scripts/semodule_path
@ -19,16 +19,21 @@ semodule_path:
semodule: $(SEMODULE_OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
genhomedircon:
ln -sf semodule genhomedircon
install: all
-mkdir -p $(SBINDIR)
install -m 755 semodule $(SBINDIR)
(cd $(SBINDIR); ln -sf semodule genhomedircon)
test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8
install -m 644 semodule.8 $(MANDIR)/man8/
install -m 644 genhomedircon.8 $(MANDIR)/man8/
relabel:
clean:
-rm -f semodule *.o ../scripts/semodule_path
-rm -f semodule *.o ../scripts/semodule_path genhomedircon
indent:
../../scripts/Lindent $(wildcard *.[ch])

View File

@ -1,7 +1,7 @@
.TH GENHOMEDIRCON "12" "Sep 2011" "Security Enhanced Linux" "SELinux"
.TH GENHOMEDIRCON "8" "Sep 2011" "Security Enhanced Linux" "SELinux"
.SH NAME
genhomedircon \- generate SELinux file context configuration entries for user home directories
.SH SYNOPSIS
.SH DESCRIPTION
.B genhomedircon
is a script that executes
.B semodule

View File

@ -19,6 +19,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <libgen.h>
#include <semanage/modules.h>
@ -284,8 +285,12 @@ int main(int argc, char *argv[])
int i, commit = 0;
int result;
int status = EXIT_FAILURE;
char *genhomedirconargv[] = { "genhomedircon", "-B", "-n" };
create_signal_handlers();
if (strcmp(basename(argv[0]), "genhomedircon") == 0) {
argc = 3;
argv=genhomedirconargv;
}
parse_command_line(argc, argv);
if (build)