* [ SEMANAGE ] Remove connection requirement from POLICYDB backend
@ 2005-10-18 17:03 Ivan Gyurdiev
2005-10-19 16:13 ` Stephen Smalley
0 siblings, 1 reply; 2+ messages in thread
From: Ivan Gyurdiev @ 2005-10-18 17:03 UTC (permalink / raw)
To: selinux; +Cc: Joshua Brindle, Stephen Smalley
[-- 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [ SEMANAGE ] Remove connection requirement from POLICYDB backend
2005-10-18 17:03 [ SEMANAGE ] Remove connection requirement from POLICYDB backend Ivan Gyurdiev
@ 2005-10-19 16:13 ` Stephen Smalley
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2005-10-19 16:13 UTC (permalink / raw)
To: Ivan Gyurdiev; +Cc: selinux, Joshua Brindle
On Tue, 2005-10-18 at 13:03 -0400, Ivan Gyurdiev wrote:
> 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).
Both patches (default dbase, remove connect) merged as of libsemanage
1.3.24.
--
Stephen Smalley
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@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-10-19 16:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-18 17:03 [ SEMANAGE ] Remove connection requirement from POLICYDB backend Ivan Gyurdiev
2005-10-19 16:13 ` Stephen Smalley
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.