chiark / gitweb /
cryptsetup-generator: fix /etc/cryptsetup options
authorMichal Schmidt <mschmidt@redhat.com>
Mon, 6 Jun 2011 20:59:19 +0000 (22:59 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 6 Jun 2011 20:59:19 +0000 (22:59 +0200)
cryptsetup-generator parses the options in /etc/cryptsetup incorrectly.
It fails to find the 'swap' option in
  swap,foo
and instead it matches on
  swaplalala,foo

The condition for the comma separator is reversed.

https://bugzilla.redhat.com/show_bug.cgi?id=710839

src/cryptsetup-generator.c

index 696f44ae3670dee8868a1b97f6d8d93858560c30..db8ebdfb1882cfe00301af142f4908bcaee9e779 100644 (file)
@@ -47,7 +47,7 @@ static bool has_option(const char *haystack, const char *needle) {
                         continue;
                 }
 
-                if (f[l] != 0 && f[l] == ',') {
+                if (f[l] != 0 && f[l] != ',') {
                         f++;
                         continue;
                 }