- Fix MLS Free

This commit is contained in:
Daniel J Walsh 2005-07-27 16:19:22 +00:00
parent b0f7b63f5f
commit bfb8873e3a
2 changed files with 26 additions and 11 deletions

View File

@ -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;
}

View File

@ -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 <dwalsh@redhat.com> 1.7.6-2
- Fix MLS Free
* Mon Jul 25 2005 Dan Walsh <dwalsh@redhat.com> 1.7.6-1
- Upgrade to latest from NSA
* Merged context reorganization, memory leak fixes,