CESNET / Nemea-Modules

Base modules of the Nemea system. This repository contains modules for export, replay, filtering, merging etc.
Other
15 stars 20 forks source link

Warning shebang in python scripts/modules #84

Closed cejkato2 closed 4 years ago

cejkato2 commented 6 years ago

The path to python(2) interpreter will be deprecated because of implicit move to python3 in a near future.

Therefore, we should rewrite #!/usr/bin/env python resp. #!/usr/bin/python to #!/usr/bin/env python2 resp. #!/usr/bin/python2.

jaroslavh commented 6 years ago

I have made a script that does that. Does this apply to all files? If yes, just tell me and I will push the fix.

jaroslavh commented 6 years ago

You can see the changes here.

https://github.com/jaroslavh/Nemea-Modules/commit/cf87c84bc69bbacd8dcbcba7bc6264c514d9873d

I have no way to test it other than creating a pull request.

cejkato2 commented 6 years ago

I've tested your commit and got the following output. That means I described the problem in a bad way - sorry.

*** WARNING: ./usr/lib64/liburfilter.la is executable but has empty or no shebang, removing executable bit
mangling shebang in /usr/bin/nemea/unirec2json.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/idea2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/minerdetector2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/amplification2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/sipbf2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/haddrscan2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/bruteforce2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/ddos_detector2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/dnstunnel2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/voipfraud2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/vportscan2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/venom2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/urlblacklist2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/ipblacklist2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/hoststats2idea.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/json_replay.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/json_dump.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/svm-tools/trans_class.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/svm-tools/subset.py from /usr/bin/env python2 to #!/usr/bin/python2
*** WARNING: ./usr/bin/nemea/svm-tools/subr.py is executable but has empty or no shebang, removing executable bit
mangling shebang in /usr/bin/nemea/svm-tools/measure.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/svm-tools/checkdata.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/svm-tools/grid.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/svm-tools/easy.py from /usr/bin/env python2 to #!/usr/bin/python2
mangling shebang in /usr/bin/nemea/svm-tools/binary.py from /usr/bin/env python2 to #!/usr/bin/python2
Processing files: nemea-modules-2.8.1-1.x86_64
jaroslavh commented 6 years ago

Where and how did you test it? I tried to recreate this message and cannot get it.

cejkato2 commented 6 years ago

Localhost, Fedora28. Something like:

git clone ... && cd ... && ./bootstrap.sh && ./configure -q && make rpm
jaroslavh commented 6 years ago

I have tried make distcheck make rpm on our test collector and it works fine without any errors or warning.

cejkato2 commented 6 years ago

Yes, of course, CentOS is fine since it's much older. Fedora tries to remove python2 soon so I guess that's why there is such warning about explicit selection of right python version (2 or 3).

jaroslavh commented 6 years ago

What should we do next then? Rewrite those scripts to python3?

jaroslavh commented 6 years ago

Changed the location of fixed scripts to https://github.com/jaroslavh/Nemea-Modules/commit/cf87c84bc69bbacd8dcbcba7bc6264c514d9873d so please use git pull first - made some not so nice "git magic" in my fork.

cejkato2 commented 4 years ago

This was solved already.