From 7b71efd172333fbeb9ffcda45070bacded7a91ba Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Thu, 9 Jan 2025 14:34:39 -0500 Subject: [PATCH] manager.c: Rename restrictedFile to is_restricted_file. Also correct the spelling of 'privileges.' --- main/manager.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/manager.c b/main/manager.c index 5b81420afb..2a543151b2 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2448,7 +2448,7 @@ void astman_live_dangerously(int new_live_dangerously) * \return 1 on restricted file * \return -1 on failure */ -static int restrictedFile(const char *filename) +static int is_restricted_file(const char *filename) { char *stripped_filename; RAII_VAR(char *, path, NULL, ast_free); @@ -2500,9 +2500,9 @@ static int action_getconfig(struct mansession *s, const struct message *m) return 0; } - ret = restrictedFile(fn); + ret = is_restricted_file(fn); if (ret == 1) { - astman_send_error(s, m, "File requires escalated priveledges"); + astman_send_error(s, m, "File requires escalated privileges"); return 0; } else if (ret == -1) { astman_send_error(s, m, "Config file not found"); @@ -2568,9 +2568,9 @@ static int action_listcategories(struct mansession *s, const struct message *m) return 0; } - ret = restrictedFile(fn); + ret = is_restricted_file(fn); if (ret == 1) { - astman_send_error(s, m, "File requires escalated priveledges"); + astman_send_error(s, m, "File requires escalated priveleges"); return 0; } else if (ret == -1) { astman_send_error(s, m, "Config file not found"); @@ -2646,8 +2646,8 @@ static int action_getconfigjson(struct mansession *s, const struct message *m) return 0; } - if (restrictedFile(fn)) { - astman_send_error(s, m, "File requires escalated priveledges"); + if (is_restricted_file(fn)) { + astman_send_error(s, m, "File requires escalated privileges"); return 0; } @@ -3002,8 +3002,8 @@ static int action_updateconfig(struct mansession *s, const struct message *m) astman_send_error(s, m, "Filename not specified"); return 0; } - if (restrictedFile(sfn) || restrictedFile(dfn)) { - astman_send_error(s, m, "File requires escalated priveledges"); + if (is_restricted_file(sfn) || is_restricted_file(dfn)) { + astman_send_error(s, m, "File requires escalated privileges"); return 0; } if (!(cfg = ast_config_load2(sfn, "manager", config_flags))) {