diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-11-12 07:32:33 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-11-12 07:32:33 +0000 |
commit | 6bf01d58ca4240a765be5042b9a3a3217b115fbf (patch) | |
tree | 079954d7fc4e18774d1a661e23966f0db257e045 | |
parent | 27d96564cebae49cb7e1a5e360e5e9f99d10fbb0 (diff) | |
download | samba-6bf01d58ca4240a765be5042b9a3a3217b115fbf.tar.gz samba-6bf01d58ca4240a765be5042b9a3a3217b115fbf.tar.bz2 samba-6bf01d58ca4240a765be5042b9a3a3217b115fbf.zip |
handle null usernames
(This used to be commit ee60d9a289f8d94f8e4d8405f7b41690b891bbb1)
-rw-r--r-- | source3/web/swat.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c index f5c8e286cd..a1e56e9389 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -661,7 +661,7 @@ static void chg_passwd(void) ****************************************************************************/ static void passwd_page(void) { - char *new_name; + char *new_name = get_user_name(); printf("<H2>Password Manager</H2>\n"); @@ -673,14 +673,11 @@ static void passwd_page(void) * After the first time through here be nice. If the user * changed the User box text to another users name, remember it. */ - if (cgi_variable(USER) && - (strcmp(cgi_variable(USER), get_user_name()))) { - /* User is changing another accounts passwd */ + if (cgi_variable(USER)) { new_name = cgi_variable(USER); - } else { - /* User is changing there own passwd */ - new_name = get_user_name(); - } + } + + if (!new_name) new_name = ""; printf("<p> User Name : <input type=text size=30 name=%s value=%s> \n", USER, new_name); |