summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>1998-11-12 23:49:32 +0000
committerHerb Lewis <herb@samba.org>1998-11-12 23:49:32 +0000
commitea2fa33f6564389240c4b414e27065a4a01dcfbc (patch)
treefbc90713ab443b46afceedd0a8421087ca39a94b /source3/web
parented6872edeaa66b19445253160dac40bb0eeb7959 (diff)
downloadsamba-ea2fa33f6564389240c4b414e27065a4a01dcfbc.tar.gz
samba-ea2fa33f6564389240c4b414e27065a4a01dcfbc.tar.bz2
samba-ea2fa33f6564389240c4b414e27065a4a01dcfbc.zip
Removed code that used printf/fprintf in password changin libraries.
Now passes strings instead. (This used to be commit 48af29bcc9e8094de6ba057a52dbae3c80ea7a05)
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/swat.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c
index ecfc480395..852d7c0933 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -584,13 +584,21 @@ static BOOL change_password(const char *remote_machine, char *user_name,
char *old_passwd, char *new_passwd,
BOOL add_user, BOOL enable_user, BOOL disable_user)
{
+ BOOL ret = False;
+ pstring err_str;
+ pstring msg_str;
+
if (demo_mode) {
printf("password change in demo mode rejected\n<p>");
return False;
}
if (remote_machine != NULL) {
- return remote_password_change(remote_machine, user_name, old_passwd, new_passwd);
+ ret = remote_password_change(remote_machine, user_name, old_passwd,
+ new_passwd, err_str, sizeof(err_str));
+ if(*err_str)
+ printf("%s\n<p>", err_str);
+ return ret;
}
if(!initialize_password_db()) {
@@ -598,8 +606,16 @@ static BOOL change_password(const char *remote_machine, char *user_name,
return False;
}
- return local_password_change(user_name, False, add_user, enable_user,
- disable_user, False, new_passwd);
+ ret = local_password_change(user_name, False, add_user, enable_user,
+ disable_user, False, new_passwd, err_str, sizeof(err_str),
+ msg_str, sizeof(msg_str));
+
+ if(*msg_str)
+ printf("%\n<p>", msg_str);
+ if(*err_str)
+ printf("%s\n<p>", err_str);
+
+ return ret;
}
/****************************************************************************