From 09a7ac8e0c8b98485aeb585fe1631269f58664e0 Mon Sep 17 00:00:00 2001 From: shaojiansong Date: Fri, 14 Nov 2025 16:08:09 +0800 Subject: [PATCH] tools: mark local vars & funcs static --- acl.spec | 6 +- backport-mark-local-vars-funcs-static.patch | 262 ++++++++++++++++++++ 2 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 backport-mark-local-vars-funcs-static.patch diff --git a/acl.spec b/acl.spec index ab214a4..c1ec8c3 100644 --- a/acl.spec +++ b/acl.spec @@ -1,6 +1,6 @@ Name: acl Version: 2.3.2 -Release: 4 +Release: 5 Summary: Commands for manipulating POSIX access control lists License: GPL-2.0-or-later AND LGPL-2.1-or-later @@ -10,6 +10,7 @@ Source0: http://download.savannah.nongnu.org/releases/acl/%{name}-%{versio Patch1: backport-acl_copy_entry-Prevent-accidental-NULL-pointer-deref.patch Patch2: 0001-Fix-the-failure-of-testcase-restore-test.patch Patch3: backport-libmisc-__acl_get_uid-fix-memory-wasting-loop-if-use.patch +Patch4: backport-mark-local-vars-funcs-static.patch BuildRequires: libattr-devel gawk libtool gettext BuildRequires: chrpath @@ -84,6 +85,9 @@ fi %{_mandir}/man?/* %changelog +* Fri Nov 14 2025 shaojiansong - 2.3.2-5 +- tools: mark local vars & funcs static + * Fri Oct 17 2025 yixiangzhike - 2.3.2-4 - Fix src_repo in yaml file diff --git a/backport-mark-local-vars-funcs-static.patch b/backport-mark-local-vars-funcs-static.patch new file mode 100644 index 0000000..ac2a386 --- /dev/null +++ b/backport-mark-local-vars-funcs-static.patch @@ -0,0 +1,262 @@ +Origin Commit: https://cgit.git.savannah.gnu.org/cgit/acl.git/commit/?id=339ff0c5d46d6f5e5113415995c6a60bfc4b1928 +author Mike Frysinger 2024-01-31 23:47:50 -0500 +committer Mike Frysinger 2024-01-31 23:49:14 -0500 +commit 339ff0c5d46d6f5e5113415995c6a60bfc4b1928 (patch) +tree 7cf3c26fce63d8788608b67ec1d99f9e49892b96 +parent 8f997cee2c5c2a494069af3b3ce1151a966b4509 (diff) +download acl-339ff0c5d46d6f5e5113415995c6a60bfc4b1928.tar.gz +diff -Naur acl-2.3.2/tools/do_set.c acl-2.3.2-fix/tools/do_set.c +--- acl-2.3.2/tools/do_set.c 2024-01-14 10:24:48.000000000 +0800 ++++ acl-2.3.2-fix/tools/do_set.c 2025-11-14 15:57:10.543971987 +0800 +@@ -45,7 +45,7 @@ + extern int opt_test; + extern int print_options; + +-acl_entry_t ++static acl_entry_t + find_entry( + acl_t acl, + acl_tag_t type, +@@ -79,7 +79,7 @@ + } + } + +-int ++static int + has_execute_perms( + acl_t acl) + { +@@ -100,7 +100,7 @@ + } + } + +-int ++static int + clone_entry( + acl_t from_acl, + acl_tag_t from_type, +@@ -121,7 +121,7 @@ + } + + +-void ++static void + print_test( + FILE *file, + const char *path_p, +diff -Naur acl-2.3.2/tools/getfacl.c acl-2.3.2-fix/tools/getfacl.c +--- acl-2.3.2/tools/getfacl.c 2022-12-10 16:51:27.000000000 +0800 ++++ acl-2.3.2-fix/tools/getfacl.c 2025-11-14 16:03:10.082831857 +0800 +@@ -68,24 +68,24 @@ + }; + + const char *progname; +-const char *cmd_line_options; ++static const char *cmd_line_options; + +-int walk_flags = WALK_TREE_DEREFERENCE_TOPLEVEL; +-int opt_print_acl; +-int opt_print_default_acl; +-int opt_strip_leading_slash = 1; +-int opt_comments = 1; /* include comments */ +-int opt_skip_base; /* skip files that only have the base entries */ +-int opt_tabular; /* tabular output format (alias `showacl') */ ++static int walk_flags = WALK_TREE_DEREFERENCE_TOPLEVEL; ++static int opt_print_acl; ++static int opt_print_default_acl; ++static int opt_strip_leading_slash = 1; ++static int opt_comments = 1; /* include comments */ ++static int opt_skip_base; /* skip files that only have the base entries */ ++static int opt_tabular; /* tabular output format (alias `showacl') */ + #if POSIXLY_CORRECT +-const int posixly_correct = 1; /* Posix compatible behavior! */ ++static const int posixly_correct = 1; /* Posix compatible behavior! */ + #else +-int posixly_correct; /* Posix compatible behavior? */ ++static int posixly_correct; /* Posix compatible behavior? */ + #endif +-int had_errors; +-int absolute_warning; /* Absolute path warning was issued */ +-int print_options = TEXT_SOME_EFFECTIVE; +-int opt_numeric; /* don't convert id's to symbolic names */ ++static int had_errors; ++static int absolute_warning; /* Absolute path warning was issued */ ++static int print_options = TEXT_SOME_EFFECTIVE; ++static int opt_numeric; /* don't convert id's to symbolic names */ + + + static const char *xquote(const char *str, const char *quote_chars) +@@ -103,7 +103,7 @@ + char name[0]; + }; + +-void free_list(struct name_list *names) ++static void free_list(struct name_list *names) + { + struct name_list *next; + +@@ -114,7 +114,7 @@ + } + } + +-struct name_list *get_list(const struct stat *st, acl_t acl) ++static struct name_list *get_list(const struct stat *st, acl_t acl) + { + struct name_list *first = NULL, *last = NULL; + acl_entry_t ent; +@@ -178,7 +178,7 @@ + return first; + } + +-int max_name_length(struct name_list *names) ++static int max_name_length(struct name_list *names) + { + int max_len = 0; + while (names != NULL) { +@@ -192,14 +192,14 @@ + return max_len; + } + +-int names_width; ++static int names_width; + + struct acl_perm_def { + acl_tag_t tag; + char c; + }; + +-struct acl_perm_def acl_perm_defs[] = { ++static const struct acl_perm_def acl_perm_defs[] = { + { ACL_READ, 'r' }, + { ACL_WRITE, 'w' }, + { ACL_EXECUTE, 'x' }, +@@ -208,7 +208,7 @@ + + #define ACL_PERMS (sizeof(acl_perm_defs) / sizeof(struct acl_perm_def) - 1) + +-void acl_perm_str(acl_entry_t entry, char *str) ++static void acl_perm_str(acl_entry_t entry, char *str) + { + acl_permset_t permset; + int n; +@@ -221,7 +221,7 @@ + str[n] = '\0'; + } + +-void acl_mask_perm_str(acl_t acl, char *str) ++static void acl_mask_perm_str(acl_t acl, char *str) + { + acl_entry_t entry; + +@@ -241,7 +241,7 @@ + } + } + +-void apply_mask(char *perm, const char *mask) ++static void apply_mask(char *perm, const char *mask) + { + while (*perm) { + if (*mask == '-' && *perm >= 'a' && *perm <= 'z') +@@ -252,7 +252,7 @@ + } + } + +-int show_line(FILE *stream, struct name_list **acl_names, acl_t acl, ++static int show_line(FILE *stream, struct name_list **acl_names, acl_t acl, + acl_entry_t *acl_ent, const char *acl_mask, + struct name_list **dacl_names, acl_t dacl, + acl_entry_t *dacl_ent, const char *dacl_mask) +@@ -325,7 +325,7 @@ + return 0; + } + +-int do_show(FILE *stream, const char *path_p, const struct stat *st, ++static int do_show(FILE *stream, const char *path_p, const struct stat *st, + acl_t acl, acl_t dacl) + { + struct name_list *acl_names = get_list(st, acl), +@@ -444,7 +444,7 @@ + return str; + } + +-int do_print(const char *path_p, const struct stat *st, int walk_flags, void *unused) ++static int do_print(const char *path_p, const struct stat *st, int walk_flags, void *unused) + { + const char *default_prefix = NULL; + acl_t acl = NULL, default_acl = NULL; +@@ -564,7 +564,7 @@ + } + + +-void help(void) ++static void help(void) + { + printf(_("%s %s -- get file access control lists\n"), + progname, VERSION); +diff -Naur acl-2.3.2/tools/setfacl.c acl-2.3.2-fix/tools/setfacl.c +--- acl-2.3.2/tools/setfacl.c 2024-01-14 10:24:48.000000000 +0800 ++++ acl-2.3.2-fix/tools/setfacl.c 2025-11-14 16:06:08.394738038 +0800 +@@ -72,20 +72,20 @@ + }; + + const char *progname; +-const char *cmd_line_options, *cmd_line_spec; ++static const char *cmd_line_options, *cmd_line_spec; + +-int walk_flags = WALK_TREE_DEREFERENCE_TOPLEVEL; ++static int walk_flags = WALK_TREE_DEREFERENCE_TOPLEVEL; + int opt_recalculate; /* recalculate mask entry (0=default, 1=yes, -1=no) */ +-int opt_promote; /* promote access ACL to default ACL */ ++static int opt_promote; /* promote access ACL to default ACL */ + int opt_test; /* do not write to the file system. + Print what would happen instead. */ + #if POSIXLY_CORRECT +-const int posixly_correct = 1; /* Posix compatible behavior! */ ++static const int posixly_correct = 1; /* Posix compatible behavior! */ + #else +-int posixly_correct; /* Posix compatible behavior? */ ++static int posixly_correct; /* Posix compatible behavior? */ + #endif +-int chown_error; +-int promote_warning; ++static int chown_error; ++static int promote_warning; + + + static const char *xquote(const char *str, const char *quote_chars) +@@ -98,7 +98,7 @@ + return q; + } + +-int ++static int + has_any_of_type( + cmd_t cmd, + acl_type_t acl_type) +@@ -113,7 +113,7 @@ + + + #if !POSIXLY_CORRECT +-int ++static int + restore( + FILE *file, + const char *filename) +@@ -260,7 +260,7 @@ + #endif + + +-void help(void) ++static void help(void) + { + printf(_("%s %s -- set file access control lists\n"), + progname, VERSION); +@@ -300,7 +300,7 @@ + } + + +-int next_file(const char *arg, seq_t seq) ++static int next_file(const char *arg, seq_t seq) + { + char *line; + int errors = 0; -- Gitee