Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Enno Rehling 2018-12-01 21:24:41 +01:00
commit 3193c74fe2
3 changed files with 13 additions and 2 deletions

View file

@ -9,6 +9,11 @@ if len(sys.argv)<4:
filename=sys.argv[1]
myfaction=sys.argv[2]
mypasswd=sys.argv[3]
quiet=len(sys.argv)<=4
def log(str):
if not quiet:
print(str)
if mypasswd[0] == '"':
mypasswd = mypasswd.strip('"')
@ -16,10 +21,17 @@ if mypasswd[0] == '"':
pw_data = EPasswd()
try:
pw_data.load_database(filename)
log("loaded from db " + filename)
except:
pw_data.load_file(filename)
log("loaded from file " + filename)
if pw_data.fac_exists(myfaction):
if pw_data.check(myfaction, mypasswd):
log("password match: " + myfaction)
sys.exit(0)
log("password mismatch: " + myfaction)
else:
log("faction missing: " + myfaction)
sys.exit(-1)

View file

@ -69,7 +69,7 @@ class EPasswd:
def check(self, id, passwd):
pw = self.get_passwd(id)
if pw[0:4]=='$2a$' or pw[0:4]=='$2y$':
return bcrypt.checkpw(passwd, pw)
return bcrypt.checkpw(passwd.encode('utf8'), pw.encode('utf8'))
return pw == passwd
def get_passwd(self, id):

View file

@ -2239,7 +2239,6 @@ static void eval_trail(struct opstack **stack, const void *userdata)
handle_end = aregs->nregions;
for (i = begin; i < handle_end; ++i) {
region *r = aregs->regions[i];
sbs_strcat(&sbs, ", ");
print_trail(report, r, lang, &sbs);