From 1b250d7cbb13208462981572a82b885f5a1a8fb2 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Mon, 6 Feb 2006 15:52:30 +0000 Subject: [PATCH] Do not allow empty passwords or passwords with blanks SVN revision: 1647 --- src/elogd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/elogd.c b/src/elogd.c index 65e9d18e..9c816cd2 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -10890,6 +10890,21 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate) 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 */ self_register = 0; if (getcfg(lbs->name, "Self register", str, sizeof(str)))