From 975055dba8a26b41b88a6cee86a9f34cc23462d3 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Thu, 22 Sep 2005 17:59:42 +0000 Subject: [PATCH] 162037 --- rpm-4.4.2-contextverify.patch | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/rpm-4.4.2-contextverify.patch b/rpm-4.4.2-contextverify.patch index 8685c34..63f53f0 100644 --- a/rpm-4.4.2-contextverify.patch +++ b/rpm-4.4.2-contextverify.patch @@ -1,7 +1,28 @@ -diff -u rpm-4.4.2/lib/verify.c rpm-4.4.2/lib/verify.c ---- rpm-4.4.2/lib/verify.c 2005-07-21 16:47:11.000000000 -0400 -+++ rpm-4.4.2/lib/verify.c 2005-08-26 12:23:35.000000000 -0400 -@@ -138,8 +138,10 @@ +--- rpm-4.4.2/lib/verify.c.contextverify 2005-09-22 13:24:09.000000000 -0400 ++++ rpm-4.4.2/lib/verify.c 2005-09-22 13:38:17.000000000 -0400 +@@ -122,24 +122,29 @@ + */ + /*@-branchstate@*/ + if (selinuxEnabled == 1 && (flags & RPMVERIFY_CONTEXTS)) { +- security_context_t con; ++ security_context_t con = NULL; + + rc = lgetfilecon(fn, &con); + if (rc == -1) + *res |= (RPMVERIFY_LGETFILECONFAIL|RPMVERIFY_CONTEXTS); + else { +- security_context_t fcontext; ++ security_context_t fcontext = NULL; + + /* Get file security context from patterns. */ + if (matchpathcon(fn,fmode,&fcontext) != 0) { + /* Get file security context from package. */ +- fcontext = rpmfiFContext(fi); ++ char * ficontext = NULL; ++ ficontext = rpmfiFContext(fi); ++ fcontext = xmalloc(sizeof(ficontext)); ++ strncpy(fcontext, ficontext, sizeof(ficontext)); + } if (fcontext == NULL || strcmp(fcontext, con)) *res |= RPMVERIFY_CONTEXTS;