All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Ivan Gyurdiev <ivg2@cornell.edu>,
	Darrel Goeddel <dgoeddel@TrustedCS.com>,
	Karl MacMillan <kmacmillan@tresys.com>,
	SELinux <SELinux@tycho.nsa.gov>
Subject: Re: Doing testing with MCS looks like we get initial roles/levels by using fromcon.
Date: Fri, 16 Sep 2005 15:23:24 -0400	[thread overview]
Message-ID: <432B1BAC.9000800@redhat.com> (raw)
In-Reply-To: <1126896683.27393.100.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:

>On Fri, 2005-09-16 at 14:39 -0400, Daniel J Walsh wrote:
>  
>
>>Not sure how the admim would set this up.  I was thinking the admin 
>>would just state that
>>when dwalsh logs in I want this as his preferred context.  Policy could 
>>allow or modify the preferred context
>>as it sees fit.
>>    
>>
>
>No, I don't think we want them specifying a full context.  Considering
>it further, I don't think they should even specify the role.  They can
>just specify a SELinux username and a range, and let the rest of the
>context (role, type) be computed based on policy in the usual manner, so
>that we can still have per-fromcon roles and types for a given user.
>
>  
>
>>Correct and this translation would be purely option from libselinux 
>>point of view.  pam and other freinds need it.
>>    
>>
>
>But if pam and other SELinux userland depends on it and you put it into
>libsetrans, then it has to be provided by every libsetrans
>implementation, not just yours.  At which point it would be better to
>have it in a separate library that doesn't have multiple instances.  
>
>  
>
>>Yes.  This might be a reason to change the function call, although as 
>>your example showed it
>>might it be disconcerting from the user to request he logs in as role 
>>(nurse_r) but gets user_r when logging in locally.
>>    
>>
>
>Admin should just specify that the Linux user default to nurse_u and
>s0:c0,c3 and let the usual rules apply to role and type selection for
>nurse_u.
>
>  
>
Ok do you want a function like the following

int get_ordered_context_list_with_level (const char *user,
                     security_context_t fromcon,     
                     const char *level,
                     security_context_t **list)
{
    int rc;
    int freefrom = 0;
    security_context_t newcon=NULL;
    context_t con;

    if (!fromcon) {
    rc = getcon(&fromcon);
    if (rc < 0)
        return rc;
    freefrom = 1;
    }
    con=context_new(fromcon);
    context_range_set(con, level);
    newcon=strdup(context_str(con));
    context_free(con);

    rc = get_ordered_context_list (user, newcon, list);
    freecon(newcon);
    if (freefrom)
        freecon(fromcon);
    return rc;
}

Then we defined a functions

getseuserinfo(const char *username,  char **seusername,  char **selevel)


so pam calls
getseuserinfo(dwalsh, &sename, &selevel);
get_ordered_context_list_with_level(sename, 0, level, &conlist);

-- 



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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4329DF91.2060208@redhat.com>
     [not found] ` <1126873821.25919.20.camel@moss-spartans.epoch.ncsc.mil>
2005-09-16 17:24   ` Doing testing with MCS looks like we get initial roles/levels by using fromcon Daniel J Walsh
2005-09-16 18:15     ` Stephen Smalley
2005-09-16 18:39       ` Daniel J Walsh
2005-09-16 18:51         ` Stephen Smalley
2005-09-16 19:23           ` Daniel J Walsh [this message]
2005-09-16 19:34             ` Stephen Smalley
2005-09-16 20:30               ` Daniel J Walsh
2005-09-19 15:50                 ` 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=432B1BAC.9000800@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=SELinux@tycho.nsa.gov \
    --cc=dgoeddel@TrustedCS.com \
    --cc=ivg2@cornell.edu \
    --cc=kmacmillan@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.