Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[DATALAB-3099]: added nmap exe removal #1787

Merged
merged 2 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
sys.exit(1)

logging.info("Disable scp on nodes")
remove_scp_binary(args.user)
remove_scp_nmap_binary(args.user)

#logging.info("Updating openssh to version")
#ensure_openssh_version(args.user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,12 @@ def find_java_path_local():
sys.exit(1)


def remove_scp_binary(os_user):
def remove_scp_nmap_binary(os_user):
try:
if not exists(datalab.fab.conn, '/home/{}/.ensure_dir/remove_scp_binary'.format(os_user)):
if not exists(datalab.fab.conn, '/home/{}/.ensure_dir/remove_scp_nmap_binary'.format(os_user)):
datalab.fab.conn.sudo('rm /usr/bin/scp')
datalab.fab.conn.sudo('touch /home/{}/.ensure_dir/remove_scp_binary'.format(os_user))
datalab.fab.conn.sudo('rm /usr/share/nmap/nselib/data/psexec/nmap_service.exe > /dev/null; echo $?')
datalab.fab.conn.sudo('touch /home/{}/.ensure_dir/remove_scp_nmap_binary'.format(os_user))
except Exception as err:
logging.error('Updating openssh to version:', str(err))
traceback.print_exc()
Expand Down