From 252eac087217f092dd330e8d649fa85e77fb5758 Mon Sep 17 00:00:00 2001 From: fundavid Date: Wed, 23 Oct 2024 12:07:42 +0800 Subject: [PATCH] codex fixed Signed-off-by: fundavid --- libselinux/src/ignore_path.c | 2 +- libselinux/src/ignore_path.h | 6 +++--- libselinux/src/selinux_restorecon.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libselinux/src/ignore_path.c b/libselinux/src/ignore_path.c index 5231167d..dd3b1cb4 100644 --- a/libselinux/src/ignore_path.c +++ b/libselinux/src/ignore_path.c @@ -142,7 +142,7 @@ static bool find_ignore_path(ignore_path_node_t *current, const char *path) return false; } -enum SkipType skip_ignore_relabel(const char *path) +enum skip_type skip_ignore_relabel(const char *path) { if (find_ignore_path(g_ignore_paths.slash_suffix_paths, path)) { return SKIP_SELF_SUB_DIR; diff --git a/libselinux/src/ignore_path.h b/libselinux/src/ignore_path.h index d9dc6785..974584b7 100644 --- a/libselinux/src/ignore_path.h +++ b/libselinux/src/ignore_path.h @@ -23,7 +23,7 @@ #define SYSTEM_IGNORE_CFG_PATH "/system/etc/selinux/ignore_cfg" #define VENDOR_IGNORE_CFG_PATH "/vendor/etc/selinux/ignore_cfg" -enum SkipType { +enum skip_type { SKIP_NONE = 0, SKIP_SUB_DIR = 1, SKIP_SELF_SUB_DIR = 2 @@ -44,13 +44,13 @@ size_t trim_newline(char *str); typedef struct path_info { ignore_path_node_t **paths_ptr; - int suffix_len; + unsigned int suffix_len; } path_info_t; path_info_t trim_suffix_and_get_path_info(char *line, size_t real_length); bool load_ignore_cfg_from_file(const char *cfg_path); bool load_ignore_cfg(); -enum SkipType skip_ignore_relabel(const char *path); +enum skip_type skip_ignore_relabel(const char *path); void free_ignore_list(ignore_path_node_t **list_ptr); #endif // IGNORE_PATH_H diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c index 6bb8cee7..524b171b 100644 --- a/libselinux/src/selinux_restorecon.c +++ b/libselinux/src/selinux_restorecon.c @@ -886,7 +886,7 @@ static bool is_in_skip_elx(const char *path) { return false; } size_t len = sizeof(skip_elx_path) / sizeof(skip_elx_path[0]); - for (int i = 0; i < len; i++) { + for (size_t i = 0; i < len; i++) { if (strncmp(path, skip_elx_path[i], strlen(skip_elx_path[i])) == 0) { return true; } @@ -1020,7 +1020,7 @@ loop_body: continue; } - enum SkipType skip_ignore_flag = skip_ignore_relabel(ftsent->fts_path); + enum skip_type skip_ignore_flag = skip_ignore_relabel(ftsent->fts_path); selinux_log(SELINUX_INFO, "ignore cfg parsing result %d \n", skip_ignore_flag); -- Gitee