<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1491354665555_10634"><span>Hello,</span></div><div id="yui_3_16_0_ym19_1_1491354665555_10634"><span><br></span></div><div id="yui_3_16_0_ym19_1_1491354665555_10634"><span id="yui_3_16_0_ym19_1_1491354665555_10712">Could you help to check if the patch is ok or not ?</span></div><div id="yui_3_16_0_ym19_1_1491354665555_10634"><span><br></span></div><div id="yui_3_16_0_ym19_1_1491354665555_10634"><span id="yui_3_16_0_ym19_1_1491354665555_10713">Thanks and regards.</span></div><div id="yui_3_16_0_ym19_1_1491354665555_10634"><span><br></span></div><div id="yui_3_16_0_ym19_1_1491354665555_10634"><span>Hoang</span></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1491354665555_10668"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1491354665555_10675" style="display: block;"> <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1491354665555_10674"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1491354665555_10673"> <div dir="ltr" id="yui_3_16_0_ym19_1_1491354665555_10672"> <font size="2" face="Arial" id="yui_3_16_0_ym19_1_1491354665555_10714"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Hoang Nguyen <the_hoang0709@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> "the_hoang0709@yahoo.com" <the_hoang0709@yahoo.com>; "ltp@lists.linux.it" <ltp@lists.linux.it> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, 22 March 2017, 10:06<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [LTP] [PATCH] prot_hsymlinks: Fix failure on read-only machine<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1491354665555_10715"><br><div id="yiv2341080348"><div id="yui_3_16_0_ym19_1_1491354665555_10716">Hi,<div id="yiv2341080348yMail_cursorElementTracker_1490151719455"><br clear="none"></div><div id="yiv2341080348yMail_cursorElementTracker_1490151720554">Could you help to check, so that we can close the Issue ?</div><div id="yiv2341080348yMail_cursorElementTracker_1490151799358"><br clear="none"></div><div id="yiv2341080348yMail_cursorElementTracker_1490151800372">Thanks and regards</div><div id="yiv2341080348yMail_cursorElementTracker_1490151805541"><br clear="none"></div><div id="yiv2341080348yMail_cursorElementTracker_1490151806675">Hoang<br clear="none"><br clear="none"><div id="yiv2341080348ymail_android_signature"><a rel="nofollow" shape="rect" target="_blank" href="https://overview.mail.yahoo.com/mobile/?.src=Android">Sent from Yahoo Mail on Android</a></div> <br clear="none"> <div class="yiv2341080348yqt2312034593" id="yiv2341080348yqt39297"><blockquote style="margin:0 0 20px 0;"> <div>On Fri, Mar 10, 2017 at 7:55, the_hoang0709@yahoo.com</div><div><the_hoang0709@yahoo.com> wrote:</div> <div style="padding:10px 0 0 20px;margin:10px 0 0 0;border-left:1px solid #6D00F6;"> <div dir="ltr">From: Hoang Nguyen <<a rel="nofollow" shape="rect" ymailto="mailto:the_hoang0709@yahoo.com" target="_blank" href="mailto:the_hoang0709@yahoo.com">the_hoang0709@yahoo.com</a>><br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Return 32 if /etc/passwd is read-only.<br clear="none"></div><div dir="ltr">Also move tst_tmpdir before useradd in setup, to avoid "TESTDIR was<br clear="none"></div><div dir="ltr">NULL" in tst_rmdir in cleanup.<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Fixes #88<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Signed-off-by: Hoang Nguyen <<a rel="nofollow" shape="rect" ymailto="mailto:the_hoang0709@yahoo.com" target="_blank" href="mailto:the_hoang0709@yahoo.com">the_hoang0709@yahoo.com</a>><br clear="none"></div><div dir="ltr">---<br clear="none"></div><div dir="ltr"> testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c | 14 ++++++++++----<br clear="none"></div><div dir="ltr"> 1 file changed, 10 insertions(+), 4 deletions(-)<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">diff --git a/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c b/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c<br clear="none"></div><div dir="ltr">index b23064a..31ddefa 100644<br clear="none"></div><div dir="ltr">--- a/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c<br clear="none"></div><div dir="ltr">+++ b/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c<br clear="none"></div><div dir="ltr">@@ -206,6 +206,8 @@ static void setup(int argc, char *argv[])<br clear="none"></div><div dir="ltr"> <br clear="none"></div><div dir="ltr"> tst_sig(FORK, DEF_HANDLER, cleanup);<br clear="none"></div><div dir="ltr"> <br clear="none"></div><div dir="ltr">+ tst_tmpdir();<br clear="none"></div><div dir="ltr">+<br clear="none"></div><div dir="ltr"> test_user_cmd("useradd");<br clear="none"></div><div dir="ltr"> /*<br clear="none"></div><div dir="ltr"> * enable hardlinks and symlinks restrictions,<br clear="none"></div><div dir="ltr">@@ -220,8 +222,6 @@ static void setup(int argc, char *argv[])<br clear="none"></div><div dir="ltr"> disable_protected_slinks = 1;<br clear="none"></div><div dir="ltr"> }<br clear="none"></div><div dir="ltr"> <br clear="none"></div><div dir="ltr">- tst_tmpdir();<br clear="none"></div><div dir="ltr">-<br clear="none"></div><div dir="ltr"> init_base_dirs();<br clear="none"></div><div dir="ltr"> <br clear="none"></div><div dir="ltr"> init_files_dirs();<br clear="none"></div><div dir="ltr">@@ -273,7 +273,8 @@ static void cleanup(void)<br clear="none"></div><div dir="ltr"> if (skip_cleanup)<br clear="none"></div><div dir="ltr"> return;<br clear="none"></div><div dir="ltr"> <br clear="none"></div><div dir="ltr">- test_user_cmd("userdel -r");<br clear="none"></div><div dir="ltr">+ if (!eaccess("/etc/passwd", W_OK))<br clear="none"></div><div dir="ltr">+ test_user_cmd("userdel -r");<br clear="none"></div><div dir="ltr"> <br clear="none"></div><div dir="ltr"> if (disable_protected_hlinks) {<br clear="none"></div><div dir="ltr"> tst_resm(TINFO, "Disable protected hardlinks mode back");<br clear="none"></div><div dir="ltr">@@ -316,8 +317,13 @@ static void test_user_cmd(const char *user_cmd)<br clear="none"></div><div dir="ltr"> char cmd[MAX_CMD_LEN];<br clear="none"></div><div dir="ltr"> snprintf(cmd, MAX_CMD_LEN, "%s %s", user_cmd, users[TEST_USER].name);<br clear="none"></div><div dir="ltr"> if (system(cmd) != 0) {<br clear="none"></div><div dir="ltr">- tst_brkm(TBROK, cleanup, "Failed to run cmd: %s %s",<br clear="none"></div><div dir="ltr">+ if (eaccess("/etc/passwd", W_OK)) {<br clear="none"></div><div dir="ltr">+ tst_brkm(TCONF, cleanup,<br clear="none"></div><div dir="ltr">+ "/etc/passwd is not accessible");<br clear="none"></div><div dir="ltr">+ } else {<br clear="none"></div><div dir="ltr">+ tst_brkm(TBROK, cleanup, "Failed to run cmd: %s %s",<br clear="none"></div><div dir="ltr"> user_cmd, users[TEST_USER].name);<br clear="none"></div><div dir="ltr">+ }<br clear="none"></div><div dir="ltr"> }<br clear="none"></div><div dir="ltr"> }<br clear="none"></div><div dir="ltr"> <br clear="none"></div><div dir="ltr">-- <br clear="none"></div><div dir="ltr">2.7.4<br clear="none"></div><div dir="ltr"><br clear="none"></div> </div> </blockquote></div></div></div></div><br><br></div> </div> </div> </div></div></body></html>