enlightenment_sys - eina_init BEFORE switching uid - safer

in case eina_init uses env vars, move it to befor setuid() so it can
detect. you normally would setuid only for a limited op and we do it
for "the rest of the running" as e_sys is fairly simple.
This commit is contained in:
Carsten Haitzler 2017-02-09 15:59:11 +09:00
parent 1f6baaf283
commit ef6c178a17
1 changed files with 2 additions and 2 deletions

View File

@ -179,6 +179,8 @@ main(int argc,
if (!action) exit(1);
fprintf(stderr, "action %s %i\n", action, argc);
eina_init();
uid = getuid();
gid = getgid();
egid = getegid();
@ -199,8 +201,6 @@ main(int argc,
exit(7);
}
eina_init();
if (!auth_action_ok(action, gid, gl, gn, egid))
{
printf("ERROR: ACTION NOT ALLOWED: %s\n", action);