These checks are implemented in the rmobj.c file therefore there is no need to repeat them here since rmobj() is called for deletions.
Signed-off-by: Marios Makris <[email protected]> --- lib/tst_tmpdir.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/tst_tmpdir.c b/lib/tst_tmpdir.c index b6f4d2e..a9dd78c 100644 --- a/lib/tst_tmpdir.c +++ b/lib/tst_tmpdir.c @@ -194,8 +194,6 @@ void tst_tmpdir(void) void tst_rmdir(void) { - struct stat buf1; - struct stat buf2; char current_dir[PATH_MAX]; char *errmsg; char *parent_dir; @@ -229,21 +227,6 @@ void tst_rmdir(void) } /* - * Check that the value of TESTDIR is not "*" or "/". These could - * have disastrous effects in a test run by root. - */ - if (stat(TESTDIR, &buf1) == 0 && stat("/", &buf2) == 0 && - buf1.st_ino == buf2.st_ino) { - tst_resm(TWARN, "%s: will not remove /", __func__); - return; - } - - if (strchr(TESTDIR, '*') != NULL) { - tst_resm(TWARN, "%s: will not remove *", __func__); - return; - } - - /* * Get the directory name of TESTDIR. If TESTDIR is a relative path, * get full path. */ -- 1.7.9.5 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
