From: Wanlong G. <gao...@cn...> - 2012-07-18 09:33:02
|
On 07/13/2012 11:51 PM, Marios Makris wrote: > 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 <mar...@gm...> > --- > 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; > - } Seems that rmobj() doesn't check the "*" there? Thanks, Wanlong Gao > - > - /* > * Get the directory name of TESTDIR. If TESTDIR is a relative path, > * get full path. > */ > |