Mailinglist Archive: opensuse (1352 mails)

< Previous Next >
Re: [opensuse] Re: Problem with suid pgms on Leap-15.0
On 06/04/2018 03:11 PM, Mark Hounschell wrote:

The rpm provided by Dr. Werner Fink seems to have fixed it up.

There is a new response to your Bugzilla comment BTW.



(In reply to L. A. Walsh from comment #11)
> [...]
> The problem was the loss of supplementary group ID's upon becoming root [...]

Actually, his problem was the loss of supplementary group IDs when transitioning away from root.




And that makes sense to me. When I execvpe something, I am transitioning away from root.


BTW, I did find a work around before I got a response from the BUG.

child_pid = fork();
if (child_pid == 0) {
// child process.

// Work around for bug 1095670
getresuid(&cruid, &ceuid, &csuid); // Get real, effective, and saved uids
getresgid(&crgid, &cegid, &csgid); // Get real, effective, and saved gids
setresuid(cruid, cruid, cruid); // set all uids to real uids
setresgid(crgid, crgid, crgid); // set all gids to real gids

execvpe(argv[0], argv, envp);

// If execvpe returns, it must have failed.
perror("lcrs_system(): execvpe failed : ");
return -1;
} else {
//
// This is run by the parent.
// Wait for the child to exit.
//
do {

tpid = wait(&child_status);
if (tpid != child_pid) {
printf("Problem with wait\n");
}
} while(tpid != child_pid);
return child_status;
}

Mark

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >