Cast uid_t and gid_t to unsigned before passing to printf %u.

svn:r17392
This commit is contained in:
Nick Mathewson 2008-11-26 16:13:12 +00:00
parent bc597758dc
commit 4cddcf8873

View File

@ -978,7 +978,8 @@ log_credential_status(void)
return -1;
} else {
log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL,
"UID is %u (real), %u (effective), %u (saved)", ruid, euid, suid);
"UID is %u (real), %u (effective), %u (saved)",
(unsigned)ruid, (unsigned)euid, (unsigned)suid);
}
#else
/* getresuid is not present on MacOS X, so we can't get the saved (E)UID */
@ -987,7 +988,8 @@ log_credential_status(void)
(void)suid;
log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL,
"UID is %u (real), %u (effective), unknown (saved)", ruid, euid);
"UID is %u (real), %u (effective), unknown (saved)",
(unsigned)ruid, (unsigned)euid);
#endif
/* log GIDs */
@ -997,7 +999,8 @@ log_credential_status(void)
return -1;
} else {
log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL,
"GID is %u (real), %u (effective), %u (saved)", rgid, egid, sgid);
"GID is %u (real), %u (effective), %u (saved)",
(unsigned)rgid, (unsigned)egid, (unsigned)sgid);
}
#else
/* getresgid is not present on MacOS X, so we can't get the saved (E)GID */
@ -1005,7 +1008,8 @@ log_credential_status(void)
egid = getegid();
(void)sgid;
log_fn(CREDENTIAL_LOG_LEVEL, LD_GENERAL,
"GID is %u (real), %u (effective), unknown (saved)", rgid, egid);
"GID is %u (real), %u (effective), unknown (saved)",
(unsigned)rgid, (unsigned)egid);
#endif
/* log supplementary groups */