Use getuid instead of geteuid
If someone gives the pacman binary setuid permissions, the geteuid check allows it to start running but subsequently fail. As we do not support setting pacman setuid, use getuid to check permissions instead. FS#37174. Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
8f5dbd5614
commit
7e767b7e90
1 changed files with 1 additions and 1 deletions
|
@ -1031,7 +1031,7 @@ int main(int argc, char *argv[])
|
||||||
size_t i;
|
size_t i;
|
||||||
struct sigaction new_action, old_action;
|
struct sigaction new_action, old_action;
|
||||||
const int signals[] = { SIGHUP, SIGINT, SIGTERM, SIGSEGV };
|
const int signals[] = { SIGHUP, SIGINT, SIGTERM, SIGSEGV };
|
||||||
uid_t myuid = geteuid();
|
uid_t myuid = getuid();
|
||||||
|
|
||||||
/* Set signal handlers */
|
/* Set signal handlers */
|
||||||
/* Set up the structure to specify the new action. */
|
/* Set up the structure to specify the new action. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue