Fixed interpretation of return value from getfilecon().

This commit is contained in:
Tim Waugh 2010-08-06 16:59:40 +01:00
parent d15ffc545d
commit 35f37f091c
2 changed files with 2 additions and 1 deletions

View File

@ -83,7 +83,7 @@ diff -up patch-2.6/src/patch.c.selinux patch-2.6/src/patch.c
+ if (! inerrno && incontext) + if (! inerrno && incontext)
+ { + {
+ security_context_t outcontext; + security_context_t outcontext;
+ if (! getfilecon (outname, &outcontext) && + if (getfilecon (outname, &outcontext) != -1 &&
+ outcontext && + outcontext &&
+ strcmp(outcontext, incontext) && + strcmp(outcontext, incontext) &&
+ setfilecon (outname, incontext) != 0) + setfilecon (outname, incontext) != 0)

View File

@ -62,6 +62,7 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Fri Aug 6 2010 Tim Waugh <twaugh@redhat.com> 2.6.1-3 * Fri Aug 6 2010 Tim Waugh <twaugh@redhat.com> 2.6.1-3
- Fixed interpretation of return value from getfilecon().
- Fixed argument type for --get (bug #553624). - Fixed argument type for --get (bug #553624).
* Fri Aug 6 2010 Tim Waugh <twaugh@redhat.com> * Fri Aug 6 2010 Tim Waugh <twaugh@redhat.com>