All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fwd: Re: seobject.py setransRecords.get_all method return values]
@ 2007-04-11 18:10 Ted X Toth
  2007-04-12 16:22 ` Stephen Smalley
  0 siblings, 1 reply; 2+ messages in thread
From: Ted X Toth @ 2007-04-11 18:10 UTC (permalink / raw)
  To: selinux

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-12 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-11 18:10 [Fwd: Re: seobject.py setransRecords.get_all method return values] Ted X Toth
2007-04-12 16:22 ` Stephen Smalley

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.