Functions from the setuid
-family including setuid
and setgid
are used to change the identity of the caller
process. They are used to change privileges for the subsequent actions to be executed. If a call to these functions returns an error that is not
checked and handled appropriately, the subsequent parts of the program will execute with unexpected privileges. This, in turn, leads to unexpected
program behavior and poses a serious security risk.