Skip to contentSkip to conversation

libblkid: Fix blkid.conf parsing

PATCH Applied Tobias Stoeckmann 2 participants 2 messages Mar 12, 2017 – Mar 13, 2017 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libblkid: Fix blkid.conf parsing

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(-)
libblkid/src/config.c +1 -1
index 1822f1c67..52f159d87 100644
@@ -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)
Signature · 1 line
2.12.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Tobias Stoeckmann
 libblkid/src/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Tobias, use Signed-off-by line for your patches next time, please ;-)

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com