From 7ef6c19074495110d5c0b698b05c4ee52a0744d6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 Nov 2007 17:42:52 -0800 Subject: Remove pstrings from pam_smbpass - make local_password_change return malloced strings. Jeremy. (This used to be commit f652fe2bdb7a3a36e83dcf4b08347543fdffb9f0) --- source3/web/swat.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/web') diff --git a/source3/web/swat.c b/source3/web/swat.c index e9ed0ded547..95921c0b1de 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -987,8 +987,8 @@ static bool change_password(const char *remote_machine, const char *user_name, int local_flags) { NTSTATUS ret; - pstring err_str; - pstring msg_str; + char *err_str = NULL; + char *msg_str = NULL; if (demo_mode) { printf("%s\n

", _("password change in demo mode rejected")); @@ -1008,14 +1008,16 @@ static bool change_password(const char *remote_machine, const char *user_name, return False; } - ret = local_password_change(user_name, local_flags, new_passwd, err_str, sizeof(err_str), - msg_str, sizeof(msg_str)); + ret = local_password_change(user_name, local_flags, new_passwd, + &err_str, &msg_str); - if(*msg_str) + if(msg_str) printf("%s\n

", msg_str); - if(*err_str) + if(err_str) printf("%s\n

", err_str); + SAFE_FREE(msg_str); + SAFE_FREE(err_str); return NT_STATUS_IS_OK(ret); } -- cgit v1.2.1