2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Use %u to print uid/gid, not %lu and adjust casts to match.

This commit is contained in:
Todd C. Miller
2010-11-30 15:21:36 -05:00
parent 3f605ebfaa
commit 4527bdd9b4
6 changed files with 36 additions and 34 deletions

View File

@@ -641,9 +641,9 @@ rebuild_env(int noexec)
/* Add the SUDO_USER, SUDO_UID, SUDO_GID environment variables. */
sudo_setenv("SUDO_USER", user_name, TRUE);
snprintf(idbuf, sizeof(idbuf), "%lu", (unsigned long) user_uid);
snprintf(idbuf, sizeof(idbuf), "%u", (unsigned int) user_uid);
sudo_setenv("SUDO_UID", idbuf, TRUE);
snprintf(idbuf, sizeof(idbuf), "%lu", (unsigned long) user_gid);
snprintf(idbuf, sizeof(idbuf), "%u", (unsigned int) user_gid);
sudo_setenv("SUDO_GID", idbuf, TRUE);
/* Free old environment. */