From: <ew...@us...> - 2007-06-11 16:59:47
|
Revision: 2472 http://svn.sourceforge.net/selinux/?rev=2472&view=rev Author: ewalsh Date: 2007-06-11 09:59:43 -0700 (Mon, 11 Jun 2007) Log Message: ----------- Author: Eamon Walsh Email: ew...@ty... Subject: libselinux: class and permission mapping support (try 3) Date: Fri, 08 Jun 2007 13:28:49 -0400 This patch makes avc_reset() exit properly if the AVC was not initialized. Signed-off-by: Eamon Walsh <ew...@ty...> Acked-by: Stephen Smalley <sd...@ty...> Modified Paths: -------------- trunk/libselinux/src/avc.c trunk/libselinux/src/avc_internal.c trunk/libselinux/src/avc_internal.h Modified: trunk/libselinux/src/avc.c =================================================================== --- trunk/libselinux/src/avc.c 2007-06-11 16:59:08 UTC (rev 2471) +++ trunk/libselinux/src/avc.c 2007-06-11 16:59:43 UTC (rev 2472) @@ -225,6 +225,7 @@ avc_netlink_thread = avc_create_thread(&avc_netlink_loop); avc_netlink_trouble = 0; } + avc_running = 1; out: return rc; } @@ -534,6 +535,9 @@ struct avc_node *node, *tmp; errno = 0; + if (!avc_running) + return 0; + avc_get_lock(avc_lock); for (i = 0; i < AVC_CACHE_SLOTS; i++) { @@ -609,6 +613,7 @@ avc_free_lock(avc_lock); avc_free_lock(avc_log_lock); avc_free(avc_audit_buf); + avc_running = 0; } /* ratelimit stuff put aside for now --EFW */ Modified: trunk/libselinux/src/avc_internal.c =================================================================== --- trunk/libselinux/src/avc_internal.c 2007-06-11 16:59:08 UTC (rev 2471) +++ trunk/libselinux/src/avc_internal.c 2007-06-11 16:59:43 UTC (rev 2472) @@ -44,6 +44,7 @@ /* message prefix string and avc enforcing mode */ char avc_prefix[AVC_PREFIX_SIZE] = "uavc"; +int avc_running = 0; int avc_enforcing = 1; int avc_netlink_trouble = 0; Modified: trunk/libselinux/src/avc_internal.h =================================================================== --- trunk/libselinux/src/avc_internal.h 2007-06-11 16:59:08 UTC (rev 2471) +++ trunk/libselinux/src/avc_internal.h 2007-06-11 16:59:43 UTC (rev 2472) @@ -71,6 +71,7 @@ /* message prefix and enforcing mode*/ #define AVC_PREFIX_SIZE 16 extern char avc_prefix[AVC_PREFIX_SIZE] hidden; +extern int avc_running hidden; extern int avc_enforcing hidden; /* user-supplied callback interface for avc */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |