[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lxc-devel
Subject:    [lxc-devel] =?gb2312?b?u9i4tCA6UmU6ICC72Li0IDpSZTogIEhvdyB0byBj?= =?gb2312?b?aGFuZ2UgdG8gbHhjIGludGV
From:       yinxb () neusoft ! com (yinxb at neusoft ! com)
Date:       2011-12-14 0:42:08
Message-ID: 12b766312b4480.12b448012b7663 () neusoft ! com
[Download RAW message or body]

Hi 
   Thanks,It is exactly what I want.

----- ??? -----
?: Cedric Le Goater <legoater at free.fr>
??: ???, ??? 13?, 2011 ??4:10
??: Re: [lxc-devel] ?? :Re:  How to change to lxc internal PID to 
system wide PID

> On 12/13/2011 02:49 AM, yinxb at neusoft.com wrote:
> > Hi Gregory Kurz
> > 
> >    From the google search,SCM_CREDENTIALS contains the PID of 
> the 
> > sender process,in the sender's
> > PID namespace.
> >    So if the lxc App acts as the sender, the PID is 2 which is 
> also 
> > invalid for the host. 
> > (lxc has its own PID namesapce)
> >    Correct me if wrong,thanks.
> 
> the pid in 'struct ucred' will be translated in the pid namespace of
> the receiving side.
> 
> on the host, run the receiving side  : 
> 
> 
	http://man7.org/tlpi/code/online/dist/sockets/scm_cred_recv.c
.html
> 
> 	$ ./scm_cred_recv 
> 	Receiving via stream socket
> 	recvmsg() returned 4
> 	Received data = 12345
> 	Received credentials pid=20333, uid=1017, gid=100
> 	Credentials from SO_PEERCRED: pid=20333, euid=1017, egid=100
> 
> 
> and in an lxc (application) container, run the sending side : 
> 
> 
	http://man7.org/tlpi/code/online/dist/sockets/scm_cred_send.c
.html
> 
> 	$ lxc-execute -n foo -- ./scm_cred_send
> 	Send credentials pid=2, uid=1017, gid=100
> 	sendmsg() returned 4
> 
> Regards,
> 
> C.
> 
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic