diff options
author | Joshua Colp <jcolp@digium.com> | 2007-02-16 00:10:17 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-02-16 00:10:17 +0000 |
commit | cd56d84085261f6388a980d45b7e1045b290efb8 (patch) | |
tree | 60dadc38e049095a86801a2207bb93ed31ad6222 /main | |
parent | 0f51f6577db59b1fc7b7e1e6f9ab885ce4b25dd5 (diff) |
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
Diffstat (limited to 'main')
-rw-r--r-- | main/manager.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/main/manager.c b/main/manager.c index bdb17f8f9..c1b09c2cb 100644 --- a/main/manager.c +++ b/main/manager.c @@ -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; } |