SHA256
1
0
forked from pool/rpmlint
rpmlint/issue_68_BinariesCheck_lower_memory-3.patch

36 lines
1.6 KiB
Diff
Raw Normal View History

From f61aab52fdcbdc9096f2346ee4ecf9668d8a0fbc Mon Sep 17 00:00:00 2001
From: StefanBruens <stefan.bruens@rwth-aachen.de>
Date: Wed, 29 Jun 2016 18:28:55 +0200
Subject: [PATCH 2/3] Use default bufsize, move regex compile to common place
---
BinariesCheck.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Index: rpmlint-rpmlint-1.8/BinariesCheck.py
===================================================================
--- rpmlint-rpmlint-1.8.orig/BinariesCheck.py
+++ rpmlint-rpmlint-1.8/BinariesCheck.py
@@ -64,6 +64,8 @@ class BinaryInfo:
setuid_call_regex = create_regexp_call(['setresuid', 'seteuid', 'setuid'])
setgroups_call_regex = create_regexp_call(['initgroups', 'setgroups'])
chroot_call_regex = create_regexp_call('chroot')
+ # 401eb8: e8 c3 f0 ff ff callq 400f80 <chdir@plt>
+ objdump_call_regex = re.compile(b'callq?\s(.*)')
forbidden_functions = Config.getOption("WarnOnFunction")
if forbidden_functions:
@@ -234,11 +236,8 @@ class BinaryInfo:
if self.chroot and self.chdir:
p = subprocess.Popen(
['env', 'LC_ALL=C', 'objdump', '-d', path],
- stdout=subprocess.PIPE, bufsize=1)
+ stdout=subprocess.PIPE, bufsize=-1)
with p.stdout:
- # we want that :
- # 401eb8: e8 c3 f0 ff ff callq 400f80 <chdir@plt>
- objdump_call_regex = re.compile(b'callq?\s(.*)')
index = 0
chroot_index = -99
chdir_index = -99