chiark / gitweb /
cryptsetup: Fix timeout on dm device.
authorHugo Grostabussiat <bonstra@bonstra.fr.eu.org>
Sun, 28 Sep 2014 01:05:41 +0000 (03:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Oct 2014 00:14:49 +0000 (02:14 +0200)
Fix a bug in systemd-cryptsetup-generator which caused the drop-in
setting the job timeout for the dm device unit to be written with a
name different than the unit name.

https://bugs.freedesktop.org/show_bug.cgi?id=84409

src/cryptsetup/cryptsetup-generator.c

index c7f30f6..05ceff4 100644 (file)
@@ -246,7 +246,12 @@ static int create_disk(
         }
 
         if (!noauto && !nofail) {
-                r = write_drop_in(arg_dest, name, 90, "device-timeout",
+                _cleanup_free_ char *dmname;
+                dmname = strjoin("dev-mapper-", e, ".device", NULL);
+                if (!dmname)
+                        return log_oom();
+
+                r = write_drop_in(arg_dest, dmname, 90, "device-timeout",
                                   "# Automatically generated by systemd-cryptsetup-generator \n\n"
                                   "[Unit]\nJobTimeoutSec=0");
                 if (r < 0) {