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