After sudo -i
and checking the output of set
on both a host that doesn't work and one that does (a Cent5 box compared to Cent6), I noticed the following:
[root@cent5-node ~]# set | grep -i sudo
SUDO_COMMAND=/bin/bash
SUDO_GID=100100017
SUDO_UID=100100017
SUDO_USER=kkahn
[root@cent6-node ~]# set | grep -i sudo
SUDO_COMMAND=/bin/bash
SUDO_GID=1001000173
SUDO_UID=1001000173
SUDO_USER=kkahn
[root@testcentsix(testcentsix) ~]#
My SUDO_GID
and SUDO_UID
are correct on cent6-node
- and shortened on cent5-node
! On Cent5 the IDs have the 3
removed.
As it turns out, this is something that was patched in later releases of sudo
:
https://gratisoft.us/sudo/changes.html
* plugins/sudoers/env.c, plugins/sudoers/ldap.c:
Use MAX_UID_T_LEN + 1 for uid/gid buffers, not MAX_UID_T_LEN to
prevent potential truncation. Bug #562.
[29d9fc4e0c4e]
The version of sudo
running on these Cent5 hosts is 1.7.2p1
, whereas our Cent6 hosts have 1.8.6p3
. After looking through the source code of 1.7.2p1
, I sure enough found:
...
char idbuf[MAX_UID_T_LEN];
...
After installing a later version of sudo
on the Cent5 node, this problem has been resolved.
journalctl
displays.