password anti-disclosure for python script

This commit is contained in:
2015-07-10 14:25:02 +03:00
parent e39023e6fd
commit 36241cc688
2 changed files with 11 additions and 5 deletions

View File

@@ -5,7 +5,12 @@ import pexpect
# Read variables of first and second given argument
user = str(sys.argv[1])
password = str(sys.argv[2])
passwordfile = str(sys.argv[2])
# Read content of passwordfile and put as variable "password"
with open (passwordfile, "r") as myfile:
password=myfile.read().replace('\n', '')
# Define function
def _vchangepw(user, password):