linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: linux-xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH] mkfs: check config realpath for errors
Date: Fri, 15 Jun 2018 17:39:41 -0500	[thread overview]
Message-ID: <7f95001f-8fb9-3965-0b40-05c434f39607@redhat.com> (raw)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/mkfs/config.c b/mkfs/config.c
index 3a389ad..9954691 100644
--- a/mkfs/config.c
+++ b/mkfs/config.c
@@ -573,7 +573,8 @@ open_config_file(
 			goto out;
 		}
 		/* Get absolute path to this file */
-		realpath(config_file, *fpath);
+		if (!realpath(config_file, *fpath))
+			goto out;
 		fd = openat(AT_FDCWD, config_file, O_NOFOLLOW, O_RDONLY);
 	}
 


             reply	other threads:[~2018-06-15 22:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 22:39 Eric Sandeen [this message]
2018-06-19 20:04 ` [PATCH] mkfs: check config realpath for errors Luis R. Rodriguez

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=7f95001f-8fb9-3965-0b40-05c434f39607@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-xfs@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).