Description of problem: at-3.1.8-60 out of RHEL4 does the following, which is - I would say - okay: [root@rhel4 ~]# sudo -u root echo "foo" foo [root@rhel4 ~]# at-3.1.8-66 out of Fedora Core development does this, which isn't okay: [root@devel ~]# sudo -u root echo "foo" usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt] [-u username/#uid] [-r role] [-t type] -s | <command> [root@devel ~]# Ehm...okay, there's a pipe before <command>, but why do I also get here the usage information? [root@devel ~]# sudo -u root | echo "foo" foo usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt] [-u username/#uid] [-r role] [-t type] -s | <command> [root@devel ~]# Version-Release number of selected component (if applicable): at-3.1.8-66 How reproducible: Everytime, see above. Actual results: at has a strange behaviour Expected results: "Normal" behaviour or better documentation or whatelse to match with the standards.
Oh shit, this should be applied to sudo rather at. BIG SORRY!! The problem is sudo-1.6.7p5-30.1 (RHEL4) vs. sudo-1.6.7p5-31 (Fedora Core Development)... re-assigning ;-)
Oh dear (it's too early at Monday), the problem is such simple: [root@devel ~]# sudo -u nobody id usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt] [-u username/#uid] [-r role] [-t type] -s | <command> [root@devel ~]# [root@rhel4 ~]# sudo -u nobody id uid=99(nobody) gid=99(nobody) groups=99(nobody) [root@rhel4 ~]# Something went simply wrong at sudo, completely wrong behaviour!
Ha, and this problem is caused by gcc4! If I rebuild sudo using gcc32 (compat- package), rebuilding works and sudo also -- as expected! Fixup for gcc4, please... ;-)
The fact that it works when rebuilt with gcc32 does not mean it is not a bug in sudo. But more importantly, you haven't specified the architecture, which is quite important.
Well, I would say anyway, the problem is sudo, because: Take a vanilla sudo-1.6.7p5, run ./configure && make && ./sudo -u nobody id => Fails with the error already written above Take a vanilla sudo-1.6.8p7, run ./configure && make && ./sudo -u nobody id => Works fine: uid=99(nobody) gid=99(nobody) groups=99(nobody) But to make you, Jakub, happy: it's an i686 (Intel(R) Xeon(TM) CPU 3.06GHz) using gcc-Version 4.0.0 20050314 (Red Hat 4.0.0-0.34) and glibc-2.3.4-16.
Ok, this indeed looks like a GCC bug. As a workaround, you might prevent parse_args from being inlined (either __attribute__((noinline)), or by removing static from it).
Should be fixed in gcc-4.0.0-0.36.