From d2dcf94c17aa551f9b30f47092a22ff43d533a98 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 21 Mar 2006 16:17:21 +0000 Subject: [PATCH] * Tue Mar 21 2006 Dan Walsh 1.30.1-2 - make restorecond only ignore non directories with lnk > 1 --- policycoreutils-rhat.patch | 60 +++++++++++++++++++------------------- policycoreutils.spec | 5 +++- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index 1507963..4688d8e 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -1,6 +1,6 @@ -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/audit2allow/audit2allow policycoreutils-1.30/audit2allow/audit2allow +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/audit2allow/audit2allow policycoreutils-1.30.1/audit2allow/audit2allow --- nsapolicycoreutils/audit2allow/audit2allow 2006-03-10 09:48:04.000000000 -0500 -+++ policycoreutils-1.30/audit2allow/audit2allow 2006-03-21 09:17:27.000000000 -0500 ++++ policycoreutils-1.30.1/audit2allow/audit2allow 2006-03-21 11:13:31.000000000 -0500 @@ -27,15 +27,14 @@ import commands, sys, os, pwd, string, getopt, re, selinux @@ -39,18 +39,18 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/audit2allow/audit2allow for s in Scon: for t in Tcon: for c in Class: -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/Makefile policycoreutils-1.30/Makefile +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/Makefile policycoreutils-1.30.1/Makefile --- nsapolicycoreutils/Makefile 2005-11-29 10:55:01.000000000 -0500 -+++ policycoreutils-1.30/Makefile 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/Makefile 2006-03-21 11:13:31.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.30/restorecond/Makefile +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/Makefile policycoreutils-1.30.1/restorecond/Makefile --- nsapolicycoreutils/restorecond/Makefile 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/Makefile 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/restorecond/Makefile 2006-03-21 11:13:31.000000000 -0500 @@ -0,0 +1,29 @@ +# Installation directories. +PREFIX ?= ${DESTDIR}/usr @@ -81,9 +81,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.30/restorecond/restorecond.8 +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.8 policycoreutils-1.30.1/restorecond/restorecond.8 --- nsapolicycoreutils/restorecond/restorecond.8 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/restorecond.8 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/restorecond/restorecond.8 2006-03-21 11:13:31.000000000 -0500 @@ -0,0 +1,31 @@ +.TH "restorecond" "8" "2002031409" "" "" +.SH "NAME" @@ -116,10 +116,10 @@ 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.30/restorecond/restorecond.c +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.c policycoreutils-1.30.1/restorecond/restorecond.c --- nsapolicycoreutils/restorecond/restorecond.c 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/restorecond.c 2006-03-20 22:51:13.000000000 -0500 -@@ -0,0 +1,452 @@ ++++ policycoreutils-1.30.1/restorecond/restorecond.c 2006-03-21 11:13:31.000000000 -0500 +@@ -0,0 +1,451 @@ +/* + * restorecond + * @@ -275,7 +275,6 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond. + security_context_t scontext=NULL; + security_context_t prev_context=NULL; + struct stat st; -+ char path[PATH_MAX+1]; + int fd=-1; + if (debug_mode) + printf("restore %s\n", filename); @@ -293,7 +292,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond. + return; + } + -+ if (st.st_nlink > 1) { ++ if (! (st.st_mode & S_IFDIR) && st.st_nlink > 1) { + syslog(LOG_ERR,"Will not restore a file with more than one hard link (%s) %s\n", filename,strerror(errno)); + close(fd); + return; @@ -572,16 +571,17 @@ 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.30/restorecond/restorecond.conf +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.conf policycoreutils-1.30.1/restorecond/restorecond.conf --- nsapolicycoreutils/restorecond/restorecond.conf 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/restorecond.conf 2006-03-20 22:51:07.000000000 -0500 -@@ -0,0 +1,3 @@ ++++ policycoreutils-1.30.1/restorecond/restorecond.conf 2006-03-21 11:14:22.000000000 -0500 +@@ -0,0 +1,4 @@ +/etc/resolv.conf +/etc/mtab ++/var/run/utmp +~/public_html -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.h policycoreutils-1.30/restorecond/restorecond.h +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.h policycoreutils-1.30.1/restorecond/restorecond.h --- nsapolicycoreutils/restorecond/restorecond.h 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/restorecond.h 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/restorecond/restorecond.h 2006-03-21 11:13:31.000000000 -0500 @@ -0,0 +1,31 @@ +/* restorecond.h -- + * Copyright 2006 Red Hat Inc., Durham, North Carolina. @@ -614,9 +614,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond. + +#endif + -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.init policycoreutils-1.30/restorecond/restorecond.init +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.init policycoreutils-1.30.1/restorecond/restorecond.init --- nsapolicycoreutils/restorecond/restorecond.init 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/restorecond.init 2006-03-20 23:04:15.000000000 -0500 ++++ policycoreutils-1.30.1/restorecond/restorecond.init 2006-03-21 11:13:31.000000000 -0500 @@ -0,0 +1,61 @@ +#!/bin/sh +# @@ -679,9 +679,9 @@ 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.30/restorecond/stringslist.c +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist.c policycoreutils-1.30.1/restorecond/stringslist.c --- nsapolicycoreutils/restorecond/stringslist.c 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/stringslist.c 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/restorecond/stringslist.c 2006-03-21 11:13:31.000000000 -0500 @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2006 Red Hat @@ -801,9 +801,9 @@ 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.30/restorecond/stringslist.h +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist.h policycoreutils-1.30.1/restorecond/stringslist.h --- nsapolicycoreutils/restorecond/stringslist.h 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/stringslist.h 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/restorecond/stringslist.h 2006-03-21 11:13:31.000000000 -0500 @@ -0,0 +1,37 @@ +/* stringslist.h -- + * Copyright 2006 Red Hat Inc., Durham, North Carolina. @@ -842,9 +842,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/stringslist. +int strings_list_diff(struct stringsList *from, struct stringsList *to); + +#endif -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher.c policycoreutils-1.30/restorecond/utmpwatcher.c +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher.c policycoreutils-1.30.1/restorecond/utmpwatcher.c --- nsapolicycoreutils/restorecond/utmpwatcher.c 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/utmpwatcher.c 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/restorecond/utmpwatcher.c 2006-03-21 11:13:31.000000000 -0500 @@ -0,0 +1,105 @@ +/* + * utmpwatcher.c @@ -951,9 +951,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher. +#endif + + -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher.h policycoreutils-1.30/restorecond/utmpwatcher.h +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher.h policycoreutils-1.30.1/restorecond/utmpwatcher.h --- nsapolicycoreutils/restorecond/utmpwatcher.h 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.30/restorecond/utmpwatcher.h 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/restorecond/utmpwatcher.h 2006-03-21 11:13:31.000000000 -0500 @@ -0,0 +1,29 @@ +/* utmpwatcher.h -- + * Copyright 2006 Red Hat Inc., Durham, North Carolina. @@ -984,9 +984,9 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/utmpwatcher. +void utmpwatcher_add(int inotify_fd, const char *path); + +#endif -diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.30/scripts/fixfiles +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.30.1/scripts/fixfiles --- nsapolicycoreutils/scripts/fixfiles 2006-01-04 13:07:46.000000000 -0500 -+++ policycoreutils-1.30/scripts/fixfiles 2006-03-20 22:51:07.000000000 -0500 ++++ policycoreutils-1.30.1/scripts/fixfiles 2006-03-21 11:13:31.000000000 -0500 @@ -124,7 +124,15 @@ exit $? fi diff --git a/policycoreutils.spec b/policycoreutils.spec index a40ad82..197469f 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -5,7 +5,7 @@ Summary: SELinux policy core utilities. Name: policycoreutils Version: 1.30.1 -Release: 1 +Release: 2 License: GPL Group: System Environment/Base Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz @@ -107,6 +107,9 @@ rm -rf ${RPM_BUILD_ROOT} service restorecond condrestart %changelog +* Tue Mar 21 2006 Dan Walsh 1.30.1-2 +- make restorecond only ignore non directories with lnk > 1 + * Tue Mar 21 2006 Dan Walsh 1.30.1-1 - Make audit2allow translate dontaudit as well as allow rules - Update from upstream