[systemd-commits] src/cryptsetup

Lennart Poettering lennart at kemper.freedesktop.org
Mon Jun 23 10:20:51 PDT 2014


 src/cryptsetup/cryptsetup-generator.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit bde29068aa3815c88190a91e9867605a0aeaf9c4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 23 19:18:44 2014 +0200

    cryptsetup: don't add unit dependency on /dev/null devices when it is listed as password file
    
    As special magic, don't create device dependencies for /dev/null. Of
    course, there might be similar devices we might want to include, but
    given that none of them really make sense to specify as password source
    there's really no point in checking for anything else here.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=75816

diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 9530e44..da16324 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -29,6 +29,7 @@
 #include "mkdir.h"
 #include "strv.h"
 #include "fileio.h"
+#include "path-util.h"
 
 static const char *arg_dest = "/tmp";
 static bool arg_enabled = true;
@@ -144,16 +145,19 @@ static int create_disk(
                         if (!uu)
                                 return log_oom();
 
-                        if (is_device_path(uu)) {
-                                _cleanup_free_ char *dd;
+                        if (!path_equal(uu, "/dev/null")) {
 
-                                dd = unit_name_from_path(uu, ".device");
-                                if (!dd)
-                                        return log_oom();
+                                if (is_device_path(uu)) {
+                                        _cleanup_free_ char *dd;
 
-                                fprintf(f, "After=%1$s\nRequires=%1$s\n", dd);
-                        } else
-                                fprintf(f, "RequiresMountsFor=%s\n", password);
+                                        dd = unit_name_from_path(uu, ".device");
+                                        if (!dd)
+                                                return log_oom();
+
+                                        fprintf(f, "After=%1$s\nRequires=%1$s\n", dd);
+                                } else
+                                        fprintf(f, "RequiresMountsFor=%s\n", password);
+                        }
                 }
         }
 



More information about the systemd-commits mailing list