On 18 July 2012 12:32, Wanlong Gao <[email protected]> wrote:
> 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 <[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;
>> -     }
>
> Seems that rmobj() doesn't check the "*" there?
>
> Thanks,
> Wanlong Gao
>

Hi and thanks for reviewing.

Well rmobj doesn't check for "*", but it uses remove and unlink and
if i am not wrong they don't do the "*" expansion?



-- 
Marios Makris

------------------------------------------------------------------------------
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

Reply via email to