POSIX seteuid DOES NOT CHANGE saved uid.
As I see, seteuid syscall was deleted from kernel
because someone decided that it is equivalent to setreuid(-1, euid).
kernel/sys.c
if (ruid != (uid_t) -1 ||
(euid != (uid_t) -1 && euid != old_ruid)) <- ?????
current->suid = current->euid;
setreuid changes saved uid, when euid != uid.
It breaks POSIX compliant programs.
Well, we might delete second condition, but I'am
afraid it will break BSD compliance.
Alexey Kuznetsov.