longfei created MESOS-9876:
------------------------------

             Summary: Use geteuid to determine subprocess' user when launching 
task.
                 Key: MESOS-9876
                 URL: https://issues.apache.org/jira/browse/MESOS-9876
             Project: Mesos
          Issue Type: Improvement
            Reporter: longfei


I have to run mesos-agent as root(or some use with root privilege) to isolate 
tasks' execution environment. For security, we 
 # chmod +s to mesos-agent and then run it with some user A.
 # use switch_user to restrict tasks' capabilities(e.g. "rm -rf /" is not 
allowed).

The problem is that if we set user to A(the same user running mesos-agent), the 
check in MesosContainerizerLaunch::execute() (i.e. `uid.get() != 
os::getuid().get() `) will always be false. As a result, all subprocesses will 
be run as root. 

So I suggest that we should use geteuid here to replace getuid, namely

`

if (uid.get() != ::geteuid()) {

// some code

}

`



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to