From: Daniel J Walsh <dwalsh@redhat.com>
To: Joe Nall <joe@nall.com>
Cc: SELinux List <selinux@tycho.nsa.gov>
Subject: Re: Help with python seobject.loginRecords
Date: Wed, 11 Mar 2009 16:49:17 -0400 [thread overview]
Message-ID: <49B823CD.3090409@redhat.com> (raw)
In-Reply-To: <F1007BB4-8898-4A05-B09A-4FB1EF8519A2@nall.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Joe Nall wrote:
>
> On Mar 11, 2009, at 2:35 PM, Daniel J Walsh wrote:
>
>> On 03/11/2009 12:15 PM, Joe Nall wrote:
>>> I need to add login mappings in python firstboot modules during system
>>> configuration. In my first module a simple:
>>>
>>> seobject.loginRecords().add(username, "siterep_u",
>>> "SystemLow-SystemHigh")
>>>
>>> works. In subsequent modules, I get an exception:
>>>
>>> libsemanage.enter_rw: this operation requires a transaction
>>> libsemanage.enter_rw: could not enter read-write section
>>> Traceback (most recent call last):
>>> File "./t", line 6, in <module>
>>> seobject.loginRecords().add("test3", "sysadm_u", "SystemLow-SystemHigh")
>>> File "/usr/lib64/python2.5/site-packages/seobject.py", line 442, in add
>>> raise error
>>> ValueError: Could not add login mapping for test3
>>>
>>> What is the right way to do this?
>>>
>>> joe
>>>
>>>
>>> --
>>> 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.
>> Probably an MLS issue. firtstboot is running in a context that is not
>> allowed to lock/manage selinux.
>
> I'm installing in permissive and switching to enforcing after firstboot.
> You are correct that firstboot_t doesn't have the policy for all the
> stuff I'm trying to do yet.
>
>> You probably should exec semanage rather then calling seobject so you
>> could do a transition and not have to give a huge app like first boot
>> the ability to manage security policy.
>
> That is what is installing right now. I would still like an
> explanation/code snippet of correct usage for future use
>
> joe
>
>
This works on F10 Targeted policy
# python -c "import seobject; seobject.loginRecords().add("pwalsh",
"staff_u", "s0")
# python -c 'import seobject; seobject.loginRecords().delete("pwalsh")'
Could it be a translation problem?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAkm4I80ACgkQrlYvE4MpobPITACgj0orf8wCagcwCJS0oPLnnlqP
oPQAoJfLLAn5mTAQ2uem/RFhZj4M3qqW
=rYfA
-----END PGP SIGNATURE-----
--
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-03-11 20:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-11 16:15 Help with python seobject.loginRecords Joe Nall
2009-03-11 19:35 ` Daniel J Walsh
2009-03-11 19:50 ` Joe Nall
2009-03-11 20:16 ` Daniel J Walsh
2009-03-11 20:36 ` Joe Nall
2009-03-11 20:49 ` Daniel J Walsh [this message]
2009-03-11 21:00 ` Stephen Smalley
2009-03-12 13:29 ` Daniel J Walsh
2009-04-22 21:08 ` Chad Sellers
2009-05-18 15:28 ` Joshua Brindle
2009-03-11 21:07 ` Joe Nall
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=49B823CD.3090409@redhat.com \
--to=dwalsh@redhat.com \
--cc=joe@nall.com \
--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.