Skip to content

Commit

Permalink
chroot01: Use the 'tmpdir' we create.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Cyril Hrubis <[email protected]>
  • Loading branch information
patils authored and metan-ucw committed Nov 6, 2018
1 parent 816a548 commit 88dfb97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion testcases/kernel/syscalls/chroot/chroot01.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -110,5 +111,6 @@ void cleanup(void)
{
SAFE_SETEUID(NULL, 0);

free(path);
tst_rmdir();
}

0 comments on commit 88dfb97

Please sign in to comment.