* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/
@ 2019-11-08 4:55 Zac Medico
0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2019-11-08 4:55 UTC (permalink / raw
To: gentoo-commits
commit: d156784fd7557e8f5ce8a6de5cd3a6a38a78e436
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 8 04:52:42 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 8 04:54:37 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d156784f
repoman: fix unsafe string interpolation (bug 699508)
Reported-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Bug: https://bugs.gentoo.org/699508
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
repoman/lib/repoman/modules/linechecks/controller.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/repoman/lib/repoman/modules/linechecks/controller.py b/repoman/lib/repoman/modules/linechecks/controller.py
index 7082a5d02..b468e348d 100644
--- a/repoman/lib/repoman/modules/linechecks/controller.py
+++ b/repoman/lib/repoman/modules/linechecks/controller.py
@@ -1,4 +1,6 @@
+from __future__ import unicode_literals
+
import logging
import operator
import os
@@ -136,7 +138,8 @@ class LineCheckController(object):
if not ignore or not ignore.match(line):
e = lc.check(num, line)
if e:
- yield lc.repoman_check_name, e % (num + 1)
+ # String interpolation on the variable e is unsafe because it can contain % characters.
+ yield lc.repoman_check_name, e.replace('on line: %d', 'on line: %d' % strnum + 1)
for lc in checks:
i = lc.end()
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/
@ 2019-11-08 5:43 Zac Medico
0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2019-11-08 5:43 UTC (permalink / raw
To: gentoo-commits
commit: d8879e74458935919a4303f4fd1d2d24eb92e094
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 8 05:42:16 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Nov 8 05:43:26 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d8879e74
Revert "repoman: fix unsafe string interpolation (bug 699508)"
This reverts commit d156784fd7557e8f5ce8a6de5cd3a6a38a78e436.
The 'on line: %d' string fails to match some messages.
Reported-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Bug: https://bugs.gentoo.org/699508
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
repoman/lib/repoman/modules/linechecks/controller.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/repoman/lib/repoman/modules/linechecks/controller.py b/repoman/lib/repoman/modules/linechecks/controller.py
index b468e348d..7082a5d02 100644
--- a/repoman/lib/repoman/modules/linechecks/controller.py
+++ b/repoman/lib/repoman/modules/linechecks/controller.py
@@ -1,6 +1,4 @@
-from __future__ import unicode_literals
-
import logging
import operator
import os
@@ -138,8 +136,7 @@ class LineCheckController(object):
if not ignore or not ignore.match(line):
e = lc.check(num, line)
if e:
- # String interpolation on the variable e is unsafe because it can contain % characters.
- yield lc.repoman_check_name, e.replace('on line: %d', 'on line: %d' % strnum + 1)
+ yield lc.repoman_check_name, e % (num + 1)
for lc in checks:
i = lc.end()
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-08 5:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-08 4:55 [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2019-11-08 5:43 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox