Add casts to quiet two warnings on Solaris.

This commit is contained in:
Todd C. Miller
2021-01-11 07:35:33 -07:00
parent 9e111eae57
commit 01d0bbfb85
2 changed files with 4 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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);
}
}