diff options
-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; } |