All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gyurdiev <ivg2@cornell.edu>
To: selinux@tycho.nsa.gov
Cc: Joshua Brindle <jbrindle@tresys.com>,
	Stephen Smalley <sds@tycho.nsa.gov>
Subject: [ SEMANAGE ] Remove connection requirement from POLICYDB backend
Date: Tue, 18 Oct 2005 13:03:21 -0400	[thread overview]
Message-ID: <43552AD9.6020701@cornell.edu> (raw)

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

This patch removes the is_connected check from the POLICYDB backend, 
because it doesn't accomplish anything. What we really want to check is 
whether the function was initialized or not (which can't be done at this 
point anyway, because we're _already_ executing this function - this is 
handled by the default database which I added).

Regarding is_connected.... we don't want to check that, because the 
POLICYDB backend will only be used in the policy server itself, which is 
exactly where we do not want a connection (server doesn't connect to 
itself). In the clients using a policy server, we're not using the 
POLICYDB backend - we're using the SERVER backend, where this parameter 
will be checked.

Besides, as is... those databases aren't even initialized if you don't 
call connect, so it's impossible to be executing that function while 
disconnected (although in the future we could initialize a database 
somewhere other than on connect).

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

diff -Naurp --exclude CVS --exclude ChangeLog --exclude VERSION --exclude 'semanage_store*' --exclude 'module_record*' --exclude 'database_directory*' old/libsemanage/src/database_policydb.c new/libsemanage/src/database_policydb.c
--- old/libsemanage/src/database_policydb.c	2005-10-18 10:53:30.000000000 -0400
+++ new/libsemanage/src/database_policydb.c	2005-10-18 12:55:43.000000000 -0400
@@ -155,11 +155,6 @@ static int enter_ro(
 	semanage_handle_t* handle,
 	dbase_policydb_t* dbase) {
 
-	if (!handle->is_connected) {
-		/* FIXME: handle error */
-		return STATUS_ERR;
-	}
-	
 	if (semanage_get_read_lock(handle) < 0) {
 		/* FIXME: handle error */
 		return STATUS_ERR;
@@ -185,11 +180,6 @@ static int enter_rw(
 	semanage_handle_t* handle,
 	dbase_policydb_t* dbase) {
 
-	if (!handle->is_connected) {
-		/* FIXME: handle error */
-		return STATUS_ERR;
-	}
-	
 	if (!handle->is_in_transaction) {
 		/* FIXME: handle error */
 		return STATUS_ERR;

             reply	other threads:[~2005-10-18 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-18 17:03 Ivan Gyurdiev [this message]
2005-10-19 16:13 ` [ SEMANAGE ] Remove connection requirement from POLICYDB backend Stephen Smalley

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=43552AD9.6020701@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=jbrindle@tresys.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@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.