Properly handle an error result from a manager action. This could have left the action list permanently locked for reading.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp 2007-02-16 00:10:17 +00:00
parent 0f51f6577d
commit cd56d84085
1 changed files with 3 additions and 5 deletions

View File

@ -2091,11 +2091,9 @@ static int process_message(struct mansession *s, const struct message *m)
for (tmp = first_action ; tmp; tmp = tmp->next) {
if (strcasecmp(action, tmp->action))
continue;
if ((s->writeperm & tmp->authority) == tmp->authority) {
if (tmp->func(s, m)) { /* error */
return -1;
}
} else
if ((s->writeperm & tmp->authority) == tmp->authority)
ret = tmp->func(s, m);
else
astman_send_error(s, m, "Permission denied");
break;
}