diff --git a/main/manager.c b/main/manager.c index bdb17f8f9ed0b22f9c6a8899b84a1ee869cf0bec..c1b09c2cb65dde0be334f6b50fc6564edab1bf34 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; }