All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ted X Toth <txtoth@gmail.com>
To: selinux@tycho.nsa.gov
Subject: [Fwd: Re: seobject.py setransRecords.get_all method return values]
Date: Wed, 11 Apr 2007 13:10:52 -0500	[thread overview]
Message-ID: <461D24AC.8040601@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Re: seobject.py setransRecords.get_all method return values --]
[-- Type: message/rfc822, Size: 2826 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 1114 bytes --]

On 4/10/07, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On Mon, 2007-04-09 at 14:08 -0500, Ted X Toth wrote:
> > When you have aliases in your setrans.conf
> > seobject.setransRecords().get_all returns a dictionary containing values
> > with the last alias whereas the first alias  is what I'd like (this is
> > also what the os uses). Alternatively it could return an ordered list of
> > all of the aliases as the dictionary values or maybe this would be a
> > different method.
>
> Unless such a change would pose a problem for current users of
> seobject.setransRecords().get_all, I'd be fine with changing it to
> return the first alias, and possibly introduce another method if we need
> to return all the aliases (to preserve interface compatibility).  cc'd
> Dan and Karl since they are likely to be more familiar with how this is
> being used today by tools like system-config-selinux.
>
> Do you want to submit a patch or are you making a RFE?
>
> --
> Stephen Smalley
> National Security Agency
>
>
Here's a patch for the first versus last alias. I'm not sure yet about
needing all of the aliases.

Ted

[-- Attachment #2.1.2: seobject.patch --]
[-- Type: text/x-patch, Size: 379 bytes --]

--- seobject.py.orig	2007-01-12 10:05:12.000000000 -0600
+++ seobject.py	2007-04-10 08:49:47.000000000 -0500
@@ -154,7 +154,8 @@
 			if len(i) != 2:
 				self.comments.append(r)
 				continue
-			self.ddict[i[0]] = i[1]
+                        if self.ddict.has_key(i[0]) == 0:
+                               self.ddict[i[0]] = i[1]
 
 	def get_all(self):
 		return self.ddict

             reply	other threads:[~2007-04-11 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11 18:10 Ted X Toth [this message]
2007-04-12 16:22 ` [Fwd: Re: seobject.py setransRecords.get_all method return values] 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=461D24AC.8040601@gmail.com \
    --to=txtoth@gmail.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.