From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Marios Makris <marios.makris@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 4/6] /lib/tst_tmpdir.c removed / and * checks
Date: Wed, 18 Jul 2012 17:32:12 +0800 [thread overview]
Message-ID: <5006829C.7080308@cn.fujitsu.com> (raw)
In-Reply-To: <1342194676-15275-4-git-send-email-marios.makris@gmail.com>
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 <marios.makris@gmail.com>
> ---
> 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.
> */
>
------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2012-07-18 9:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1342194676-15275-1-git-send-email-marios.makris@gmail.com>
[not found] ` <1342194676-15275-2-git-send-email-marios.makris@gmail.com>
2012-07-18 8:11 ` [LTP] [PATCH 2/6] Add mkdtemp check Wanlong Gao
[not found] ` <1342194676-15275-3-git-send-email-marios.makris@gmail.com>
2012-07-18 8:12 ` [LTP] [PATCH 3/6] /lib/tst_tmpdir.c removed mkstemp method Wanlong Gao
2012-07-18 8:20 ` [LTP] [PATCH 1/6] /lib/tst_tmpdir indentation and coding style fixes Wanlong Gao
2012-07-18 13:32 ` marios.makris
2012-07-18 13:51 ` Caspar Zhang
2012-07-18 14:42 ` marios.makris
2012-07-18 16:20 ` Caspar Zhang
[not found] ` <1342194676-15275-4-git-send-email-marios.makris@gmail.com>
2012-07-18 9:32 ` Wanlong Gao [this message]
2012-07-18 13:29 ` [LTP] [PATCH 4/6] /lib/tst_tmpdir.c removed / and * checks marios.makris
[not found] ` <1342194676-15275-5-git-send-email-marios.makris@gmail.com>
2012-07-18 9:40 ` [LTP] [PATCH 5/6] /lib/tst_tmpdir.c removed the TDIRECTORY part Wanlong Gao
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=5006829C.7080308@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=marios.makris@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.