All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gyurdiev <ivg2@cornell.edu>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov, Daniel J Walsh <dwalsh@redhat.com>,
	Karl MacMillan <kmacmillan@tresys.com>
Subject: Re: [ SEMANAGE ] Replace semanage debugging system
Date: Tue, 11 Oct 2005 10:29:44 -0400	[thread overview]
Message-ID: <434BCC58.7030509@cornell.edu> (raw)
In-Reply-To: <1129039592.3308.110.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:
> On Tue, 2005-10-11 at 09:34 -0400, Stephen Smalley wrote:
>   
>> An obvious concern about the new msg_write function is that it requires
>> memory allocation itself.  Thus, on a memory allocation failure in the
>> caller, we might easily end up dropping the out of memory error message
>> due to lack of available memory at this point.
>>     
>
> More generally, I'm not sure why msg_write writes the formatted string
> to a private buffer and passes the new msg type to the callback,
> requiring the callback to call *_get methods, versus just having the
> callback be a stdarg function that takes all of the arguments (plus
> auxiliary data) directly.
>   
Taking all of the arguments directly is bad - does not respond well to 
change, and I've already changed this at least 3 times. However, we 
could take 1) the void* arg, 2) the message structure (auxilary data) 2) 
the fmt, and 3) the variadic list..and I think that would be flexible 
enough. I changed it, because I thought this would be a simpler, and 
more intuitive interface, but I can change it back..

> Other comments:
>
> diff -Naur --exclude CVS --exclude ChangeLog --exclude VERSION --exclude libselinux --exclude policy_components.c old/libsemanage/src/direct_api.c exp/libsemanage/src/direct_api.c
> --- old/libsemanage/src/direct_api.c	2005-10-07 18:37:59.000000000 -0400
> +++ exp/libsemanage/src/direct_api.c	2005-10-11 02:34:29.000000000 -0400
> @@ -268,11 +268,23 @@
>  		goto cleanup;
>  	}
>  
> -	/* expand and verify the resulting policy */
> -	if (semanage_expand_sandbox(sh, base) < 0 ||
> -	    semanage_verify_kernel(sh) != 0) {
> +	/* Expand the resulting policy */
> +	if (semanage_expand_sandbox(sh, base) < 0)
> +		goto cleanup;
> +
> +#if 0
> +	/* Link components into base policy */
> +	if (semanage_base_merge_components(sh, NULL /* FIXME */) < 0)
> +		goto cleanup;
> +
> +	/* Commit changes to components */
> +	if (semanage_commit_components(sh) < 0)
> +		goto cleanup;
> +#endif
> +
> +	/* Verify policy */
> +	if (semanage_verify_kernel(sh) != 0)
>  		goto cleanup;
> -	}
>
> Why wouldn't the above steps occur as part of semanage_expand_sandbox()?
>   
...I suppose it could go there as well..

--
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:[~2005-10-11 14:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-11  6:59 [ SEMANAGE ] Replace semanage debugging system Ivan Gyurdiev
2005-10-11  9:03 ` [ SEPOL ] Another " Ivan Gyurdiev
2005-10-11 14:45   ` Stephen Smalley
2005-10-11 15:11     ` Ivan Gyurdiev
2005-10-11 15:15       ` Stephen Smalley
2005-10-11 15:51         ` Stephen Smalley
2005-10-11 13:34 ` [ SEMANAGE ] Replace semanage " Stephen Smalley
2005-10-11 14:06   ` Stephen Smalley
2005-10-11 14:29     ` Ivan Gyurdiev [this message]
2005-10-11 14:30       ` Stephen Smalley
2005-10-11 14:57         ` Ivan Gyurdiev
2005-10-11 14:46           ` Stephen Smalley
2005-10-11 15:18             ` Ivan Gyurdiev
2005-10-11 15:19               ` Stephen Smalley
2005-10-11 16:35                 ` Ivan Gyurdiev
2005-10-11 17:27           ` Ivan Gyurdiev
2005-10-11 17:23             ` Stephen Smalley
2005-10-11 14:15   ` Ivan Gyurdiev
2005-10-11 14:24     ` 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=434BCC58.7030509@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=dwalsh@redhat.com \
    --cc=kmacmillan@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.