Skip to content

Commit

Permalink
setgid(0) - some programs check if gid == 0, eg. DNF
Browse files Browse the repository at this point in the history
  • Loading branch information
gblach committed Aug 24, 2018
1 parent e89fbdc commit ee47414
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions please.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ int main(int ac, char **av)
return err;
}

if((err = setgid(0))) {
perror(NULL);
return err;
}

if(!strcmp(av[0], "-")) {
struct passwd *pwd = getpwuid(0);
if((err = execl(pwd->pw_shell, pwd->pw_shell, NULL))) {
Expand Down

0 comments on commit ee47414

Please sign in to comment.