id: fix bug when euid != ruid
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Nov 2011 21:23:24 +0000 (13:23 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Nov 2011 21:24:02 +0000 (13:24 -0800)
commit8f512f9bdb2cf436e4ec63c31410d8033d75779a
tree802f4b4d2a5737774286cfca31689323e4314686
parente36e6f2c6e95d6e23be805f7bab6c596b1818d22
id: fix bug when euid != ruid

* src/id.c (main): Report an error if no args are given and getuid
fails, because print_full_info needs ruid.  Redo code so that
getuid and friends are invoked only when needed; this makes the
code easier to follow, and is how I found the above bug.
src/id.c