From: Joshua Brindle <method@manicmethod.com>
To: Guido Trentalancia <guido@trentalancia.com>
Cc: SELinux@tycho.nsa.gov, ewalsh@tycho.nsa.gov
Subject: Re: Contributed manual pages for libselinux
Date: Fri, 27 Nov 2009 14:23:45 -0500 [thread overview]
Message-ID: <4B102741.4080507@manicmethod.com> (raw)
In-Reply-To: <1258833077.3002.188.camel@tesla.lan>
Guido Trentalancia wrote:
> Hello Eamon !
>
> On Fri, 2009-11-20 at 21:42 -0500, Eamon Walsh wrote:
>
>> Hi, thanks for doing this. Some quick review below.
<snip>
> Yes, I have now mentioned that checkPasswdAccess is deprecated. We are
> referring to file security_compute_av.3 as the description of these two
> functions lives there...
>
> By the way, it has been pointed out that this function should not
> hard-code a string. I also agree with him, there is a generic constant
> for such "passwd" object class, it is defined in flask.h could be used
> instead of the string, thus avoiding hard-coding and also allowing to
> save a few cycles and be theoretically future-proof (if ever the name
> would change, say to "password", "auth-token" or anything else).
>
You can see here:
http://marc.info/?l=selinux&m=118115728003670&w=2
That the way it is now is quite intentional. For many years we relied on
the hardcoded offsets in flask.h and it prevented us from removing, or
reordering object classes. Therefore we now export the values out of the
kernel in /selinux/class and use those values rather than the ones from
flask.h (which hopefully could go away some day.)
> --- libselinux/src/checkAccess.c.orig 2009-11-21 20:07:21.000000000
> +0100
> +++ libselinux/src/checkAccess.c 2009-11-21 20:08:36.000000000
> +0100
> @@ -13,17 +13,12 @@ int selinux_check_passwd_access(access_v
> if (is_selinux_enabled() == 0)
> return 0;
> if (getprevcon_raw(&user_context) == 0) {
> - security_class_t passwd_class;
> struct av_decision avd;
> int retval;
>
> - passwd_class = string_to_security_class("passwd");
> - if (passwd_class == 0)
> - return 0;
> -
> retval = security_compute_av_raw(user_context,
> user_context,
> - passwd_class,
> + SECCLASS_PASSWD,
> requested,
> &avd);
>
--
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.
next prev parent reply other threads:[~2009-11-27 19:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-02 23:57 Contributed manual pages for libselinux Guido Trentalancia
2009-11-21 2:42 ` Eamon Walsh
2009-11-21 19:51 ` Guido Trentalancia
2009-11-27 19:23 ` Joshua Brindle [this message]
2009-11-27 20:03 ` Joshua Brindle
2009-11-21 22:03 ` [PATCH] Support for long-options in policycoreutils and checkpolicy (Ticket #1 [1672486]) Guido Trentalancia
2009-11-27 18:42 ` Joshua Brindle
2009-11-27 19:07 ` Joshua Brindle
2009-11-28 1:56 ` Guido Trentalancia
2009-11-28 1:58 ` Guido Trentalancia
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=4B102741.4080507@manicmethod.com \
--to=method@manicmethod.com \
--cc=SELinux@tycho.nsa.gov \
--cc=ewalsh@tycho.nsa.gov \
--cc=guido@trentalancia.com \
/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.