* Thu Aug 31 2006 Dan Walsh <dwalsh@redhat.com> 1.30.27-4

- Add -i qualified to restorecon to tell it to ignore files that do not exist
- Fixfiles also modified for this change
This commit is contained in:
Daniel J Walsh 2006-08-31 15:11:57 +00:00
parent 18b9b3adf9
commit 9361ca2bd0
2 changed files with 103 additions and 2 deletions

View File

@ -26431,6 +26431,94 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/po/zu.po policycoreutils
#, c-format
msgid "authentication failed.\n"
msgstr ""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecon/restorecon.8 policycoreutils-1.30.27/restorecon/restorecon.8
--- nsapolicycoreutils/restorecon/restorecon.8 2006-08-28 16:58:19.000000000 -0400
+++ policycoreutils-1.30.27/restorecon/restorecon.8 2006-08-31 10:58:50.000000000 -0400
@@ -4,10 +4,10 @@
.SH "SYNOPSIS"
.B restorecon
-.I [\-o outfilename ] [\-R] [\-n] [\-v] [\-e directory ] pathname...
+.I [-i] [\-o outfilename ] [\-R] [\-n] [\-v] [\-e directory ] pathname...
.P
.B restorecon
-.I \-f infilename [\-o outfilename ] [\-e directory ] [\-R] [\-n] [\-v] [\-F]
+.I [-i] \-f infilename [\-o outfilename ] [\-e directory ] [\-R] [\-n] [\-v] [\-F]
.SH "DESCRIPTION"
This manual page describes the
@@ -23,6 +23,9 @@
.SH "OPTIONS"
.TP
+.B \-i
+ignore files that do not exist
+.TP
.B \-f infilename
infilename contains a list of files to be processed by application. Use \- for stdin.
.TP
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecon/restorecon.c policycoreutils-1.30.27/restorecon/restorecon.c
--- nsapolicycoreutils/restorecon/restorecon.c 2006-08-28 16:58:19.000000000 -0400
+++ policycoreutils-1.30.27/restorecon/restorecon.c 2006-08-31 11:03:43.000000000 -0400
@@ -11,6 +11,7 @@
* restorecon [-Rnv] pathname...
*
* -e Specify directory to exclude
+ * -i Ignore error if file does not exist
* -n Do not change any file labels.
* -v Show changes in file labels.
* -o filename save list of files with incorrect context
@@ -47,6 +48,7 @@
static char *progname;
static int errors = 0;
static int recurse = 0;
+static int file_exist = 1;
static int force = 0;
#define STAT_BLOCK_SIZE 1
static int pipe_fds[2] = { -1, -1 };
@@ -129,7 +131,7 @@
void usage(const char *const name)
{
fprintf(stderr,
- "usage: %s [-FnrRv] [-e excludedir ] [-o filename ] [-f filename | pathname... ]\n",
+ "usage: %s [-iFnrRv] [-e excludedir ] [-o filename ] [-f filename | pathname... ]\n",
name);
exit(1);
}
@@ -160,6 +162,8 @@
}
if (lstat(filename, &st) != 0) {
+ if (!file_exist && errno == ENOENT)
+ return 0;
fprintf(stderr, "lstat(%s) failed: %s\n", filename,
strerror(errno));
return 1;
@@ -319,6 +323,8 @@
close(pipe_fds[1]);
if (rc == -1 || rc > 0) {
if (nftw(buf, apply_spec, 1024, FTW_PHYS)) {
+ if (!file_exist && errno == ENOENT)
+ return;
fprintf(stderr,
"%s: error while labeling files under %s\n",
progname, buf);
@@ -350,11 +356,14 @@
exit(0);
set_matchpathcon_flags(MATCHPATHCON_NOTRANS);
- while ((opt = getopt(argc, argv, "pFrRnvf:o:e:")) > 0) {
+ while ((opt = getopt(argc, argv, "ipFrRnvf:o:e:")) > 0) {
switch (opt) {
case 'n':
change = 0;
break;
+ case 'i':
+ file_exist = 0;
+ break;
case 'r':
case 'R':
recurse = 1;
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.init policycoreutils-1.30.27/restorecond/restorecond.init
--- nsapolicycoreutils/restorecond/restorecond.init 2006-08-28 16:58:19.000000000 -0400
+++ policycoreutils-1.30.27/restorecond/restorecond.init 2006-08-31 07:04:34.000000000 -0400
@ -26449,7 +26537,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecond/restorecond.
# Source function library.
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.30.27/scripts/fixfiles
--- nsapolicycoreutils/scripts/fixfiles 2006-08-28 16:58:19.000000000 -0400
+++ policycoreutils-1.30.27/scripts/fixfiles 2006-08-24 14:35:03.000000000 -0400
+++ policycoreutils-1.30.27/scripts/fixfiles 2006-08-31 11:04:33.000000000 -0400
@@ -48,7 +48,7 @@
# Log to either syslog or a LOGFILE
#
@ -26459,3 +26547,12 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc
echo $1 >> $LOGFILE
fi
}
@@ -118,7 +118,7 @@
fi
if [ ! -z "$RPMFILES" ]; then
for i in `echo $RPMFILES | sed 's/,/ /g'`; do
- rpmlist $i | ${RESTORECON} ${OUTFILES} ${FORCEFLAG} -R $* -f - 2>&1 >> $LOGFILE
+ rpmlist $i | ${RESTORECON} ${OUTFILES} ${FORCEFLAG} -i -R $* -f - 2>&1 >> $LOGFILE
done
exit $?
fi

View File

@ -5,7 +5,7 @@
Summary: SELinux policy core utilities.
Name: policycoreutils
Version: 1.30.27
Release: 3
Release: 4
License: GPL
Group: System Environment/Base
Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz
@ -119,6 +119,10 @@ fi
[ -x /sbin/service ] && /sbin/service restorecond condrestart
%changelog
* Thu Aug 31 2006 Dan Walsh <dwalsh@redhat.com> 1.30.27-4
- Add -i qualified to restorecon to tell it to ignore files that do not exist
- Fixfiles also modified for this change
* Thu Aug 31 2006 Dan Walsh <dwalsh@redhat.com> 1.30.27-3
- Ignore sigpipe