From 4811d13451001d2e4759b5b4153fd56e9999759b Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 29 May 2023 18:09:04 +0200 Subject: [PATCH] ostree-prepare-root: Fix parsing of ot-composefs argument We need to compare strcmp() to zero. --- src/switchroot/ostree-prepare-root.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 762e5948ac..a65da45bab 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -245,15 +245,15 @@ main (int argc, char *argv[]) char *composefs_digest = NULL; if (ot_composefs) { - if (strcmp (ot_composefs, "off")) + if (strcmp (ot_composefs, "off") == 0) composefs_mode = OSTREE_COMPOSEFS_MODE_OFF; - else if (strcmp (ot_composefs, "maybe")) + else if (strcmp (ot_composefs, "maybe") == 0) composefs_mode = OSTREE_COMPOSEFS_MODE_MAYBE; - else if (strcmp (ot_composefs, "on")) + else if (strcmp (ot_composefs, "on") == 0) composefs_mode = OSTREE_COMPOSEFS_MODE_ON; - else if (strcmp (ot_composefs, "signed")) + else if (strcmp (ot_composefs, "signed") == 0) composefs_mode = OSTREE_COMPOSEFS_MODE_SIGNED; - else if (strncmp (ot_composefs, "digest=", strlen ("digest="))) + else if (strncmp (ot_composefs, "digest=", strlen ("digest=")) == 0) { composefs_mode = OSTREE_COMPOSEFS_MODE_DIGEST; composefs_digest = ot_composefs + strlen ("digest=");