Drop useless files in debian/patches
Sophie Brun
6 years ago
0 | Description: create real temporary directory | |
1 | Don't create a ./tmp/* directory in the dir from where you run the | |
2 | command. Create a real temporay directory using tempfile in Python. | |
3 | Author: Sophie Brun <[email protected]> | |
4 | Last-Update: 2017-09-19 | |
5 | --- | |
6 | This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ | |
7 | --- a/osrframework/transforms/lib/configure_maltego.py | |
8 | +++ b/osrframework/transforms/lib/configure_maltego.py | |
9 | @@ -24,6 +24,7 @@ import os | |
10 | import zipfile | |
11 | import argparse | |
12 | import shutil, errno | |
13 | +import tempfile | |
14 | ||
15 | import osrframework | |
16 | import osrframework.utils.configuration as configuration | |
17 | @@ -104,10 +105,12 @@ def zip(pathFolder=None): | |
18 | zf.close() | |
19 | ||
20 | # After everything, deleting the previously created folder | |
21 | - try: | |
22 | - shutil.rmtree(pathFolder) | |
23 | - except: | |
24 | - pass | |
25 | + # folder is created in configureMaltego function / it's removed in | |
26 | + # configureMaltego function too | |
27 | + #try: | |
28 | + # shutil.rmtree(pathFolder) | |
29 | + #except: | |
30 | + # pass | |
31 | ||
32 | return filePath | |
33 | ||
34 | @@ -118,7 +121,7 @@ def configureMaltego(transformsConfigFol | |
35 | settingsFile = "osrframework-maltego-settings" + "_" + VERSION | |
36 | ||
37 | # Defining the full path to the folder in which the configuration files will be created | |
38 | - dst=os.path.join("./", "tmp", settingsFile) | |
39 | + dst=os.path.join(tempfile.mkdtemp(), settingsFile) | |
40 | ||
41 | # copying anything in the config folder | |
42 | copyAnything(src=base, dst=dst) | |
43 | @@ -145,8 +148,8 @@ def configureMaltego(transformsConfigFol | |
44 | print "Moving the .mtz file to the backup folder: " + os.path.join(backupPath, fileName) | |
45 | shutil.copy2(filePath, backupPath) | |
46 | ||
47 | - # Remove tmp files. | |
48 | - shutil.rmtree(os.path.join("./", "tmp")) | |
49 | + # Remove tmp files and directories | |
50 | + shutil.rmtree(dst) | |
51 | ||
52 | if __name__ == "__main__": | |
53 | parser = argparse.ArgumentParser(description='configure_maltego.py - A function to automatically generate Maltego configuration files.', prog='configure_maltego.py', epilog="", add_help=False) |
0 | Description: Drop the check for updates | |
1 | Don't check available updates on pypi. We don't want the user to update | |
2 | with pypi. | |
3 | Author: Sophie Brun <[email protected]> | |
4 | Forwarded: not-needed | |
5 | Last-Update: 2017-09-18 <YYYY-MM-DD, last update of the meta-information, optional> | |
6 | --- | |
7 | This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ | |
8 | --- a/osrframework/osrframework_server.py | |
9 | +++ b/osrframework/osrframework_server.py | |
10 | @@ -58,7 +58,7 @@ import osrframework.usufy as usufy | |
11 | ||
12 | import osrframework.utils.configuration as configuration | |
13 | import osrframework.utils.platform_selection as platform_selection | |
14 | -import osrframework.utils.updates as updates | |
15 | +#import osrframework.utils.updates as updates | |
16 | import osrframework.utils.general as general | |
17 | from osrframework.utils.general import error, warning, success, info, title, emphasis | |
18 | ||
19 | @@ -90,26 +90,26 @@ app = Flask( | |
20 | @app.route("/") | |
21 | def index(): | |
22 | # Getting the status of the current OSRFramework installation | |
23 | - try: | |
24 | - hasUpdates, version = updates.hasUpdatesOnPypi("osrframework") | |
25 | - if hasUpdates: | |
26 | - notice = { | |
27 | - "icon": "warning", | |
28 | - "message": "OSRFramework's version is " + version + ", but there is a new release on Pypi (" + version + "). We encourage you to upgrade soon!" , | |
29 | - "type": "warning" | |
30 | - } | |
31 | - else: | |
32 | - notice = { | |
33 | - "icon": "thumbs-up", | |
34 | - "message": "OSRFramework is updated to the latest version (" + version + ").", | |
35 | - "type": "success" | |
36 | - } | |
37 | - except: | |
38 | - notice = { | |
39 | - "icon": "close", | |
40 | - "message": "OSRFramework Server could not get connected to Pypi to find new versions. Current version is: " + str(osrframework.__version__) + ".", | |
41 | - "type": "error" | |
42 | - } | |
43 | +# try: | |
44 | +# hasUpdates, version = updates.hasUpdatesOnPypi("osrframework") | |
45 | +# if hasUpdates: | |
46 | +# notice = { | |
47 | +# "icon": "warning", | |
48 | +# "message": "OSRFramework's version is " + version + ", but there is a new release on Pypi (" + version + "). We encourage you to upgrade soon!" , | |
49 | +# "type": "warning" | |
50 | +# } | |
51 | +# else: | |
52 | + notice = { | |
53 | + "icon": "thumbs-up", | |
54 | + "message": "OSRFramework", | |
55 | + "type": "success" | |
56 | + } | |
57 | +# except: | |
58 | +# notice = { | |
59 | +# "icon": "close", | |
60 | +# "message": "OSRFramework Server could not get connected to Pypi to find new versions. Current version is: " + str(osrframework.__version__) + ".", | |
61 | +# "type": "error" | |
62 | +# } | |
63 | return render_template('home.html', mt_home='class=current', notice=notice) | |
64 | ||
65 |
0 | Description: Fix exit function | |
1 | When you quit osrfconsole by typing exit, you have an error: | |
2 | "NameError: global name 'info' is not defined" | |
3 | Author: Sophie Brun <[email protected]> | |
4 | Last-Update: 2017-09-05 | |
5 | --- | |
6 | This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ | |
7 | --- a/osrframework/osrfconsole.py | |
8 | +++ b/osrframework/osrfconsole.py | |
9 | @@ -995,7 +995,7 @@ This is free software, and you are welco | |
10 | """ | |
11 | This command will exit osrfconsole normally. | |
12 | """ | |
13 | - print(info("Exiting...")) | |
14 | + print(general.info("Exiting...")) | |
15 | sys.exit() | |
16 | ||
17 |
0 | Description: Fix a syntax error | |
1 | Add a missing parenthesis | |
2 | Author: Sophie Brun <[email protected]> | |
3 | Last-Update: 2017-09-15 | |
4 | --- | |
5 | This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ | |
6 | --- a/osrframework/enumeration.py | |
7 | +++ b/osrframework/enumeration.py | |
8 | @@ -75,7 +75,7 @@ def enumerateURL(urlDict, outputFolder, | |
9 | oF.write(data) | |
10 | else: | |
11 | # The profile was found so we will store it: | |
12 | - print(general.info("Storing resource as:\t" + filename + "...") | |
13 | + print(general.info("Storing resource as:\t" + filename + "...")) | |
14 | with open( outputFolder + "/" + filename, "w") as oF: | |
15 | oF.write(data) | |
16 | except: |