All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genhomedircon: fix find() return value usage
@ 2007-08-20 20:32 Todd C. Miller
  2007-08-21 18:46 ` Joshua Brindle
  2007-08-23 14:57 ` Stephen Smalley
  0 siblings, 2 replies; 4+ messages in thread
From: Todd C. Miller @ 2007-08-20 20:32 UTC (permalink / raw)
  To: SELinux Mail List

This patch fixes a bug in the genhomedircon python script that would
ignore valid entries such as:

/tmp/\.exchange-USER(/.*)?  system_u:object_r:ROLE_evolution_exchange_tmp_t:s0

With this fix the python genhomedircon and the C replacement produce
equivalent output.

Signed-Off-By: Todd Miller <tmiller@tresys.com>

Index: policycoreutils/scripts/genhomedircon
===================================================================
--- policycoreutils/scripts/genhomedircon	(revision 2519)
+++ policycoreutils/scripts/genhomedircon	(working copy)
@@ -272,7 +272,7 @@
 		ret = ""
 		fd = open(self.getHomeDirTemplate(), 'r')
 		for i in  fd.readlines():
-			if i.find("USER") == 1:
+			if i.find("USER") >= 0:
 				i = i.replace("USER", user)
 				i = i.replace("ROLE", prefix)
 				i = i.replace("system_u", sel_user)

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

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

end of thread, other threads:[~2007-08-23 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 20:32 [PATCH] genhomedircon: fix find() return value usage Todd C. Miller
2007-08-21 18:46 ` Joshua Brindle
2007-08-23 13:40   ` Stephen Smalley
2007-08-23 14:57 ` 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.