Skip to content

Commit 5c5e0e8

Browse files
committed
Merge tag 'tomoyo-pr-20230903' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1
Pull tomoyo updates from Tetsuo Handa: "Three cleanup patches, no behavior changes" * tag 'tomoyo-pr-20230903' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1: tomoyo: remove unused function declaration tomoyo: refactor deprecated strncpy tomoyo: add format attributes to functions
2 parents 708283a + 254a8ed commit 5c5e0e8

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

security/tomoyo/common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ static bool tomoyo_manage_by_non_root;
184184
*
185185
* Returns nothing.
186186
*/
187+
__printf(3, 4)
187188
static void tomoyo_addprintf(char *buffer, int len, const char *fmt, ...)
188189
{
189190
va_list args;

security/tomoyo/common.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ bool tomoyo_str_starts(char **src, const char *find);
954954
char *tomoyo_encode(const char *str);
955955
char *tomoyo_encode2(const char *str, int str_len);
956956
char *tomoyo_init_log(struct tomoyo_request_info *r, int len, const char *fmt,
957-
va_list args);
957+
va_list args) __printf(3, 0);
958958
char *tomoyo_read_token(struct tomoyo_acl_param *param);
959959
char *tomoyo_realpath_from_path(const struct path *path);
960960
char *tomoyo_realpath_nofollow(const char *pathname);
@@ -1037,8 +1037,6 @@ struct tomoyo_policy_namespace *tomoyo_assign_namespace
10371037
(const char *domainname);
10381038
struct tomoyo_profile *tomoyo_profile(const struct tomoyo_policy_namespace *ns,
10391039
const u8 profile);
1040-
unsigned int tomoyo_check_flags(const struct tomoyo_domain_info *domain,
1041-
const u8 index);
10421040
u8 tomoyo_parse_ulong(unsigned long *result, char **str);
10431041
void *tomoyo_commit_ok(void *data, const unsigned int size);
10441042
void __init tomoyo_load_builtin_policy(void);
@@ -1067,7 +1065,7 @@ void tomoyo_warn_oom(const char *function);
10671065
void tomoyo_write_log(struct tomoyo_request_info *r, const char *fmt, ...)
10681066
__printf(2, 3);
10691067
void tomoyo_write_log2(struct tomoyo_request_info *r, int len, const char *fmt,
1070-
va_list args);
1068+
va_list args) __printf(3, 0);
10711069

10721070
/********** External variable definitions. **********/
10731071

security/tomoyo/domain.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,13 +784,12 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm)
784784
if (!strcmp(domainname, "parent")) {
785785
char *cp;
786786

787-
strncpy(ee->tmp, old_domain->domainname->name,
788-
TOMOYO_EXEC_TMPSIZE - 1);
787+
strscpy(ee->tmp, old_domain->domainname->name, TOMOYO_EXEC_TMPSIZE);
789788
cp = strrchr(ee->tmp, ' ');
790789
if (cp)
791790
*cp = '\0';
792791
} else if (*domainname == '<')
793-
strncpy(ee->tmp, domainname, TOMOYO_EXEC_TMPSIZE - 1);
792+
strscpy(ee->tmp, domainname, TOMOYO_EXEC_TMPSIZE);
794793
else
795794
snprintf(ee->tmp, TOMOYO_EXEC_TMPSIZE - 1, "%s %s",
796795
old_domain->domainname->name, domainname);

0 commit comments

Comments
 (0)