From: Yuan Sun <sunyuan3@huawei.com>
To: Jiri Jaburek <jjaburek@redhat.com>
Cc: ltp-list@lists.sourceforge.net, pleasuresun@sina.com
Subject: Re: [LTP] [PATCH V2] containers: new testcase userns02
Date: Sat, 30 May 2015 14:50:36 +0800 [thread overview]
Message-ID: <55695DBC.5020408@huawei.com> (raw)
In-Reply-To: <55683E08.6050901@redhat.com>
On 2015/5/29 18:23, Jiri Jaburek wrote:
> On 05/28/15 14:33, Jan Stancek wrote:
>> ----- Original Message -----
>>> From: "Yuan Sun" <sunyuan3@huawei.com>
>>> To: jstancek@redhat.com
>>> Cc: ltp-list@lists.sourceforge.net, pleasuresun@sina.com, sunyuan3@huawei.com
>>> Sent: Wednesday, 27 May, 2015 11:00:21 PM
>>> Subject: [PATCH V2] containers: new testcase userns02
>>>
>>> The user ID and group ID, which are inside a container, can
>>> be modified by its parent process.
>>>
>>> Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
>> Hi,
>>
>> couple comments inline, but overall it looks good to me.
>> Unless someone points out other issues, I can fix these before commit.
>>
> As a FYI to the author - there's a "libclone" library in containers/
> that can take care of the forking/cloning/unsharing, specifically the
> do_clone_tests function could be used (uses ltp_clone_quick).
> Given the simplicity of the function, though, I wouldn't see it as
> a major issue.
Hi Jan,
Thanks for your comment. In general, I agree with you. But in this
case I have different opinions.
I tried replacing ltp_clone_quick with do_clone_tests.
#childpid = do_clone_tests(CLONE_NEWUSER | SIGCHLD, (void *)child_fn1,
NULL, NULL, NULL);
However, I found "do_clone_tests" function can't return the child
pid. In this case,
the parent needs the child pid to modify /proc/$childpid/uid_map. Maybe
ltp_clone_quick
is more appropriate than do_clone_tests in this case.
Of course, if you have different opinion please feel free to let me know.
Regards.
Yuan
>
>
> .
>
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-05-30 6:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 21:00 [LTP] [PATCH V2] containers: new testcase userns02 Yuan Sun
2015-05-28 12:33 ` Jan Stancek
2015-05-29 10:23 ` Jiri Jaburek
2015-05-30 6:50 ` Yuan Sun [this message]
2015-06-02 8:09 ` Jan Stancek
2015-06-02 8:26 ` Yuan Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55695DBC.5020408@huawei.com \
--to=sunyuan3@huawei.com \
--cc=jjaburek@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=pleasuresun@sina.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox