Bug 562 - rebuild_env() function can truncate uid
rebuild_env() function can truncate uid
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudoers
1.8.4
Macintosh MacOS X
: low enhancement
Assigned To: Todd C. Miller
: 629 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-27 13:19 MDT by kbyanc
Modified: 2013-12-16 15:08 MST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kbyanc 2012-06-27 13:19:21 MDT
uid_t is 32-bits so the maximal length in decimal is 10 digits.  MAX_UID_T_LEN, which represents the maximum length of the decimal string representation of a uid_t, suitably defaults to 10 characters.

However, the rebuild_env() function in plugins/sudoers/env.c causes 10-digit uids to be truncated in order to nul-terminate the string.  One more character (for the terminating nul) needs to be allocated for idbuf in this function.
Comment 1 Todd C. Miller 2012-09-12 15:03:15 MDT
Fixed in sudo 1.8.6
Comment 2 Todd C. Miller 2013-12-16 15:08:02 MST
*** Bug 629 has been marked as a duplicate of this bug. ***