mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
manager.c: Rename restrictedFile to is_restricted_file.
Also correct the spelling of 'privileges.'
(cherry picked from commit 27cc5f5071
)
This commit is contained in:
committed by
Asterisk Development Team
parent
0cae901c97
commit
913557e7d2
@@ -3698,7 +3698,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);
|
||||
@@ -3750,9 +3750,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");
|
||||
@@ -3818,9 +3818,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");
|
||||
@@ -3898,8 +3898,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;
|
||||
}
|
||||
|
||||
@@ -4254,8 +4254,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))) {
|
||||
|
Reference in New Issue
Block a user