From ec67d7567aed2de1402d3c2307be76faefd7ec4c Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 17 Mar 2006 20:44:25 +0000 Subject: [PATCH] * Fri Mar 17 2006 Dan Walsh 1.30-1 - Update to upstream --- policycoreutils-rhat.patch | 200 ++++++++++++++++++++++++++++--------- 1 file changed, 152 insertions(+), 48 deletions(-) diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index a0f7c39..ec6937c 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -1,15 +1,15 @@ -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/Makefile policycoreutils-1.29.27/Makefile +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/Makefile policycoreutils-1.30/Makefile --- nsapolicycoreutils/Makefile 2005-11-29 10:55:01.000000000 -0500 -+++ policycoreutils-1.29.27/Makefile 2006-03-15 16:06:43.000000000 -0500 ++++ policycoreutils-1.30/Makefile 2006-03-17 15:37:21.000000000 -0500 @@ -1,4 +1,4 @@ -SUBDIRS=setfiles semanage load_policy newrole run_init restorecon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand setsebool po +SUBDIRS=setfiles semanage load_policy newrole run_init restorecon restorecond audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand setsebool po all install relabel clean: @for subdir in $(SUBDIRS); do \ -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/Makefile policycoreutils-1.29.27/restorecond/Makefile +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/Makefile policycoreutils-1.30/restorecond/Makefile --- nsapolicycoreutils/restorecond/Makefile 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/Makefile 2006-03-15 16:08:46.000000000 -0500 ++++ policycoreutils-1.30/restorecond/Makefile 2006-03-17 15:37:21.000000000 -0500 @@ -0,0 +1,29 @@ +# Installation directories. +PREFIX ?= ${DESTDIR}/usr @@ -40,9 +40,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/Makefile pol +clean: + -rm -f restorecond *.o *~ + -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.8 policycoreutils-1.29.27/restorecond/restorecond.8 +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.8 policycoreutils-1.30/restorecond/restorecond.8 --- nsapolicycoreutils/restorecond/restorecond.8 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/restorecond.8 2006-03-15 16:06:43.000000000 -0500 ++++ policycoreutils-1.30/restorecond/restorecond.8 2006-03-17 15:37:21.000000000 -0500 @@ -0,0 +1,31 @@ +.TH "restorecond" "8" "2002031409" "" "" +.SH "NAME" @@ -75,20 +75,16 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond. + +.SH "SEE ALSO" +.BR restorecon (8), -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.c policycoreutils-1.29.27/restorecond/restorecond.c +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.c policycoreutils-1.30/restorecond/restorecond.c --- nsapolicycoreutils/restorecond/restorecond.c 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/restorecond.c 2006-03-15 16:06:43.000000000 -0500 -@@ -0,0 +1,463 @@ ++++ policycoreutils-1.30/restorecond/restorecond.c 2006-03-17 15:43:36.000000000 -0500 +@@ -0,0 +1,462 @@ +/* + * restorecond + * -+ * AUTHOR: Dan Walsh -+ * + * Copyright (C) 2006 Red Hat + * see file 'COPYING' for use and warranty information + * -+ * semanage is a tool for managing SELinux configuration files -+ * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of @@ -104,6 +100,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307 USA + * ++ * Authors: ++ * Dan Walsh ++ * +*/ + +/* @@ -542,25 +541,52 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond. + + return 0; +} -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.conf policycoreutils-1.29.27/restorecond/restorecond.conf +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.conf policycoreutils-1.30/restorecond/restorecond.conf --- nsapolicycoreutils/restorecond/restorecond.conf 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/restorecond.conf 2006-03-15 16:06:43.000000000 -0500 ++++ policycoreutils-1.30/restorecond/restorecond.conf 2006-03-17 15:37:21.000000000 -0500 @@ -0,0 +1,3 @@ +/etc/resolv.conf +/etc/mtab +~/public_html -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.h policycoreutils-1.29.27/restorecond/restorecond.h +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.h policycoreutils-1.30/restorecond/restorecond.h --- nsapolicycoreutils/restorecond/restorecond.h 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/restorecond.h 2006-03-15 16:06:43.000000000 -0500 -@@ -0,0 +1,4 @@ ++++ policycoreutils-1.30/restorecond/restorecond.h 2006-03-17 15:40:56.000000000 -0500 +@@ -0,0 +1,31 @@ ++/* restorecond.h -- ++ * Copyright 2006 Red Hat Inc., Durham, North Carolina. ++ * All Rights Reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Authors: ++ * Dan Walsh ++ * ++ */ ++ ++#ifndef RESTORED_CONFIG_H ++#define RESTORED_CONFIG_H ++ +void exitApp(const char *msg); +void watch_list_add(int inotify_fd, const char *path); + ++#endif + -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.init policycoreutils-1.29.27/restorecond/restorecond.init +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.init policycoreutils-1.30/restorecond/restorecond.init --- nsapolicycoreutils/restorecond/restorecond.init 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/restorecond.init 2006-03-15 16:13:32.000000000 -0500 -@@ -0,0 +1,54 @@ ++++ policycoreutils-1.30/restorecond/restorecond.init 2006-03-17 15:37:21.000000000 -0500 +@@ -0,0 +1,57 @@ +#!/bin/sh +# +# restorecond: Daemo used to maintain path file context @@ -602,6 +628,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond. + stop) + stop + ;; ++ status) ++ status restorecond ++ ;; + restart|reload) + stop + start @@ -615,19 +644,14 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond. +esac + +exit 0 -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist.c policycoreutils-1.29.27/restorecond/stringslist.c +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist.c policycoreutils-1.30/restorecond/stringslist.c --- nsapolicycoreutils/restorecond/stringslist.c 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/stringslist.c 2006-03-15 16:06:43.000000000 -0500 -@@ -0,0 +1,120 @@ ++++ policycoreutils-1.30/restorecond/stringslist.c 2006-03-17 15:42:58.000000000 -0500 +@@ -0,0 +1,118 @@ +/* -+ -+ * AUTHOR: Dan Walsh -+ + * Copyright (C) 2006 Red Hat + * see file 'COPYING' for use and warranty information + * -+ * semanage is a tool for managing SELinux configuration files -+ * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of @@ -643,6 +667,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307 USA + * ++ * Authors: ++ * Dan Walsh ++ * +*/ + +#include @@ -739,10 +766,35 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist. + strings_list_free(list1); +} +#endif -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist.h policycoreutils-1.29.27/restorecond/stringslist.h +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist.h policycoreutils-1.30/restorecond/stringslist.h --- nsapolicycoreutils/restorecond/stringslist.h 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/stringslist.h 2006-03-15 16:06:43.000000000 -0500 -@@ -0,0 +1,10 @@ ++++ policycoreutils-1.30/restorecond/stringslist.h 2006-03-17 15:41:47.000000000 -0500 +@@ -0,0 +1,37 @@ ++/* stringslist.h -- ++ * Copyright 2006 Red Hat Inc., Durham, North Carolina. ++ * All Rights Reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Authors: ++ * Dan Walsh ++ * ++ */ ++#ifndef STRINGSLIST_H ++#define STRINGSLIST_H ++ +struct stringsList { + struct stringsList *next; + char *string; @@ -753,20 +805,18 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist. +void strings_list_print(struct stringsList *list); +int strings_list_find(struct stringsList *list, const char *string); +int strings_list_diff(struct stringsList *from, struct stringsList *to); -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher.c policycoreutils-1.29.27/restorecond/utmpwatcher.c ++ ++#endif +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher.c policycoreutils-1.30/restorecond/utmpwatcher.c --- nsapolicycoreutils/restorecond/utmpwatcher.c 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/utmpwatcher.c 2006-03-15 16:06:43.000000000 -0500 ++++ policycoreutils-1.30/restorecond/utmpwatcher.c 2006-03-17 15:43:12.000000000 -0500 @@ -0,0 +1,105 @@ +/* -+ * restorecond -+ * -+ * AUTHOR: Dan Walsh ++ * utmpwatcher.c + * + * Copyright (C) 2006 Red Hat + * see file 'COPYING' for use and warranty information + * -+ * semanage is a tool for managing SELinux configuration files -+ * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of @@ -782,6 +832,10 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307 USA + * ++ * Authors: ++ * Dan Walsh ++ * ++ * +*/ + +#define _GNU_SOURCE @@ -862,15 +916,42 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher. +#endif + + -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher.h policycoreutils-1.29.27/restorecond/utmpwatcher.h +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher.h policycoreutils-1.30/restorecond/utmpwatcher.h --- nsapolicycoreutils/restorecond/utmpwatcher.h 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.29.27/restorecond/utmpwatcher.h 2006-03-15 16:06:43.000000000 -0500 -@@ -0,0 +1,2 @@ ++++ policycoreutils-1.30/restorecond/utmpwatcher.h 2006-03-17 15:40:46.000000000 -0500 +@@ -0,0 +1,29 @@ ++/* utmpwatcher.h -- ++ * Copyright 2006 Red Hat Inc., Durham, North Carolina. ++ * All Rights Reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Authors: ++ * Dan Walsh ++ * ++ */ ++#ifndef UTMPWATCHER_H ++#define UTMPWATCHER_H ++ +unsigned int utmpwatcher_handle(int inotify_fd, int wd); +void utmpwatcher_add(int inotify_fd, const char *path); -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.29.27/scripts/fixfiles ++ ++#endif +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.30/scripts/fixfiles --- nsapolicycoreutils/scripts/fixfiles 2006-01-04 13:07:46.000000000 -0500 -+++ policycoreutils-1.29.27/scripts/fixfiles 2006-03-15 16:06:43.000000000 -0500 ++++ policycoreutils-1.30/scripts/fixfiles 2006-03-17 15:37:21.000000000 -0500 @@ -124,7 +124,10 @@ exit $? fi @@ -883,9 +964,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc exit $? fi LogReadOnly -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/Makefile policycoreutils-1.29.27/scripts/Makefile +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/Makefile policycoreutils-1.30/scripts/Makefile --- nsapolicycoreutils/scripts/Makefile 2005-12-08 12:59:25.000000000 -0500 -+++ policycoreutils-1.29.27/scripts/Makefile 2006-03-15 16:06:43.000000000 -0500 ++++ policycoreutils-1.30/scripts/Makefile 2006-03-17 15:37:21.000000000 -0500 @@ -13,7 +13,7 @@ -mkdir -p $(BINDIR) install -m 755 $(TARGETS) $(SBINDIR) @@ -895,9 +976,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/Makefile policyc -mkdir -p $(MANDIR)/man8 install -m 644 fixfiles.8 $(MANDIR)/man8/ install -m 644 genhomedircon.8 $(MANDIR)/man8/ -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-1.29.27/semanage/seobject.py +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-1.30/semanage/seobject.py --- nsapolicycoreutils/semanage/seobject.py 2006-03-10 09:48:05.000000000 -0500 -+++ policycoreutils-1.29.27/semanage/seobject.py 2006-03-15 16:06:43.000000000 -0500 ++++ policycoreutils-1.30/semanage/seobject.py 2006-03-17 15:37:21.000000000 -0500 @@ -229,10 +229,9 @@ if rc < 0: raise ValueError("Could not set name for %s" % name) @@ -912,3 +993,26 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/semanage/seobject.py pol rc = semanage_seuser_set_sename(self.sh, u, sename) if rc < 0: +@@ -549,7 +548,7 @@ + raise ValueError("Could not list roles for user %s" % name) + + roles = string.join(rlist, ' '); +- ddict[semanage_user_get_name(u)] = (semanage_user_get_mlslevel(u), semanage_user_get_mlsrange(u), roles) ++ ddict[semanage_user_get_name(u)] = (semanage_user_get_prefix(u), semanage_user_get_mlslevel(u), semanage_user_get_mlsrange(u), roles) + + return ddict + +@@ -559,10 +558,10 @@ + keys.sort() + if is_mls_enabled == 1: + if heading: +- print "\n%-15s %-10s %-30s" % ("", "MLS/", "MLS/") +- print "%-15s %-10s %-30s %s\n" % ("SELinux User", "MCS Level", "MCS Range", "SELinux Roles") ++ print "\n%-15s %-10s %-10s %-30s" % ("", "Labeling", "MLS/", "MLS/") ++ print "%-15s %-10s %-10s %-30s %s\n" % ("SELinux User", "Prefix", "MCS Level", "MCS Range", "SELinux Roles") + for k in keys: +- print "%-15s %-10s %-30s %s" % (k, translate(ddict[k][0]), translate(ddict[k][1]), ddict[k][2]) ++ print "%-15s %-10s %-10s %-30s %s" % (k, ddict[k][0], translate(ddict[k][1]), translate(ddict[k][2]), ddict[k][3]) + else: + if heading: + print "%-15s %s\n" % ("SELinux User", "SELinux Roles")