diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-15 22:49:37 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-15 22:49:37 +0000 |
commit | 674979e6e2c36377d7709e934896555cb6777ea5 (patch) | |
tree | c959df0568e98b389b969e27b0d28aa5136ae293 /apps/app_voicemail.c | |
parent | 13a7d48993208605619cbc67af4a526c85c66b38 (diff) |
Don't let you change your password to '#' (bug #3066)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4463 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-x | apps/app_voicemail.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 263388546..5eccd6d40 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3930,6 +3930,8 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct so they won't get here again */ newpassword[1] = '\0'; newpassword[0] = cmd = ast_play_and_wait(chan,"vm-newpassword"); + if (cmd == '#') + newpassword[0] = '\0'; if (cmd < 0 || cmd == 't' || cmd == '#') return cmd; cmd = ast_readstring(chan,newpassword + strlen(newpassword),sizeof(newpassword)-1,2000,10000,"#"); @@ -3937,6 +3939,8 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct return cmd; newpassword2[1] = '\0'; newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword"); + if (cmd == '#') + newpassword2[0] = '\0'; if (cmd < 0 || cmd == 't' || cmd == '#') return cmd; cmd = ast_readstring(chan,newpassword2 + strlen(newpassword2),sizeof(newpassword2)-1,2000,10000,"#"); @@ -4022,18 +4026,26 @@ 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 == '#') + newpassword2[0] = '\0'; + else { + if (cmd < 0) + break; - if ((cmd = ast_readstring(chan,newpassword2 + strlen(newpassword2),sizeof(newpassword2)-1,2000,10000,"#"))) { - 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); |