setools/setools-rhat.patch

305 lines
9.3 KiB
Diff

--- setools-1.3.1/seuser/Makefile.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/seuser/Makefile 2004-05-28 15:21:50.390091152 -0400
@@ -22,10 +22,10 @@
SHELL = /bin/sh
seuser: $(CMD-OBJ)
- $(CC) -o $@ $(CMD-OBJ) $(LINKFLAGS) $(LIBS)
+ $(CC) -o $@ $(CMD-OBJ) $(LINKFLAGS) $(LIBS) -lselinux
seuserx: $(GUI-OBJ) se_user.tcl
- $(CC) $(GUI_CFLAGS) $(TCL_LIBINC) -o $@ $(GUI-OBJ) $(LINKFLAGS) $(TCL_LIBS)
+ $(CC) $(GUI_CFLAGS) $(TCL_LIBINC) -o $@ $(GUI-OBJ) $(LINKFLAGS) $(TCL_LIBS) -lselinux
se_user.tcl: $(TCL-FILES)
cat $(TCL-FILES) | \
@@ -86,7 +86,7 @@
cat ../policy/seuser_template.fc | \
sed -e 's|SEUSER_BINDIR|$(BINDIR)|g' | \
sed -e 's|SEUSER_INSTALL_LIBDIR|$(INSTALL_LIBDIR)|g' > ../policy/seuser.fc
-
+
-@if [ -e $(POLICY_SRC_DIR)/policy/Makefile -a -e ../policy/seuser.fc ]; then \
install -d $(TE_PROGS_DIR); \
install -d $(FC_PROGS_DIR); \
@@ -102,11 +102,11 @@
echo " not found. type 'make install-src' from your policy directory, or"; \
echo " consult your SELinux documentation."; \
fi
-
+
-@if [ -e ../policy/seuser.fc ]; then \
rm -f ../policy/seuser.fc; \
fi
-
+
policy-install: seuser-policy
-@if [ -e $(POLICY_SRC_DIR)/policy/Makefile ]; then \
--- setools-1.3.1/awish/Makefile.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/awish/Makefile 2004-05-28 15:21:16.296274200 -0400
@@ -4,7 +4,7 @@
AWISH_OBJ = awish.o $(LIBSEUSER-TCL) $(LIBAPOL-TCL)
awish: $(AWISH_OBJ)
- $(CC) $(TCL_LIBINC) -o $@ $(AWISH_OBJ) $(LINKFLAGS) $(TCL_LIBS)
+ $(CC) $(TCL_LIBINC) -o $@ $(AWISH_OBJ) $(LINKFLAGS) $(TCL_LIBS) -lselinux
%.o: %.c
@@ -12,16 +12,16 @@
../lib/libapol.a:
cd ../ ; $(MAKE) libapol
-
+
../lib/libapol-tcl.a:
cd ../ ; $(MAKE) libapol-tcl
../lib/libseuser-tcl.a:
cd ../ ; $(MAKE) libseuser-tcl
-
+
../lib/libseuser.a:
cd ../ ; $(MAKE) libseuser
-
+
install: awish
install -m 755 awish $(BINDIR)
--- setools-1.3.1/secmds/Makefile.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/secmds/Makefile 2004-05-28 14:59:44.269692096 -0400
@@ -42,7 +42,7 @@
install: $(SE_CMDS)
install -m 755 $(SE_CMDS) $(BINDIR);
- chcon system_u:object_r:setfiles_exec_t $(BINDIR)/replcon
+# chcon system_u:object_r:setfiles_exec_t $(BINDIR)/replcon
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE) -c $<
--- setools-1.3.1/libseuser/seuser_db.c.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/libseuser/seuser_db.c 2004-05-28 15:07:45.945466248 -0400
@@ -17,6 +17,7 @@
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
+#include <limits.h>
#include "seuser_db.h"
/* apol lib */
@@ -751,8 +752,10 @@
}
free(full_config);
-
- db->policy_conf = get_config_var("policy.conf", fp);
+ /* db->policy_conf = get_config_var("policy.conf", fp);*/
+ db->policy_conf = malloc(PATH_MAX);
+ snprintf(db->policy_conf, PATH_MAX, "%s/src/policy/policy.conf",
+ selinux_policy_root());
if(db->policy_conf == NULL) {
fclose(fp);
free_conf_info(db);
@@ -767,7 +770,9 @@
return 4;
}
- db->policy_dir = get_config_var("policy_dir", fp);
+ /* db->policy_dir = get_config_var("policy_dir", fp);*/
+ db->policy_dir = malloc(PATH_MAX);
+ snprintf(db->policy_dir, PATH_MAX, "%s/src/policy", selinux_policy_root());
if(db->policy_dir == NULL) {
fclose(fp);
free_conf_info(db);
@@ -782,7 +787,9 @@
return 6;
}
- db->user_file = get_config_var("user_file", fp);
+ /* db->user_file = get_config_var("user_file", fp);*/
+ db->user_file = malloc(PATH_MAX);
+ snprintf(db->user_file, PATH_MAX, "%s/src/policy/users", selinux_policy_root());
if(db->user_file == NULL) {
fclose(fp);
free_conf_info(db);
@@ -791,7 +798,8 @@
}
/* users file may not exist which is ok, so we won't check read access. */
- db->file_contexts_file = get_config_var("file_contexts_file", fp);
+ /* db->file_contexts_file = get_config_var("file_contexts_file", fp);*/
+ db->file_contexts_file = strdup(selinux_file_context_path());
if(db->file_contexts_file == NULL) {
fclose(fp);
free_conf_info(db);
--- setools-1.3.1/libseuser/Makefile.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/libseuser/Makefile 2004-05-28 15:11:27.571773928 -0400
@@ -11,8 +11,12 @@
libseuser-tcl: ../lib/libseuser-tcl.a
+install: libseuser libseuser-tcl
+ install -m 644 ../lib/libseuser.a $(INSTALL_LIBDIR)
+ install -m 644 *.h $(INCLUDEDIR)
+
../lib/libseuser.a: ../lib $(LIB-OBJ)
- ar cr $@ $(LIB-OBJ)
+ ar cr $@ $(LIB-OBJ) -lselinux
../lib/libseuser-tcl.a: ../lib $(LIB-OBJ-TCL)
ar cr $@ $(LIB-OBJ-TCL)
@@ -20,7 +24,7 @@
%.o: %.c
$(CC) $(CFLAGS) -c $<
-
+
../lib:
mkdir -p $@
--- setools-1.3.1/packages/Makefile.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/packages/Makefile 2004-05-28 14:59:44.273691488 -0400
@@ -3,11 +3,13 @@
# by Kevin Carr kcarr@tresys.com
# Make sure INSTALL_PATH is set properly for your system!
-INSTALL_PATH=/usr/share/tcl8.3/
+TCLVER = $(shell env tclsh ../tcl_vars version)
+INSTALL_PATH=$(DESTDIR)/usr/share/tcl$(TCLVER)/
install:
- tar -zxvf BWidget-1.4.1.tar.gz
+ mkdir -p $(INSTALL_PATH)
+ tar -zxf BWidget-1.4.1.tar.gz
mv BWidget-1.4.1 $(INSTALL_PATH)
remove:
@@ -20,4 +22,4 @@
rm -rf BWidget-1.4.1/
bare:
- clean
\ No newline at end of file
+ clean
--- setools-1.3.1/Makefile.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/Makefile 2004-05-28 15:03:16.395444080 -0400
@@ -20,8 +20,8 @@
# File location defaults; used in various places in code
# Change these if you want different defaults
-POLICY_SRC_DIR = $(DESTDIR)/etc/security/selinux/src
-POLICY_SRC_FILE = $(POLICY_SRC_DIR)/policy.conf
+POLICY_SRC_DIR = $(DESTDIR)/etc/selinux/strict/src
+POLICY_SRC_FILE = $(POLICY_SRC_DIR)/policy/policy.conf
DEFAULT_LOG_FILE = /var/log/messages
# Compile options
@@ -83,6 +83,8 @@
@echo " install-seuserx: build and install seuser and seuserx (selinux required)"
@echo " install-secmds: build and install command line tools (selinux not required)"
@echo " install-seaudit: build and install seaudit (selinux not required)"
+ @echo " install-bwidget: build and install BWidget (selinux not required)"
+ @echo " install-libraries: build and install libraries"
@echo " "
@echo " all: build everything, but don't install"
@echo " all-nogui: only build non-GUI tools and libraries"
@@ -116,7 +118,7 @@
echo "Could not build awish."; \
echo "Tcl library is not built or not in expected location(s)."; \
fi
-
+
seuser: selinux_tool
cd seuser; $(MAKE) seuser
@@ -137,9 +139,9 @@
secmds: selinux_tool
cd secmds; $(MAKE) all
-
+
libapol: selinux_tool
- cd libapol; $(MAKE) libapol
+ cd libapol; $(MAKE) libapol
libapol-tcl: selinux_tool
cd libapol;
@@ -186,6 +188,15 @@
echo "Tcl library is not built or not in expected location(s)."; \
fi
+install-libseuser:
+ cd libseuser; $(MAKE) install
+
+install-libapol:
+ cd libapol; $(MAKE) install INSTALL_HELPDIR=$(INSTALL_HELPDIR)
+
+install-libraries: install-libseuser install-libapol
+ cd libseuser; $(MAKE) install
+
# installs both GUI and non-GUI versions
install-seuserx: $(INSTALL_LIBDIR)
cd seuser;
@@ -211,8 +222,14 @@
install-nogui: $(INSTALL_LIBDIR) install-seuser install-secmds
+install-bwidget:
+ cd packages; make
+
+install-docs: docs
+ install -m 755 -d $(INSTALL_HELPDIR)
+ cd docs-src; $(MAKE) install INSTALL_HELPDIR=$(INSTALL_HELPDIR)
-install: install-apol install-seuserx install-sepcut install-awish install-secmds install-seaudit
+install: install-apol install-seuserx install-sepcut install-awish install-secmds install-seaudit install-bwidget install-docs
# Next four targets are to support installation as part of a system
# install. These targets are deprecated.
--- setools-1.3.1/docs-src/Makefile.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/docs-src/Makefile 2004-05-28 14:59:44.276691032 -0400
@@ -55,3 +55,14 @@
for file in $(TOP-DOCS); do \
rm -f ../$$file; \
done
+
+install:
+ for file in KNOWN-BUGS README; do \
+ cat $$file.in | sed -e 's/RELEASE_VERSION/$(shell cat ../VERSION)/g' | \
+ sed -e 's/MOD_DATE/$(shell date '+%B %d, %G')/g' > ${INSTALL_HELPDIR}/$$file; \
+ done
+ install -m 644 ../seaudit/seaudit_help.txt ${INSTALL_HELPDIR}
+ install -m 644 ../seuser/seuser_help.txt ${INSTALL_HELPDIR}
+ install -m 644 ../sepct/sepcut_help.txt ${INSTALL_HELPDIR}
+ install -m 644 ../apol/*.txt ${INSTALL_HELPDIR}
+
--- setools-1.3.1/apol/Makefile.rhat 2004-05-05 16:14:59.000000000 -0400
+++ setools-1.3.1/apol/Makefile 2004-05-28 15:15:29.505994336 -0400
@@ -11,14 +11,14 @@
APOL_HELP_FILES = apol_help.txt dta_help.txt iflow_help.txt obj_perms_help.txt
APOL_PERM_MAPS = apol_perm_mapping_ver12 apol_perm_mapping_ver15 \
apol_perm_mapping_ver16 apol_perm_mapping_ver17
-
+
APOL_DFLT_PMAP = apol_perm_mapping_ver16
LIBAPOL = ../lib/libapol-tcl.a ../lib/libapol.a
GUI-OBJ = apol_gui.o $(LIBAPOL)
CFLAGS += -DSTARTUP_SCRIPT='"$(APOL_STARTUP_SCRIPT)"'
apol: $(GUI-OBJ) apol.tcl
- $(CC) $(TCL_LIBINC) -o $@ $(GUI-OBJ) $(LINKFLAGS) $(TCL_LIBS)
+ $(CC) $(TCL_LIBINC) -o $@ $(GUI-OBJ) $(LINKFLAGS) $(TCL_LIBS) -lselinux
apol.tcl: $(TCL-FILES)
@@ -55,6 +55,7 @@
done \
fi
install -m 644 apol.tcl $(APOL_HELP_FILES) $(APOL_PERM_MAPS) $(INSTALL_LIBDIR)
+ install -m 644 $(APOL_HELP_FILES) $(APOL_PERM_MAPS) ${INSTALL_HELPDIR}
cd $(INSTALL_LIBDIR); ln -sf $(APOL_DFLT_PMAP) apol_perm_mapping
clean: