Bug#312770: asterisk: Does not change password with external application

Tzafrir Cohen Tzafrir Cohen <tzafrir.cohen@xorcom.com>, 312770@bugs.debian.org
Sun, 26 Jun 2005 00:58:05 +0300


--wULyF7TL5taEdwHz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Jun 10, 2005 at 01:37:09AM -0400, Andres Junge wrote:
> Package: asterisk
> Version: 1:1.0.7.dfsg.1-2
> Severity: important
> 
> 
> When one is using the externpass option in voicemail.conf, it does call
> the application but it does not change the vm password internaly.
> Looking at the source code (apps/app_voicemail.c) in function
> vm_change_password_shell() the function reset_user_pw() is not called,
> so the password in the linked list is not updated, one needs to reload
> the application for the chage to take effect.

Reset all passwords for just one password change? Maybe always run
vm_change_password and run the _shell (if the parameter was set) after
that? dpatch attached.

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen@xorcom.com  http://www.xorcom.com

--wULyF7TL5taEdwHz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vm_password_cmd.dpatch"

#! /bin/sh /usr/share/dpatch/dpatch-run
## vm_password_cmd.dpatch by Xorcom Ltd. (software releases key) <support@xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: When using an external script for setting the password, change the 
## DP: current password app_voicemail knows as well. 

@DPATCH@
diff -urNad asterisk-1.0.8.dfsg.1/apps/app_voicemail.c /tmp/dpep.KU2tuq/asterisk-1.0.8.dfsg.1/apps/app_voicemail.c
--- asterisk-1.0.8.dfsg.1/apps/app_voicemail.c	2005-06-26 00:24:13.000000000 +0300
+++ /tmp/dpep.KU2tuq/asterisk-1.0.8.dfsg.1/apps/app_voicemail.c	2005-06-26 00:26:17.000000000 +0300
@@ -3172,10 +3172,10 @@
 				cmd = ast_play_and_wait(chan, "vm-mismatch");
 				break;
 			}
-			if(ast_strlen_zero(ext_pass_cmd)) 
-				vm_change_password(vmu,newpassword);
-			else 
+			vm_change_password(vmu,newpassword);
+			if(! ast_strlen_zero(ext_pass_cmd)) {
 				vm_change_password_shell(vmu,newpassword);
+			}
 			ast_log(LOG_DEBUG,"User %s set password to %s of length %i\n",vms->username,newpassword,(int)strlen(newpassword));
 			cmd = ast_play_and_wait(chan,"vm-passchanged");
 			break;

--wULyF7TL5taEdwHz--