mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
If setgid fails for any reason, exit lldb.
This is SVN r191618 by Sylvestre Ledru applied to the FreeBSD ProcessMonitor. llvm-svn: 200791
This commit is contained in:
@@ -896,7 +896,8 @@ ProcessMonitor::Launch(LaunchArgs *args)
|
||||
eDupStdoutFailed,
|
||||
eDupStderrFailed,
|
||||
eChdirFailed,
|
||||
eExecFailed
|
||||
eExecFailed,
|
||||
eSetGidFailed
|
||||
};
|
||||
|
||||
// Child process.
|
||||
@@ -907,7 +908,8 @@ ProcessMonitor::Launch(LaunchArgs *args)
|
||||
exit(ePtraceFailed);
|
||||
|
||||
// Do not inherit setgid powers.
|
||||
setgid(getgid());
|
||||
if (setgid(getgid()) != 0)
|
||||
exit(eSetGidFailed);
|
||||
|
||||
// Let us have our own process group.
|
||||
setpgid(0, 0);
|
||||
@@ -972,6 +974,9 @@ ProcessMonitor::Launch(LaunchArgs *args)
|
||||
case eExecFailed:
|
||||
args->m_error.SetErrorString("Child exec failed.");
|
||||
break;
|
||||
case eSetGidFailed:
|
||||
args->m_error.SetErrorString("Child setgid failed.");
|
||||
break;
|
||||
default:
|
||||
args->m_error.SetErrorString("Child returned unknown exit status.");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user