From 01d0bbfb8555a15ace944138fa69a6c1a516ce15 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 11 Jan 2021 07:35:33 -0700 Subject: [PATCH] Add casts to quiet two warnings on Solaris. --- src/copy_file.c | 3 ++- src/edit_open.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/copy_file.c b/src/copy_file.c index 1930e9e6a..9404408b6 100644 --- a/src/copy_file.c +++ b/src/copy_file.c @@ -155,7 +155,8 @@ sudo_check_temp_file(int tfd, const char *tfile, uid_t uid, struct stat *sb) debug_return_bool(false); } if ((sb->st_mode & ALLPERMS) != (S_IRUSR|S_IWUSR)) { - sudo_warnx(U_("%s: bad file mode: 0%o"), tfile, sb->st_mode & ALLPERMS); + sudo_warnx(U_("%s: bad file mode: 0%o"), tfile, + (unsigned int)(sb->st_mode & ALLPERMS)); debug_return_bool(false); } if (sb->st_uid != uid) { diff --git a/src/edit_open.c b/src/edit_open.c index 8795218a9..864dcea40 100644 --- a/src/edit_open.c +++ b/src/edit_open.c @@ -132,8 +132,8 @@ group_matches(gid_t target, struct sudo_cred *cred) for (i = 0; i < cred->ngroups; i++) { if (target == cred->groups[i]) { sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO, - "user gid %u matches directory gid %u", cred->groups[i], - (unsigned int)target); + "user gid %u matches directory gid %u", + (unsigned int)cred->groups[i], (unsigned int)target); debug_return_bool(true); } }