Spring cleanup
This commit is contained in:
parent
515305b108
commit
80779cc2b9
@ -1,46 +0,0 @@
|
||||
From a089634c855312a28f2ff3c2e7c08df5d030e2f5 Mon Sep 17 00:00:00 2001
|
||||
From: Jim Meyering <meyering <at> redhat.com>
|
||||
Date: Tue, 20 May 2008 17:58:42 +0200
|
||||
Subject: [PATCH] install: avoid a leak in currently-ifdef'd-out code
|
||||
|
||||
* src/install.c (setdefaultfilecon)
|
||||
[ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]:
|
||||
Call matchpathcon_init_prefix only once.
|
||||
Suggestion from Stephen Smalley. Reported by Ben Webb in
|
||||
<http://bugzilla.redhat.com/447410>.
|
||||
---
|
||||
src/install.c | 5 ++++-
|
||||
1 files changed, 4 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/install.c b/src/install.c
|
||||
index 964ab36..b531f45 100644
|
||||
--- a/src/install.c
|
||||
+++ b/src/install.c
|
||||
@@ -208,6 +208,8 @@ setdefaultfilecon (char const *file)
|
||||
{
|
||||
struct stat st;
|
||||
security_context_t scontext = NULL;
|
||||
+ static bool first_call = true;
|
||||
+
|
||||
if (selinux_enabled != 1)
|
||||
{
|
||||
/* Indicate no context found. */
|
||||
@@ -216,7 +218,7 @@ setdefaultfilecon (char const *file)
|
||||
if (lstat (file, &st) != 0)
|
||||
return;
|
||||
|
||||
- if (IS_ABSOLUTE_FILE_NAME (file))
|
||||
+ if (first_call && IS_ABSOLUTE_FILE_NAME (file))
|
||||
{
|
||||
/* Calling matchpathcon_init_prefix (NULL, "/first_component/")
|
||||
is an optimization to minimize the expense of the following
|
||||
@@ -247,6 +249,7 @@ setdefaultfilecon (char const *file)
|
||||
}
|
||||
}
|
||||
}
|
||||
+ first_call = false;
|
||||
|
||||
/* If there's an error determining the context, or it has none,
|
||||
return to allow default context */
|
||||
--
|
||||
1.5.5.1.249.g68ef3
|
@ -1,7 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.6 (GNU/Linux)
|
||||
|
||||
iD8DBQBFeKRc/dLerNMzy6ERAiEJAJ435eWCOpfJkoCKoSpnh8Fwwb9XugCgnQ5H
|
||||
SYg6l7M/jyvUdsFM1yS4RKk=
|
||||
=GOOc
|
||||
-----END PGP SIGNATURE-----
|
@ -1,7 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.6 (GNU/Linux)
|
||||
|
||||
iD8DBQBGAvc3/dLerNMzy6ERAnyfAKC4MPj62hCSRYNu0ysD9SahdQvZIACgsNl/
|
||||
CzQjwTNo5FUiiNm0FxtL5Ow=
|
||||
=gl3O
|
||||
-----END PGP SIGNATURE-----
|
@ -1,21 +0,0 @@
|
||||
diff -urNp coreutils-7.2-orig/src/copy.c coreutils-7.2/src/copy.c
|
||||
--- coreutils-7.2-orig/src/copy.c 2009-04-17 15:21:26.000000000 +0200
|
||||
+++ coreutils-7.2/src/copy.c 2009-04-17 15:24:17.000000000 +0200
|
||||
@@ -139,10 +139,13 @@ copy_attr_error (struct error_context *c
|
||||
int err = errno;
|
||||
va_list ap;
|
||||
|
||||
- /* use verror module to print error message */
|
||||
- va_start (ap, fmt);
|
||||
- verror (0, err, fmt, ap);
|
||||
- va_end (ap);
|
||||
+ if (errno != ENOTSUP && errno != ENODATA)
|
||||
+ {
|
||||
+ /* use verror module to print error message */
|
||||
+ va_start (ap, fmt);
|
||||
+ verror (0, err, fmt, ap);
|
||||
+ va_end (ap);
|
||||
+ }
|
||||
}
|
||||
|
||||
static char const *
|
Loading…
x
Reference in New Issue
Block a user