[CRIU] 1st test fails

Neal Becker ndbecker2 at gmail.com
Tue Jul 9 07:21:15 EDT 2013


Yes, I saw that.  I don't have experience with low-level socket
programming, so I can see this
is more of a project than I want to try - unless I could find a complete
example of how this works.


On Mon, Jul 8, 2013 at 12:20 PM, Pavel Emelyanov <xemul at parallels.com>wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130709/c14e44b7/attachment.html>


More information about the CRIU mailing list