richardphibel / rpms / systemd

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