All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gyurdiev <ivg2@cornell.edu>
To: Joshua Brindle <jbrindle@tresys.com>
Cc: SELinux List <SELinux@tycho.nsa.gov>,
	Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [SEMANAGE] Commit numbers for ro database calls
Date: Mon, 02 Jan 2006 11:56:16 -0500	[thread overview]
Message-ID: <43B95B30.4040108@cornell.edu> (raw)
In-Reply-To: <43B97479.90101@tresys.com>


>> Next we should take advantage of commit numbers to only re-read the 
>> cache on ro calls when the commit number has changed.
>
> It only matters when you read more than 1 thing at a time. AFAIK this 
> only happens in semanage for selinux users. 
I think we're talking about different things - my comment was about 
library performance - not re-caching unless we have to (particularly in 
the policydb case, which is slower). You seem to be referring to using 
commit numbers in the client to prevent races (which, I agree, is 
another thing that needs to be done).
> However, there are queries done outside a transaction and then a 
> transaction started (mostly error handling, eg: Seuser already 
> defined), technically a race but inconsequential since there is error 
> handling in libsemanage. My example (pywrap-test) implementation makes 
> the transaction window as small as possible since it is a 
> discretionary lock but any libsemanage user needs to be careful with 
> this, perhaps something we should document.
Yes....
In general, is there any documentation about libsemanage (API?)
Or should we start writing that, and how? I don't know how to use any 
doc. software yet
(not even writing manpages), so I'd have to learn. Someone complained 
about lack of
documentation of the seusers format earlier.

>>
>> ----
>> I don't like how dependency on semanage_store.c is creeping into 
>> database.c.
>> (but it was there to begin with - active_lock, and so on...) - might 
>> need to reorganize some of this later..
>
> This is because database.c is handling locking when it should really 
> only be handled by semanage_store, since locks are a property of the 
> store. 
The database only signals when we're entering and exiting. The store is 
responsible for managing the lock files, and the details of locking. Not 
sure how else you'd have it done...

> The database (file backend) implementation reads files directly out of 
> the store which is probably broken. Not sure if it is even worth 
> fixing though, since there is already support for non-file backends 
> that seems to work.
How is it broken? How should it read the data?



--
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.

  reply	other threads:[~2006-01-02 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23 11:28 [SEMANAGE] Commit numbers for ro database calls Ivan Gyurdiev
2006-01-02 18:44 ` Joshua Brindle
2006-01-02 16:56   ` Ivan Gyurdiev [this message]
2006-01-02 19:11     ` Joshua Brindle
2006-01-02 17:17       ` Ivan Gyurdiev
2006-01-02 19:20         ` Joshua Brindle
2006-01-03 20:39       ` 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=43B95B30.4040108@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=SELinux@tycho.nsa.gov \
    --cc=jbrindle@tresys.com \
    --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.