[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17392: {tor} Cast uid_t and gid_t to unsigned before passing to printf %u (tor/trunk/src/common)



Author: nickm
Date: 2008-11-26 11:13:12 -0500 (Wed, 26 Nov 2008)
New Revision: 17392

Modified:
   tor/trunk/src/common/compat.c
Log:
Cast uid_t and gid_t to unsigned before passing to printf %u.

Modified: tor/trunk/src/common/compat.c
===================================================================
--- tor/trunk/src/common/compat.c	2008-11-26 16:10:56 UTC (rev 17391)
+++ tor/trunk/src/common/compat.c	2008-11-26 16:13:12 UTC (rev 17392)
@@ -978,7 +978,8 @@
     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 @@
   (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 @@
     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 @@
   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 */