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, dwalsh@redhat.com
Subject: Re: [ SEPOL ] Extract user records from binary policy
Date: Tue, 27 Sep 2005 15:23:06 -0400	[thread overview]
Message-ID: <43399C1A.60500@cornell.edu> (raw)
In-Reply-To: <1127847506.21671.96.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:

>On Mon, 2005-09-26 at 21:34 -0400, Ivan Gyurdiev wrote:
>  
>
>>>I understand that you are trying to just re-use the existing mls_
>>>functions here, but I think it would be better to alter them or add new
>>>ones that provide a saner interface for this kind of manipulation.  In
>>>particular, the manipulation of str above makes me nervous, even if it
>>>is technically correct.
>>> 
>>>
>>>      
>>>
>>Yes, I agree the mls interface should be improved... so I don't have to 
>>write things like:
>>
>>                if (mls_context_to_sid(policydb, '$', &mls_level, 
>>&context)) {
>>                        DEBUG(__FUNCTION__, "invalid level %s for user 
>>%s\n",
>>                                mls_level, name);
>>                        goto err;
>>                }
>>    
>>
>
>Yes.  The interface did make sense for its original usage, but not for
>the way in which it is being used here. 
>  
>
Well, I could define a new function which allocates the string (after 
computing proper length), writes to it, and returns a valid ptr... 
however that's just moving the potential point of failure from two calls 
in users.c into one function in mls.c....

Like this?

int sepol_mls_struct_to_string(policydb_t* policydb, context_struct_t* 
mls, char** str).
int sepol_mls_struct_from_string(policydb_t* policydb, char* str, 
context_struct_t** mls).

--
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-09-27 19:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-24  5:21 [ SEPOL ] Extract user records from binary policy Ivan Gyurdiev
2005-09-24  5:31 ` Ivan Gyurdiev
2005-09-26 19:19   ` Stephen Smalley
2005-09-27  1:34     ` Ivan Gyurdiev
2005-09-27 18:58       ` Stephen Smalley
2005-09-27 19:23         ` Ivan Gyurdiev [this message]
2005-09-27 19:23           ` 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=43399C1A.60500@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=dwalsh@redhat.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.