Re: effective user id
From: Hubble (reiner_at_huober.de)
Date: 28 Nov 2005 04:30:10 -0800
Note from the manual page of bash(1):
If the shell is started with the effective user (group)
id not equal to the real user (group) id, and the -p
option is not supplied, these actions are taken ***and the
effective user id is set to the real user id***.
Since system(1) invokes a shell, in most cases bash on linux
systems, it will reset euid to user1before executing "ls -l". You
must use setuid(geteuid()) before calling system(3).