All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Stoeckmann <tobias@stoeckmann.org>
To: util-linux@vger.kernel.org
Subject: [PATCH] libblkid: Fix blkid.conf parsing
Date: Sun, 12 Mar 2017 17:48:44 +0100	[thread overview]
Message-ID: <20170312164844.GA28165@localhost> (raw)

The SEND_UEVENT=yes|no line is not properly parsed, because the offset
jumps one byte too far behind the equal sign. Therefore, every
configuration that contains the line "SEND_UEVENT=yes" still does not
send an uevent.

The fix is simple: adjust the offset to be "12" instead of "13".
---
 libblkid/src/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libblkid/src/config.c b/libblkid/src/config.c
index 1822f1c67..52f159d87 100644
--- a/libblkid/src/config.c
+++ b/libblkid/src/config.c
@@ -88,7 +88,7 @@ static int parse_next(FILE *fd, struct blkid_config *conf)
 	} while (*s == '\0' || *s == '#');
 
 	if (!strncmp(s, "SEND_UEVENT=", 12)) {
-		s += 13;
+		s += 12;
 		if (*s && !strcasecmp(s, "yes"))
 			conf->uevent = TRUE;
 		else if (*s)
-- 
2.12.0


             reply	other threads:[~2017-03-12 16:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12 16:48 Tobias Stoeckmann [this message]
2017-03-13 12:05 ` [PATCH] libblkid: Fix blkid.conf parsing Karel Zak

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=20170312164844.GA28165@localhost \
    --to=tobias@stoeckmann.org \
    --cc=util-linux@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 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.