fix logic bug inside extroot uuid verification code
authorJohn Crispin <john@phrozen.org>
Wed, 31 Aug 2016 16:16:31 +0000 (18:16 +0200)
committerJohn Crispin <john@phrozen.org>
Wed, 31 Aug 2016 16:16:31 +0000 (18:16 +0200)
Signed-off-by: John Crispin <john@phrozen.org>
block.c

diff --git a/block.c b/block.c
index 720ecb1..2e95c03 100644 (file)
--- a/block.c
+++ b/block.c
@@ -1108,7 +1108,7 @@ static int check_extroot(char *path)
                                         tag, errno, strerror(errno));
                        fclose(fp);
 
                                         tag, errno, strerror(errno));
                        fclose(fp);
 
-                       if (*uuid || !strcasecmp(uuid, pr->uuid))
+                       if (*uuid && !strcasecmp(uuid, pr->uuid))
                                return 0;
 
                        ULOG_ERR("extroot: UUID mismatch (root: %s, %s: %s)\n",
                                return 0;
 
                        ULOG_ERR("extroot: UUID mismatch (root: %s, %s: %s)\n",