It seems like this wan't an error in the handling of the setuid bit after all. It seems like the EUID is reset to UID after getpwnam is called. Attaching a simple test program. Compile and change the owner to root and set the setuid bit.
Expected output:
EUID0: 0, EUID1: 0
On systems with broken LDAP support (EUID1 will be set to the UID of the process):
EUID0: 0, EUID1: 1000
It seems like this wan't an error in the handling of the setuid bit after all. It seems like the EUID is reset to UID after getpwnam is called. Attaching a simple test program. Compile and change the owner to root and set the setuid bit.
Expected output:
EUID0: 0, EUID1: 0
On systems with broken LDAP support (EUID1 will be set to the UID of the process):
EUID0: 0, EUID1: 1000