All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gyurdiev <ivg2@cornell.edu>
To: SELinux List <SELinux@tycho.nsa.gov>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Subject: [SEMANAGE] Only do read locking in direct case
Date: Tue, 17 Jan 2006 14:32:22 -0700	[thread overview]
Message-ID: <43CD6266.9060709@cornell.edu> (raw)

[-- 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;

                 reply	other threads:[~2006-01-17 21:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43CD6266.9060709@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=SELinux@tycho.nsa.gov \
    --cc=sds@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.