<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Xu,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 14, 2022 at 2:02 PM <a href="mailto:xuyang2018.jy@fujitsu.com" target="_blank">xuyang2018.jy@fujitsu.com</a> <<a href="mailto:xuyang2018.jy@fujitsu.com" target="_blank">xuyang2018.jy@fujitsu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Richard, LI<br>
<br>
I am writting a simple regression test[1]that refer to kernel selftest cgroup test_core[2]. I may name it as memcontrol05.c.<br>
<br>
It tests cgroup migration permission check should be performed based on the credentials at the time of open instead of write.<br>
<br>
I have used ltp cgroup framework, but ltp cgroup only use SAFE_CGROUP_PRINTF to write value.<br>
<br>
How can get the cgroup root_dir ltp_dir path? So I can open this fd<br>
and change/save effective uid between open and write?<br></blockquote><div> </div></div><div class="gmail_default" style="font-size:small">Not sure if I fully understand your requirements.</div><div class="gmail_default" style="font-size:small">Can we achieve this test by creating a two-layer subdirectory?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Does only the root/ltp_dir mandatory for completing your test?</div><div class="gmail_default" style="font-size:small">If yes, I think tst_cg_print_config() maybe fits your purpose,</div><div class="gmail_default" style="font-size:small">but that would need additional function help extracting that.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Take a reference to see how Luke gets the root path (in shell):</div><div class="gmail_default" style="font-size:small"><a href="https://lists.linux.it/pipermail/ltp/2022-April/028772.html">https://lists.linux.it/pipermail/ltp/2022-April/028772.html<br></a></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>