c62b8e
From e290169c17a7ca56aa0fce25879656b8e598e1de Mon Sep 17 00:00:00 2001
c62b8e
From: ettavolt <ettavolt@gmail.com>
c62b8e
Date: Mon, 4 Sep 2017 16:36:52 +0300
c62b8e
Subject: [PATCH] 6647 - use path_startswith("/dev") in cryptsetup (#6732)
c62b8e
c62b8e
For both key and partition paths.
c62b8e
c62b8e
(cherry picked from commit 048dd629c4590eefb2ebd6a316c7350ed3a6ff19)
c62b8e
c62b8e
Resolves: #1664695
c62b8e
---
c62b8e
 src/cryptsetup/cryptsetup-generator.c | 4 ++--
c62b8e
 1 file changed, 2 insertions(+), 2 deletions(-)
c62b8e
c62b8e
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
c62b8e
index 7b90d26156..b2edbfe298 100644
c62b8e
--- a/src/cryptsetup/cryptsetup-generator.c
c62b8e
+++ b/src/cryptsetup/cryptsetup-generator.c
c62b8e
@@ -215,7 +215,7 @@ static int create_disk(
c62b8e
 
c62b8e
                         if (!path_equal(uu, "/dev/null")) {
c62b8e
 
c62b8e
-                                if (is_device_path(uu)) {
c62b8e
+                                if (path_startswith(uu, "/dev/")) {
c62b8e
                                         _cleanup_free_ char *dd;
c62b8e
 
c62b8e
                                         dd = unit_name_from_path(uu, ".device");
c62b8e
@@ -229,7 +229,7 @@ static int create_disk(
c62b8e
                 }
c62b8e
         }
c62b8e
 
c62b8e
-        if (is_device_path(u))
c62b8e
+        if (path_startswith(u, "/dev/"))
c62b8e
                 fprintf(f,
c62b8e
                         "BindsTo=%s\n"
c62b8e
                         "After=%s\n"