dryang / rpms / systemd

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