From: Karl MacMillan <kmacmillan@mentalrootkit.com>
To: Daniel J Walsh <dwalsh@redhat.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>, SE Linux <selinux@tycho.nsa.gov>
Subject: Re: chcat changes (Was: Re: policycoreutils patch)
Date: Wed, 21 Feb 2007 11:37:37 -0500 [thread overview]
Message-ID: <45DC7551.9090200@mentalrootkit.com> (raw)
In-Reply-To: <45DB3637.7080400@redhat.com>
Daniel J Walsh wrote:
> Stephen Smalley wrote:
>> On Tue, 2007-02-20 at 09:50 -0500, Daniel J Walsh wrote:
>>
>>> chcat fixes:
>>> * Broken stderr handling fix
>>> * if serange ends in a ":" chop it off.
>>> * Switch chcat to exec semanage rather than use builtin so that
>>> proper transitions happen, otherwise I would have to run chcat under
>>> an semanage context.
>>>
>>
>> Why would a range end in a ":"? Context translation issue?
>>
>>
> No.
> new_serange = "%s-%s:%s" % (serange[0], top[0], string.join(cats,
> ","))
> if new_serange[-1:] == ":":
> new_serange = new_serange[:-1]
> If you did not have cats you would end up with s0-s0:
>
Then why not something more direct (completely untested):
new_serange = "%s-%s" % (searange[0], top[0])
new_cats = ",".join(cats)
if new_cats != '':
new_serange = new_serange + ":" + new_cats
I think that the list subscripting with -1 and : is confusing to
non-python programmers. Also, I think that use of string.join is
discouraged in favor of using the join method on strings - though that
likely looks as odd as a -1 index to a non-python programmer.
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.
next prev parent reply other threads:[~2007-02-21 16:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <45DB0AB8.3070803@redhat.com>
2007-02-20 16:17 ` newrole O_NONBLOCK change (Was: Re: policycoreutils patch) Stephen Smalley
2007-02-20 17:42 ` Daniel J Walsh
2007-02-20 17:58 ` Linda Knippers
2007-02-20 16:22 ` chcat changes " Stephen Smalley
2007-02-20 17:56 ` Daniel J Walsh
2007-02-21 16:37 ` Karl MacMillan [this message]
2007-02-21 17:22 ` policycoreutils patch 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=45DC7551.9090200@mentalrootkit.com \
--to=kmacmillan@mentalrootkit.com \
--cc=dwalsh@redhat.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.