From: Russell Bryant Date: Wed, 15 Dec 2004 23:05:28 +0000 (+0000) Subject: don't allow '#' as a voicemail password (bug #3066) X-Git-Tag: 1.0.11.1~340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a987daf3b64ab00dbfd08cdae48907966b8d22a;p=thirdparty%2Fasterisk.git don't allow '#' as a voicemail password (bug #3066) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4465 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index c5c06ca690..ae2726aa6a 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3124,19 +3124,24 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct } newpassword[1] = '\0'; newpassword[0] = cmd = ast_play_and_wait(chan,"vm-newpassword"); - if (cmd < 0) - break; - if ((cmd = ast_readstring(chan,newpassword + strlen(newpassword),sizeof(newpassword)-1,2000,10000,"#")) < 0) { - break; - } + if (cmd == '#') + newpassword[0] = '\0'; + else { + if (cmd < 0) + break; + if ((cmd = ast_readstring(chan,newpassword + strlen(newpassword),sizeof(newpassword)-1,2000,10000,"#")) < 0) + break; + } newpassword2[1] = '\0'; newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword"); - if (cmd < 0) - break; - - if ((cmd = ast_readstring(chan,newpassword2 + strlen(newpassword2),sizeof(newpassword2)-1,2000,10000,"#"))) { - break; - } + if (cmd == '#') + newpassword2[0] = '\0'; + else { + if (cmd < 0) + break; + if ((cmd = ast_readstring(chan,newpassword2 + strlen(newpassword2),sizeof(newpassword2)-1,2000,10000,"#"))) + break; + } if (strcmp(newpassword, newpassword2)) { ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, newpassword, newpassword2); cmd = ast_play_and_wait(chan, "vm-mismatch");