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] Optional rebuild
Date: Mon, 02 Jan 2006 12:06:29 -0500	[thread overview]
Message-ID: <43B95D95.4080509@cornell.edu> (raw)
In-Reply-To: <43B975B3.4000103@tresys.com>


>> This patch uses the modified flags to skip a rebuild whenever possible.
>> It also adds the active boolean header to semanage.h (which I missed 
>> because of diff excludes).
>> It will now commit changes to the active booleans, so if no policy 
>> changes are done (modified = 0), or
>> changes are done, but preservebools is enabled (which it is, by 
>> default), then changes to active
>> booleans in the transaction will work as expected, and will not be 
>> overwritten by policy booleans.
>
> I'm not sure I understand this. If preservebools is enabled the policy 
> must be rebuilt. Looking at the patch it looks like you do rebuild 
> when persistent booleans are changed though.
I'm confused. Here's what the patch does - normally if you commit, you 
will always rebuild policy, and in certain cases, depending on 
preservebools that will cause any changes to active booleans to be 
overwritten (by the booleans in policy). So, if you want to change 
active booleans in a transaction, they might get overwritten for no 
reason. After the patch, if you commit you will only rebuild if 
necessary (if something affectng policy was changed). This means that 
you can have a transaction that changes a bunch of (active) booleans, 
then does a commit, and everything works as expected.

I guess that if you decide to add a bunch of users, and preservebools = 
0, and then add some active booleans, and then commit that still 
wouldn't work, because a rebuild would be forced, and policy booleans 
would take precedence to active boolean changes.
>>
>> This is also an optimization - allows running commit without 
>> rebuilding the policy, which could be beneficial for read-only 
>> operations using a transaction - it also seems more correct, because 
>> a read-only operation should not alter the state of the system - 
>> commit should not apply any changes that weren't explicit.
>
> A commit is by definition a write operation. The user is responsible 
> for  not committing if there aren't any changes.
I disagree - I think it's the other way around. If there aren't any 
changes, then commit should have no effect. If you do writes on commit 
that the user didn't request, that seems broken to me - all changes 
should be initiated by the user. A commit flushes those changes, and 
should have as few side effects as possible. Anyway, I don't see why we 
shouldn't make things a bit faster if we can.




--
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 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23 19:59 [SEMANAGE] Optional rebuild Ivan Gyurdiev
2006-01-02 18:49 ` Joshua Brindle
2006-01-02 17:06   ` Ivan Gyurdiev [this message]

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=43B95D95.4080509@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.