fix of wrong preserving of security context in install - by

upstream(#319231)
This commit is contained in:
Ondrej Vasik 2007-11-13 15:11:37 +00:00
parent 13c6ce058c
commit 40985b1e0d
2 changed files with 25 additions and 7 deletions

View File

@ -2223,18 +2223,32 @@
+#endif
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
@@ -523,6 +613,10 @@
default:
@@ -503,6 +591,7 @@
static bool
change_attributes (char const *name)
{
+ bool ok = false;
/* chown must precede chmod because on some systems,
chown clears the set[ug]id bits for non-superusers,
resulting in incorrect permissions.
@@ -521,9 +610,14 @@
else if (chmod (name, mode) != 0)
error (0, errno, _("cannot change permissions of %s"), quote (name));
else
return true;
- return true;
+ ok = true;
+
+#ifdef WITH_SELINUX
+ if (use_default_selinux_context)
+ setdefaultfilecon(name);
+ setdefaultfilecon (name);
+#endif
return false;
- return false;
+ return ok;
}
/* Set the timestamps of file TO to match those of file FROM.
@@ -687,6 +781,11 @@
-T, --no-target-directory treat DEST as a normal file\n\
-v, --verbose print the name of each directory as it is created\n\

View File

@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 6.9
Release: 12%{?dist}
Release: 13%{?dist}
License: GPLv2+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -287,6 +287,10 @@ fi
/sbin/runuser
%changelog
* Tue Nov 13 2007 Ondrej Vasik <ovasik@redhat.com> - 6.9-13
- fixed bug in selinux patch which caused bad preserving
of security context in install(#319231)
* Fri Nov 02 2007 Ondrej Vasik <ovasik@redhat.com> - 6.9-12
- added some upstream supported dircolors TERMs(#239266)
- fixed du output for unaccesible dirs(#250089)