[lxc-devel] [PATCH] Fix some issues with inherited fd's

Vladimir Smirnov civil at yandex-team.ru
Tue Aug 23 09:37:55 UTC 2011


Hello!

In attachment there are 2 patches to fix some issues with inherited
fd's. Instead of just exiting with error, maybe it's better to set
O_CLOEXEC flag.

1-st patch changes lxc-init and lxc-attach to use clone instead of fork.
Reason for it: clone permits to set custom flags, so you can call it
without CLONE_FILES and all fd's with O_CLOEXEC flag won't be passed to
child.

I'm not sure who and when should free child's stack. It seems to me that
Linux handles it by itself, so stack is malloced, but not freed.

2-nd patch changes lxc-start to set CLOEXEC instead of just returning
with error.

It seems to me that fd's are not passed to lxc-init.

-- 
Best regards, Vladimir Smirnov.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Modify-lxc_attach-and-lxc_init-to-use-clone-instead-.patch
Type: text/x-patch
Size: 5116 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20110823/2531d9bd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-lxc-start-shouldn-t-exit-with-error-if-there-is-inhe.patch
Type: text/x-patch
Size: 1518 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20110823/2531d9bd/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20110823/2531d9bd/attachment.pgp>


More information about the lxc-devel mailing list