linux-programming-interface-exercises icon indicating copy to clipboard operation
linux-programming-interface-exercises copied to clipboard

Exercise 9-5

Open bumzy opened this issue 9 years ago • 1 comments
trafficstars

Hello, your ideas have impressed and helped me a lot. Thanks! Exercise 9-5 answer may have a mistake.

// setuid()
/* suspend not possible */
/* resume not possible */
setuid(getuid());  /* Permanently drop privileges*/

bumzy avatar Oct 18 '16 03:10 bumzy

Indeed, for a set-UID-root program, setuid(uid) with a nonzero uid can permanently drop privilege as this will set RUID/EUID/SUID all to uid

SteveLauC avatar Aug 31 '22 00:08 SteveLauC