From ea2fa33f6564389240c4b414e27065a4a01dcfbc Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Thu, 12 Nov 1998 23:49:32 +0000 Subject: Removed code that used printf/fprintf in password changin libraries. Now passes strings instead. (This used to be commit 48af29bcc9e8094de6ba057a52dbae3c80ea7a05) --- source3/utils/smbpasswd.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index e9d0e3d313..2adb6d9523 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -220,16 +220,32 @@ static BOOL password_change(const char *remote_machine, char *user_name, BOOL disable_user, BOOL set_no_password, BOOL trust_account) { + BOOL ret; + pstring err_str; + pstring msg_str; + if (remote_machine != NULL) { if (add_user || enable_user || disable_user || set_no_password || trust_account) { /* these things can't be done remotely yet */ return False; } - 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) + fprintf(stderr, err_str); + return ret; } - return local_password_change(user_name, trust_account, add_user, enable_user, - disable_user, set_no_password, new_passwd); + ret = local_password_change(user_name, trust_account, add_user, enable_user, + disable_user, set_no_password, new_passwd, + err_str, sizeof(err_str), msg_str, sizeof(msg_str)); + + if(*msg_str) + printf(msg_str); + if(*err_str) + fprintf(stderr, err_str); + + return ret; } -- cgit