From: Kodungallur Varma <ramgwu@gmail.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov
Subject: Re: problems using setcon()
Date: Mon, 28 Mar 2005 22:55:57 -0500 [thread overview]
Message-ID: <fa8ec5d8050328195571c9d4fc@mail.gmail.com> (raw)
In-Reply-To: <1110812772.21378.79.camel@moss-spartans.epoch.ncsc.mil>
Hi Stephen and all,
the following setconexample.c(attachment) really did help me,
but I have one more issue. I dont have the context_str() function. I
installed the 2.6.11.5 kernel and tried to apply patches mentioned in
the NSA website. I updated to the checkpolicy-1.22, libselinux-1.22,
policycoreutils-1.22, ibsepol-1.4. I dont know if I am supposed to
upgrade to the above. I wanted to update to apply the patch-2.6.11.6.
but I could not execute it and I dont know how to apply it. I wonder
why I dont have just the context_str().
also, when I make load from the directory
/etc/selinux/strict/src/policy/, I have the following errors:
Validating file_contexts ...
/usr/sbin/setfiles -q -c /etc/selinux/strict/policy/policy.19
/etc/selinux/strict/contexts/files/file_contexts
/usr/sbin/load_policy /etc/selinux/strict/policy/policy.19
sepol_genusers: Can't load system.users: No such file or directory
/usr/sbin/load_policy: Error while setting user configuration from
/etc/selinux/strict/users//{local.users,system.users}: No such file
or directory
/usr/sbin/load_policy: security_load_policy failed
make: *** [tmp/load] Error 3
why is the above occuring??
any help would do a great deal to completion of my thesis. thanx in advance..
Ram
On Mon, 14 Mar 2005 10:06:12 -0500, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Fri, 2005-03-11 at 21:35 -0500, Kodungallur Varma wrote:
> > I came to know that I cant simply cast a string into a security
> > identifier as shown below. insted I found out that I have to use
> > security_compute_create().
>
> No, you can directly construct context strings; you just have to ensure
> that they are valid contexts or the kernel will reject them. The
> easiest approach is to use getcon() to get the current context, then use
> the context_new(), context_type_set(), context_str() functions to create
> a context string with a modified type field, and then call setcon() on
> the resulting context string. security_compute_create() is appropriate
> when you want to get a context based on a type_transition rule in the
> policy (for an exec-based process transition or a file creation), but
> that is not what you are doing. Sample program below should work for
> you, assuming appropriate policy and a kernel that supports dynamic
> context transitions (>= 2.6.11 for the mainline kernel). Policy would
> need can_setcon() for the domain and allow <olddomain>
> <newdomain>:process dyntransition; (the domain_auto_trans rules are for
> exec-based transitions only).
>
> --
> Stephen Smalley <sds@tycho.nsa.gov>
> National Security Agency
>
>
>
--
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:[~2005-03-29 3:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-09 4:08 problems using setcon() Kodungallur Varma
2005-03-09 8:46 ` Thomas Bleher
2005-03-12 2:35 ` Kodungallur Varma
2005-03-14 15:06 ` Stephen Smalley
2005-03-29 3:55 ` Kodungallur Varma [this message]
2005-03-29 14:37 ` Stephen Smalley
2005-03-30 3:41 ` Kodungallur Varma
2005-03-30 12:35 ` Stephen Smalley
2005-04-20 2:09 ` attributes on the other end of a network connection Kodungallur Varma
2005-04-20 3:44 ` James Morris
2005-04-20 12:19 ` Stephen Smalley
2005-05-04 15:30 ` Kodungallur Varma
2005-05-05 11:28 ` 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=fa8ec5d8050328195571c9d4fc@mail.gmail.com \
--to=ramgwu@gmail.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.