genhomedircon: fix find() return value usage
PATCH 1/1 genhomedircon: fix find() return value usage
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.
scripts/genhomedircon +1 -1
@@ -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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines · Todd C. Miller
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?
Quoted 17 lines
Signed-off-by Todd Miller <[email protected]>Index: policycoreutils/scripts/genhomedircon
===================================================================scripts/genhomedircon +1
-2@@ -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) --
Quoted 5 lines
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] 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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 6 lines · Joshua Brindle
Quoted 5 lines · Todd C. Miller
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
Quoted 7 lines
Quoted 4 lines
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).
Quoted 30 lines
Quoted 18 lines
Signed-off-by Todd Miller <[email protected]>Index: policycoreutils/scripts/genhomedircon
===================================================================scripts/genhomedircon +1
-2@@ -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) --Quoted 5 lines
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] 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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Signature · 8 lines
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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 16 lines · Todd C. Miller
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 <[email protected]>Index: policycoreutils/scripts/genhomedircon
===================================================================
scripts/genhomedircon line 278
Quoted 8 lines
scripts/genhomedircon +1
-1@@ -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.
Signature · 8 lines
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 [email protected] with the words "unsubscribe selinux" without quotes as the message.