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

* Re: [PATCH] genhomedircon: fix find() return value usage
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Joshua Brindle @ 2007-08-21 18:46 UTC (permalink / raw)
  To: Todd C. Miller; +Cc: SELinux Mail List

Todd C. Miller wrote:
> 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.
>
>   
Note that this is for the stable branch only, since it conflicts with 
the pending genhomedircon replacement patch for trunk. Does anyone 
object to this going into stable?

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



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

* Re: [PATCH] genhomedircon: fix find() return value usage
  2007-08-21 18:46 ` Joshua Brindle
@ 2007-08-23 13:40   ` Stephen Smalley
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Smalley @ 2007-08-23 13:40 UTC (permalink / raw)
  To: Joshua Brindle; +Cc: Todd C. Miller, SELinux Mail List

On Tue, 2007-08-21 at 14:46 -0400, Joshua Brindle wrote:
> Todd C. Miller wrote:
> > 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.
> >
> >   
> Note that this is for the stable branch only, since it conflicts with 
> the pending genhomedircon replacement patch for trunk. Does anyone 
> object to this going into stable?

I'll actually merge it to both trunk and stable - we should have a fixed
version on both prior to merging the new functionality (if it ever
works).

> 
> > 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.
> >
> >   
> 
> 
> 
> --
> 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.
-- 
Stephen Smalley
National Security Agency


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

* Re: [PATCH] genhomedircon: fix find() return value usage
  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 14:57 ` Stephen Smalley
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Smalley @ 2007-08-23 14:57 UTC (permalink / raw)
  To: Todd C. Miller; +Cc: SELinux Mail List

On Mon, 2007-08-20 at 16:32 -0400, Todd C. Miller wrote:
> 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)
> 

Thanks, merged to stable and trunk.

-- 
Stephen Smalley
National Security Agency


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