From bfb8873e3a3ecd3ac1e795a99a1e71c3ef457fc8 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Jul 27 2005 16:19:22 +0000 Subject: - Fix MLS Free --- diff --git a/libsepol-rhat.patch b/libsepol-rhat.patch index 204cd07..a4ccd03 100644 --- a/libsepol-rhat.patch +++ b/libsepol-rhat.patch @@ -1,11 +1,20 @@ ---- libsepol-1.7.5/src/policydb.c~ 2005-07-18 15:05:31.000000000 -0400 -+++ libsepol-1.7.5/src/policydb.c 2005-07-25 09:36:04.000000000 -0400 -@@ -2428,7 +2428,7 @@ - - len = buf[1]; - if (len != strlen(target_str)) { -- printf("security: policydb string length %zu does not match expected length %zu\n", len, strlen(policydb_str)); -+ printf("security: policydb string length %zu does not match expected length %zu\n", len, strlen(target_str)); - return -1; - } +diff -aur libsepol-1.7.6.orig/src/context.c libsepol-1.7.6.new/src/context.c +--- libsepol-1.7.6.orig/src/context.c 2005-07-26 14:43:30.000000000 -0400 ++++ libsepol-1.7.6.new/src/context.c 2005-07-27 12:10:53.000000000 -0400 +@@ -133,6 +133,7 @@ + char* role = strdup(data->role); + char* type = strdup(data->type); + char* mls = data->mls ? strdup(data->mls): NULL; ++ char* mls_ptr = mls; + scontext = (context_struct_t*) malloc(sizeof(context_struct_t)); + if (!user || !role || !type || (data->mls && !mls) || !scontext) { +@@ -177,7 +178,7 @@ + DEBUG(__FUNCTION__, "mls is enabled, but no mls context found\n"); + goto err_destroy; + } +- if (mls && (mls_context_to_sid(policydb, '$', &mls, scontext) < 0)) { ++ if (mls && (mls_context_to_sid(policydb, '$', &mls_ptr, scontext) < 0)) { + DEBUG(__FUNCTION__, "invalid mls context %s\n", mls); + goto err_destroy; + } diff --git a/libsepol.spec b/libsepol.spec index a06d3a1..6457e9e 100644 --- a/libsepol.spec +++ b/libsepol.spec @@ -1,10 +1,12 @@ Summary: SELinux binary policy manipulation library Name: libsepol Version: 1.7.6 -Release: 1 +Release: 2 License: GPL Group: System Environment/Libraries Source: http://www.nsa.gov/selinux/archives/libsepol-%{version}.tgz +Patch: libsepol-rhat.patch + Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-buildroot Provides: libsepol.so @@ -36,6 +38,7 @@ needed for developing applications that manipulate binary policies. %prep %setup -q +%patch -p1 -b .rhat %build make CFLAGS="%{optflags}" @@ -72,6 +75,9 @@ rm -rf ${RPM_BUILD_ROOT} /%{_lib}/libsepol.so.1 %changelog +* Wed Jul 27 2005 Dan Walsh 1.7.6-2 +- Fix MLS Free + * Mon Jul 25 2005 Dan Walsh 1.7.6-1 - Upgrade to latest from NSA * Merged context reorganization, memory leak fixes,