linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Cc: Anand Jain <anand.jain@oracle.com>
Subject: [PATCH] btrfs-progs: Fix check_arg_type() which doesn't use realpath() result.
Date: Wed, 12 Feb 2014 13:44:37 +0800	[thread overview]
Message-ID: <1392183877-25032-1-git-send-email-quwenruo@cn.fujitsu.com> (raw)

Fix a problem that does not use the result of realpath(), which caused
check_arg_type() can't handle mount point which ends with a final '/'.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: Anand Jain <anand.jain@oracle.com>
---
 cmds-filesystem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index b12976f..e3c1156 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -448,10 +448,10 @@ static int check_arg_type(char *input)
 		return -EINVAL;
 
 	if (realpath(input, path)) {
-		if (is_block_device(input) == 1)
+		if (is_block_device(path) == 1)
 			return BTRFS_ARG_BLKDEV;
 
-		if (is_mount_point(input) == 1)
+		if (is_mount_point(path) == 1)
 			return BTRFS_ARG_MNTPOINT;
 
 		return BTRFS_ARG_UNKNOWN;
-- 
1.8.5.4


                 reply	other threads:[~2014-02-12  5:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1392183877-25032-1-git-send-email-quwenruo@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).