[CRIU] 1st test fails
Pavel Emelyanov
xemul at parallels.com
Mon Jul 8 12:20:51 EDT 2013
On 07/03/2013 07:43 PM, Pavel Emelyanov wrote:
> On 07/03/2013 06:34 PM, Neal Becker wrote:
>> How can the daemon reliably know what is the PID of the requesting process (and that
>> it's not some evil program requesting a dump of some other process)?
>
>
> Oh, I believe we can do a very beautiful thing here. On kernels which crtools support
> there's a way to find peers of unix sockets. So, the "dump me" request would look like
> this:
>
> 1. app creates a unix socket and connects to server (by some known path/name)
> 2. criu service finds out the peer of the accepted connection and dumps _it_
>
> In this scheme we don't even need to pass any PIDs over the socket!
I've found an easier way of doing the same. There's a nice sockoption called
SO_PEERCREDS. When called on a connected unix socket it reports back the peer's
pid, uid and gid. Thus we can find out the pid easily.
> Thanks,
> Pavel
>
Thanks,
Pavel
More information about the CRIU
mailing list