From c1e059f7646280064b3c3c239c306895eec48c89 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 6 Jan 2009 15:44:49 +0000 Subject: [PATCH] - Fix restorecon python code --- libselinux-rhat.patch | 4 ++-- libselinux.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index aac0b92..a48f969 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -110,7 +110,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux.py libselinux-2.0 + +def restorecon(path, recursive=False): + """ Restore SELinux context on a given path """ -+ mode = os.stat(path)[stat.ST_MODE] ++ mode = os.lstat(path)[stat.ST_MODE] + status, context = matchpathcon(path, mode) + if status == 0: + lsetfilecon(path, context) @@ -153,7 +153,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libs + +def restorecon(path, recursive=False): + """ Restore SELinux context on a given path """ -+ mode = os.stat(path)[stat.ST_MODE] ++ mode = os.lstat(path)[stat.ST_MODE] + status, context = matchpathcon(path, mode) + if status == 0: + lsetfilecon(path, context) diff --git a/libselinux.spec b/libselinux.spec index e3ee98c..47b8182 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -5,7 +5,7 @@ Summary: SELinux library and simple utilities Name: libselinux Version: 2.0.77 -Release: 1%{?dist} +Release: 2%{?dist} License: Public Domain Group: System Environment/Libraries Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz @@ -164,6 +164,9 @@ exit 0 %{ruby_sitearch}/selinux.so %changelog +* Tue Jan 6 2009 Dan Walsh - 2.0.77-2 +- Fix restorecon python code + * Tue Jan 6 2009 Dan Walsh - 2.0.77-1 - Update to upstream