[PATCH] libselinux: save errno value in avc_has_perm()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The errno value set by avc_has_perm_noaudit() is being lost somewhere in the bowels of avc_audit(). This patch saves it off so it doesn't get lost.

Signed-off-by: Eamon Walsh <ewalsh@xxxxxxxxxxxxx>
---

libselinux/src/avc.c |    4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)


Index: libselinux/src/avc.c
===================================================================
--- libselinux/src/avc.c	(revision 2811)
+++ libselinux/src/avc.c	(working copy)
@@ -874,10 +874,12 @@
		 struct avc_entry_ref *aeref, void *auditdata)
{
	struct av_decision avd = { 0, 0, 0, 0, 0 };
-	int rc;
+	int errsave, rc;

	rc = avc_has_perm_noaudit(ssid, tsid, tclass, requested, aeref, &avd);
+	errsave = errno;
	avc_audit(ssid, tsid, tclass, requested, &avd, rc, auditdata);
+	errno = errsave;
	return rc;
}


--
Eamon Walsh <ewalsh@xxxxxxxxxxxxx>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux