All of lore.kernel.org
 help / color / mirror / Atom feed
* [SEMANAGE] Only do read locking in direct case
@ 2006-01-17 21:32 Ivan Gyurdiev
  0 siblings, 0 replies; only message in thread
From: Ivan Gyurdiev @ 2006-01-17 21:32 UTC (permalink / raw)
  To: SELinux List; +Cc: Stephen Smalley

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

Pserver shouldn't do locking, and it will go through those same 
functions....
Pserver does locking on the server side, where the resource to be locked 
is located, not on the client side.




[-- Attachment #2: libsemanage.no_pserver_locking.diff --]
[-- Type: text/x-patch, Size: 1024 bytes --]

diff -Naurp --exclude-from excludes old/libsemanage/src/database.c new/libsemanage/src/database.c
--- old/libsemanage/src/database.c	2006-01-17 09:11:06.000000000 -0700
+++ new/libsemanage/src/database.c	2006-01-17 14:28:26.000000000 -0700
@@ -2,6 +2,7 @@
 
 #include <semanage/handle.h>
 #include "semanage_store.h"
+#include "semanage_conf.h"
 #include "database.h"
 #include "debug.h"
 
@@ -28,7 +29,9 @@ static int enter_ro(
 	if (assert_init(handle, dconfig) < 0)
 		goto err;
 
-	if (!handle->is_in_transaction) {
+	if (!handle->is_in_transaction &&
+	     handle->conf->store_type == SEMANAGE_CON_DIRECT) {
+
 		if (semanage_get_active_lock(handle) < 0) {
 			ERR(handle, "could not get the active lock");
 			goto err;
@@ -51,7 +54,8 @@ static inline int exit_ro(
 
 	int commit_num = handle->funcs->get_serial(handle); 
 
-	if (!handle->is_in_transaction) 
+	if (!handle->is_in_transaction && 
+	     handle->conf->store_type == SEMANAGE_CON_DIRECT) 
 		semanage_release_active_lock(handle);
 
 	return commit_num;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-17 21:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-17 21:32 [SEMANAGE] Only do read locking in direct case Ivan Gyurdiev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.