lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 9 Sep 2021 12:28:43 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Nick Desaulniers <ndesaulniers@...gle.com>,
        Kortan <kortanzh@...il.com>
Cc:     masahiroy@...nel.org, linux-kbuild@...r.kernel.org,
        llvm@...ts.linux.dev, clang-built-linux@...glegroups.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] gen_compile_commands: fix missing 'sys' package

On 9/9/2021 10:22 AM, 'Nick Desaulniers' via Clang Built Linux wrote:
> On Tue, Sep 7, 2021 at 8:30 PM Kortan <kortanzh@...il.com> wrote:
>>
>> We need to import the 'sys' package since the script has called
>> sys.exit() method.
>>
>> Signed-off-by: Kortan <kortanzh@...il.com>
> 
> I'm quite sure I've run this script before; how have we not noticed
> such an issue before?

Nobody hitting the error paths in this script?

$ cat test.py
import sys

if __name__ == '__main__':
     a = int(sys.argv[1])
     print("a = %d" % a)
     if a == 2:
         printf(os.uname())

$ python3 test.py 1

$ python3 test.py 2
a = 2
Traceback (most recent call last):
   File "/home/nathan/test.py", line 7, in <module>
     print(os.uname())
NameError: name 'os' is not defined

>> ---
>> Changes v1 -> v2:
>> * Fix commit title.
>> * Improve commit message.
>>
>>   scripts/clang-tools/gen_compile_commands.py | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py
>> index 0033eedce003..1d1bde1fd45e 100755
>> --- a/scripts/clang-tools/gen_compile_commands.py
>> +++ b/scripts/clang-tools/gen_compile_commands.py
>> @@ -13,6 +13,7 @@ import logging
>>   import os
>>   import re
>>   import subprocess
>> +import sys
>>
>>   _DEFAULT_OUTPUT = 'compile_commands.json'
>>   _DEFAULT_LOG_LEVEL = 'WARNING'
>> --
>> 2.33.0
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ