Properly handle an error result from a manager action. This could have left the actio...
authorJoshua Colp <jcolp@digium.com>
Fri, 16 Feb 2007 00:10:17 +0000 (00:10 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 16 Feb 2007 00:10:17 +0000 (00:10 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54711 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index bdb17f8..c1b09c2 100644 (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;
        }