From 76fc83ee7ee4a01abfde2b40c902aa96fa9db81e Mon Sep 17 00:00:00 2001 From: Hugo Grostabussiat Date: Sun, 28 Sep 2014 03:05:41 +0200 Subject: [PATCH] cryptsetup: Fix timeout on dm device. 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. Fixes bug 84409. --- src/cryptsetup/cryptsetup-generator.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index 137b787..cbd3d93 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -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) { -- 2.1.1