The dumpable flag is now reset to true after the uid is changed.
This commit is contained in:
Markus Makela
2015-08-16 18:15:16 +03:00
parent a9e7eee718
commit 86ad570af8

View File

@ -85,6 +85,7 @@
#include <ini.h>
#include <sys/wait.h>
#include <sys/prctl.h>
/** for procname */
#if !defined(_GNU_SOURCE)
@ -2218,6 +2219,15 @@ static int set_user(char* user)
pwname->pw_name,errno,strerror(errno));
return rval;
}
if(prctl(PR_GET_DUMPABLE) == 0)
{
if(prctl(PR_SET_DUMPABLE ,1) == -1)
{
printf("Error: Failed to set dumpable flag on for the process '%s': %d %s\n",
pwname->pw_name,errno,strerror(errno));
return -1;
}
}
#ifdef SS_DEBUG
else
{