- Strip trailing / for matchpathcon

This commit is contained in:
Daniel J Walsh 2008-12-19 20:17:53 +00:00
parent 0c692a5a64
commit e672e99f9d
2 changed files with 19 additions and 1 deletions

View File

@ -3078,3 +3078,18 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/utils/getdefaultcon.c libseli
- return 0; - return 0;
+ return ret >= 0; + return ret >= 0;
} }
diff --exclude-from=exclude -N -u -r nsalibselinux/utils/matchpathcon.c libselinux-2.0.76/utils/matchpathcon.c
--- nsalibselinux/utils/matchpathcon.c 2008-10-28 10:06:51.000000000 -0400
+++ libselinux-2.0.76/utils/matchpathcon.c 2008-12-19 15:14:20.000000000 -0500
@@ -101,6 +101,11 @@
for (i = optind; i < argc; i++) {
int mode = 0;
struct stat buf;
+ int len = strlen(argv[i]);
+ if (len > 1 && argv[i][len - 1 ] == '/') {
+ argv[i][len - 1 ] = '\0';
+ }
+
if (lstat(argv[i], &buf) == 0)
mode = buf.st_mode;

View File

@ -5,7 +5,7 @@
Summary: SELinux library and simple utilities Summary: SELinux library and simple utilities
Name: libselinux Name: libselinux
Version: 2.0.76 Version: 2.0.76
Release: 5%{?dist} Release: 6%{?dist}
License: Public Domain License: Public Domain
Group: System Environment/Libraries Group: System Environment/Libraries
Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz
@ -163,6 +163,9 @@ exit 0
%{ruby_sitearch}/selinux.so %{ruby_sitearch}/selinux.so
%changelog %changelog
* Tue Dec 16 2008 Dan Walsh <dwalsh@redhat.com> - 2.0.76-6
- Strip trailing / for matchpathcon
* Tue Dec 16 2008 Dan Walsh <dwalsh@redhat.com> - 2.0.76-5 * Tue Dec 16 2008 Dan Walsh <dwalsh@redhat.com> - 2.0.76-5
- Fix segfault if seusers file does not work - Fix segfault if seusers file does not work