public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sandeep Patil <sspatil@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/5] chroot01: Use the 'tmpdir' we create.
Date: Mon,  5 Nov 2018 15:50:15 -0800	[thread overview]
Message-ID: <20181105235019.254846-2-sspatil@google.com> (raw)
In-Reply-To: <20181105235019.254846-1-sspatil@google.com>

Remove hard coded use of /tmp that breaks this test for Android and use
the tmpdir() we create in the setup() instead.

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
 testcases/kernel/syscalls/chroot/chroot01.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/chroot/chroot01.c b/testcases/kernel/syscalls/chroot/chroot01.c
index 9b0c30cf1..a1db5e157 100644
--- a/testcases/kernel/syscalls/chroot/chroot01.c
+++ b/testcases/kernel/syscalls/chroot/chroot01.c
@@ -54,7 +54,7 @@ char *TCID = "chroot01";
 int TST_TOTAL = 1;
 int fail;
 
-char path[] = "/tmp";
+char *path;
 
 char nobody_uid[] = "nobody";
 struct passwd *ltpuser;
@@ -94,6 +94,7 @@ void setup(void)
 	tst_require_root();
 
 	tst_tmpdir();
+	path = tst_get_tmpdir();
 
 	if ((ltpuser = getpwnam(nobody_uid)) == NULL)
 		tst_brkm(TBROK | TERRNO, cleanup,
@@ -110,5 +111,6 @@ void cleanup(void)
 {
 	SAFE_SETEUID(NULL, 0);
 
+	free(path);
 	tst_rmdir();
 }
-- 
2.19.1.930.g4563a0d9d0-goog


  reply	other threads:[~2018-11-05 23:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 23:50 [LTP] [PATCH 0/5] Misc cleanups (new lib) and fixes for Android Sandeep Patil
2018-11-05 23:50 ` Sandeep Patil [this message]
2018-11-06 15:45   ` [LTP] [PATCH 1/5] chroot01: Use the 'tmpdir' we create Cyril Hrubis
2018-11-05 23:50 ` [LTP] [PATCH 2/5] syscalls/chmod07: Use new ltp library Sandeep Patil
2018-11-06 15:46   ` Cyril Hrubis
2018-11-05 23:50 ` [LTP] [PATCH 3/5] syscalls/fchmod02: fall back to use "daemon" group if "users" is absent Sandeep Patil
2018-11-06 16:02   ` Cyril Hrubis
2018-11-05 23:50 ` [LTP] [PATCH 4/5] syscalls/chmod05: Use new ltp library Sandeep Patil
2018-11-06 15:55   ` Sandeep Patil
2018-11-06 16:01     ` Cyril Hrubis
2018-11-06 16:13       ` Sandeep Patil
2018-11-05 23:50 ` [LTP] [PATCH 5/5] syscalls/posix_fadvise0[13]: Start using new library Sandeep Patil
2018-11-06  7:00   ` Amir Goldstein
2018-11-06 15:52     ` Sandeep Patil
2018-11-06 15:54     ` Cyril Hrubis

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=20181105235019.254846-2-sspatil@google.com \
    --to=sspatil@google.com \
    --cc=ltp@lists.linux.it \
    /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