diff --git a/main/manager.c b/main/manager.c index 05e4d4eb69..7113f83aec 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3811,12 +3811,22 @@ static int action_listcategories(struct mansession *s, const struct message *m) struct ast_category *category = NULL; struct ast_flags config_flags = { CONFIG_FLAG_WITHCOMMENTS | CONFIG_FLAG_NOCACHE }; int catcount = 0; + int ret = 0; if (ast_strlen_zero(fn)) { astman_send_error(s, m, "Filename not specified"); return 0; } + ret = restrictedFile(fn); + if (ret == 1) { + astman_send_error(s, m, "File requires escalated priveledges"); + return 0; + } else if (ret == -1) { + astman_send_error(s, m, "Config file not found"); + return 0; + } + if (!(cfg = ast_config_load2(fn, "manager", config_flags))) { astman_send_error(s, m, "Config file not found"); return 0;