mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-14 20:33:48 +00:00
Do not allow empty passwords or passwords with blanks
SVN revision: 1647
This commit is contained in:
parent
204911864b
commit
1b250d7cbb
15
src/elogd.c
15
src/elogd.c
@ -10890,6 +10890,21 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check for blank password */
|
||||||
|
str[0];
|
||||||
|
if (isparam("newpwd"))
|
||||||
|
strlcpy(str, getparam("newpwd"), sizeof(str));
|
||||||
|
if (isparam("hpwd"))
|
||||||
|
strlcpy(str, getparam("hpwd"), sizeof(str));
|
||||||
|
if (str[0] == 0) {
|
||||||
|
show_error(loc("Empty password not allowed"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (strchr(str, ' ')) {
|
||||||
|
show_error(loc("Password may not contain blanks"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* check self register flag */
|
/* check self register flag */
|
||||||
self_register = 0;
|
self_register = 0;
|
||||||
if (getcfg(lbs->name, "Self register", str, sizeof(str)))
|
if (getcfg(lbs->name, "Self register", str, sizeof(str)))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user