- Fix strip_con call
This commit is contained in:
parent
96ff98944c
commit
b86cfc3a43
@ -1,6 +1,6 @@
|
||||
diff --exclude-from=exclude -N -u -r nsalibselinux/include/selinux/selinux.h libselinux-1.26/include/selinux/selinux.h
|
||||
--- nsalibselinux/include/selinux/selinux.h 2005-09-01 11:17:40.000000000 -0400
|
||||
+++ libselinux-1.26/include/selinux/selinux.h 2005-09-14 13:47:09.000000000 -0400
|
||||
+++ libselinux-1.26/include/selinux/selinux.h 2005-09-16 14:16:26.000000000 -0400
|
||||
@@ -304,6 +304,12 @@
|
||||
extern int selinux_getenforcemode(int *enforce);
|
||||
|
||||
@ -16,29 +16,34 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/include/selinux/selinux.h lib
|
||||
configuration files exist.
|
||||
diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-1.26/src/matchpathcon.c
|
||||
--- nsalibselinux/src/matchpathcon.c 2005-08-24 09:07:11.000000000 -0400
|
||||
+++ libselinux-1.26/src/matchpathcon.c 2005-09-14 13:47:09.000000000 -0400
|
||||
@@ -25,6 +25,20 @@
|
||||
+++ libselinux-1.26/src/matchpathcon.c 2005-09-16 14:21:02.000000000 -0400
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <regex.h>
|
||||
#include <stdarg.h>
|
||||
#include "policy.h"
|
||||
+#include <selinux/context.h>
|
||||
|
||||
static void
|
||||
#ifdef __GNUC__
|
||||
@@ -25,6 +26,17 @@
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
+#define STRIP_LEVEL(CON) \
|
||||
+ if (! mls_enabled) { \
|
||||
+ int i=0; \
|
||||
+ int ctr=0; \
|
||||
+ while (CON[i]) { \
|
||||
+ if (CON[i] == ':') ctr++; \
|
||||
+ if (ctr==3) { \
|
||||
+ CON[i]=0; \
|
||||
+ break; \
|
||||
+ } \
|
||||
+ i++; \
|
||||
+ } \
|
||||
+ security_context_t newcon; \
|
||||
+ context_t con=context_new(CON); \
|
||||
+ context_range_set(con,NULL); \
|
||||
+ newcon=strdup(context_str(con));\
|
||||
+ context_free(con); \
|
||||
+ freecon(CON); \
|
||||
+ CON=newcon; \
|
||||
+ }
|
||||
+
|
||||
static void (*myprintf)(const char *fmt, ...) = &default_printf;
|
||||
|
||||
void set_matchpathcon_printf(void (*f)(const char *fmt, ...))
|
||||
@@ -415,7 +429,7 @@
|
||||
@@ -415,7 +427,7 @@
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -47,7 +52,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux
|
||||
int items, len, regerr;
|
||||
char *buf_p;
|
||||
char *regex, *type, *context;
|
||||
@@ -438,6 +452,7 @@
|
||||
@@ -438,6 +450,7 @@
|
||||
} else if (items == 2) {
|
||||
/* The type field is optional. */
|
||||
free(context);
|
||||
@ -55,7 +60,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux
|
||||
context = type;
|
||||
type = 0;
|
||||
}
|
||||
@@ -510,7 +525,7 @@
|
||||
@@ -510,7 +523,7 @@
|
||||
}
|
||||
|
||||
skip_type:
|
||||
@ -64,7 +69,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux
|
||||
spec_arr[nspec].context = context;
|
||||
|
||||
if (strcmp(context, "<<none>>")) {
|
||||
@@ -557,6 +572,7 @@
|
||||
@@ -557,6 +570,7 @@
|
||||
unsigned int lineno, pass, i, j, maxnspec;
|
||||
spec_t *spec_copy=NULL;
|
||||
int status=-1;
|
||||
@ -72,7 +77,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux
|
||||
|
||||
/* Open the specification file. */
|
||||
if (!path)
|
||||
@@ -590,20 +606,20 @@
|
||||
@@ -590,20 +604,20 @@
|
||||
lineno = 0;
|
||||
nspec = 0;
|
||||
while (getline(&line_buf, &line_len, fp) > 0 && nspec < maxnspec) {
|
||||
@ -98,7 +103,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux
|
||||
|
||||
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux_config.c libselinux-1.26/src/selinux_config.c
|
||||
--- nsalibselinux/src/selinux_config.c 2005-03-17 14:56:21.000000000 -0500
|
||||
+++ libselinux-1.26/src/selinux_config.c 2005-09-14 13:47:09.000000000 -0400
|
||||
+++ libselinux-1.26/src/selinux_config.c 2005-09-16 14:16:26.000000000 -0400
|
||||
@@ -85,6 +85,29 @@
|
||||
|
||||
static int use_compat_file_path;
|
||||
|
@ -1,7 +1,7 @@
|
||||
Summary: SELinux library and simple utilities
|
||||
Name: libselinux
|
||||
Version: 1.26
|
||||
Release: 4
|
||||
Release: 5
|
||||
License: Public domain (uncopyrighted)
|
||||
Group: System Environment/Libraries
|
||||
Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz
|
||||
@ -86,6 +86,9 @@ rm -rf ${RPM_BUILD_ROOT}
|
||||
%{_mandir}/man8/*
|
||||
|
||||
%changelog
|
||||
* Tue Sep 12 2005 Dan Walsh <dwalsh@redhat.com> 1.26-5
|
||||
- Fix strip_con call
|
||||
|
||||
* Tue Sep 12 2005 Dan Walsh <dwalsh@redhat.com> 1.26-3
|
||||
- Go back to original libsetrans code
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user