From: Karl MacMillan <kmacmillan@mentalrootkit.com>
To: Jim Meyering <jim@meyering.net>
Cc: SELinux@tycho.nsa.gov
Subject: Re: infelicity in context_user_set; new syscalls: setfileconat, etc.?
Date: Mon, 31 Jul 2006 09:26:43 -0400 [thread overview]
Message-ID: <1154352403.26550.24.camel@localhost.localdomain> (raw)
In-Reply-To: <87zmeslb2v.fsf@rho.meyering.net>
On Sat, 2006-07-29 at 16:50 +0200, Jim Meyering wrote:
> Hello,
>
> I've just discovered what may be a documentation error
> for context_user_set, context_role_set, etc.
>
> Those functions are documented as setting errno upon failure,
> yet the following program prints "failed with errno=0":
>
> #include <stdio.h>
> #include <errno.h>
> #include <selinux/context.h>
>
> int
> main ()
> {
> context_t c = context_new ("a:b:c");
> if (!c)
> return 1;
> errno = 0;
> if (context_user_set (c, ":") != 0)
> printf ("failed with errno=%d\n", errno);
> return 0;
> }
>
Looks like a documentation error to me - there is no attempt to set
errno in the code. In fact, most of libselinux looks like errno will
only get set as a result of a call to a lower level library function
(e.g., open or getxattr).
Can you create a patch to correct the documentation?
<snip>
>
> Has anyone considered adding these system calls?
> getfileconat
> lgetfileconat
> setfileconat
> lsetfileconat
>
> They'd be useful for the same reasons openat, lstatat, etc.
> are useful (and are now in the Linux kernel).
>
Seems much simpler to use fgetfilecon, etc. that take a fd instead of a
path. They can be used in conjunction with openat and do not require a
new system call.
Currently there are no system calls for SELinux and I doubt that there
would be much enthusiasm for them upstream.
Karl
> --
> 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.
>
--
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:[~2006-07-31 13:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-29 14:50 infelicity in context_user_set; new syscalls: setfileconat, etc.? Jim Meyering
2006-07-31 4:58 ` Valdis.Kletnieks
2006-07-31 8:39 ` Jim Meyering
2006-07-31 12:35 ` Russell Coker
2006-07-31 13:27 ` Jim Meyering
2006-07-31 13:26 ` Karl MacMillan [this message]
2006-07-31 13:48 ` Jim Meyering
2006-07-31 14:01 ` Stephen Smalley
2006-07-31 14:21 ` Jim Meyering
2006-07-31 14:02 ` Karl MacMillan
2006-07-31 16:37 ` Jim Meyering
2006-08-01 20:17 ` Stephen Smalley
2006-07-31 13:44 ` 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=1154352403.26550.24.camel@localhost.localdomain \
--to=kmacmillan@mentalrootkit.com \
--cc=SELinux@tycho.nsa.gov \
--cc=jim@meyering.net \
/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.