policycoreutils/policycoreutils-rhat.patch
Daniel J Walsh 6827dc2d8b * Fri Oct 5 2007 Dan Walsh <dwalsh@redhat.com> 2.0.28-1
- Update to upstream
	* Update semodule man page for -D from Dan Walsh.
	* Add boolean, locallist, deleteall, and store support to semanage from Dan Walsh.
2007-10-05 17:16:35 +00:00

103 lines
4.1 KiB
Diff

diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/Makefile policycoreutils-2.0.27/Makefile
--- nsapolicycoreutils/Makefile 2007-07-16 14:20:43.000000000 -0400
+++ policycoreutils-2.0.27/Makefile 2007-10-03 11:23:39.000000000 -0400
@@ -1,4 +1,4 @@
-SUBDIRS=setfiles semanage load_policy newrole run_init restorecond secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po
+SUBDIRS=setfiles semanage load_policy newrole run_init restorecond secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po gui
all install relabel clean indent:
@for subdir in $(SUBDIRS); do \
diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/restorecond/restorecond.c policycoreutils-2.0.27/restorecond/restorecond.c
--- nsapolicycoreutils/restorecond/restorecond.c 2007-07-16 14:20:41.000000000 -0400
+++ policycoreutils-2.0.27/restorecond/restorecond.c 2007-10-03 11:23:39.000000000 -0400
@@ -210,9 +210,10 @@
}
if (fsetfilecon(fd, scontext) < 0) {
- syslog(LOG_ERR,
- "set context %s->%s failed:'%s'\n",
- filename, scontext, strerror(errno));
+ if (errno != EOPNOTSUPP)
+ syslog(LOG_ERR,
+ "set context %s->%s failed:'%s'\n",
+ filename, scontext, strerror(errno));
if (retcontext >= 0)
free(prev_context);
free(scontext);
@@ -225,8 +226,9 @@
if (retcontext >= 0)
free(prev_context);
} else {
- syslog(LOG_ERR, "get context on %s failed: '%s'\n",
- filename, strerror(errno));
+ if (errno != EOPNOTSUPP)
+ syslog(LOG_ERR, "get context on %s failed: '%s'\n",
+ filename, strerror(errno));
}
free(scontext);
close(fd);
diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-2.0.27/scripts/genhomedircon
--- nsapolicycoreutils/scripts/genhomedircon 1969-12-31 19:00:00.000000000 -0500
+++ policycoreutils-2.0.27/scripts/genhomedircon 2007-10-05 13:09:32.000000000 -0400
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/sbin/semodule -Bn
diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/scripts/Makefile policycoreutils-2.0.27/scripts/Makefile
--- nsapolicycoreutils/scripts/Makefile 2007-08-23 16:52:26.000000000 -0400
+++ policycoreutils-2.0.27/scripts/Makefile 2007-10-04 10:25:50.000000000 -0400
@@ -5,12 +5,13 @@
MANDIR ?= $(PREFIX)/share/man
LOCALEDIR ?= /usr/share/locale
-all: fixfiles
+all: fixfiles genhomedircon
install: all
-mkdir -p $(BINDIR)
install -m 755 chcat $(BINDIR)
install -m 755 fixfiles $(DESTDIR)/sbin
+ install -m 755 genhomedircon $(SBINDIR)
-mkdir -p $(MANDIR)/man8
install -m 644 fixfiles.8 $(MANDIR)/man8/
install -m 644 chcat.8 $(MANDIR)/man8/
diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/setfiles/setfiles.c policycoreutils-2.0.27/setfiles/setfiles.c
--- nsapolicycoreutils/setfiles/setfiles.c 2007-09-18 16:27:24.000000000 -0400
+++ policycoreutils-2.0.27/setfiles/setfiles.c 2007-10-03 11:23:39.000000000 -0400
@@ -21,6 +21,7 @@
#include <libgen.h>
#ifdef USE_AUDIT
#include <libaudit.h>
+#include <time.h>
#ifndef AUDIT_FS_RELABEL
#define AUDIT_FS_RELABEL 2309
@@ -28,6 +29,7 @@
#endif
static int mass_relabel;
static int mass_relabel_errs;
+static time_t starttime;
static FILE *outfile = NULL;
static int force = 0;
@@ -540,6 +542,12 @@
if (!change || user_only_changed)
goto out;
+ if ( (my_sb.st_nlink>1) ) {
+ fprintf(stderr, "warning: %s has hard links\n", my_file);
+ if ( my_sb.st_ctime >= starttime) {
+ fprintf(stderr, "warning: %s changed since run %s\n", my_file, progname);
+ }
+ }
/*
* Relabel the file to the specified context.
*/
@@ -750,6 +758,7 @@
{ SELABEL_OPT_BASEONLY, NULL },
{ SELABEL_OPT_PATH, NULL }
};
+ starttime = time(NULL);
memset(excludeArray, 0, sizeof(excludeArray));
altpath = NULL;