From 9847f4e2769d0d808a846724f8dd74b83280fdd8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 17 Dec 2014 20:50:07 +0100 Subject: [PATCH] block: make sure /etc/ exists on the extroot MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise opening .extroot-uuid could fail. Signed-off-by: Rafał Miłecki --- block.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block.c b/block.c index 107ba64..c29017d 100644 --- a/block.c +++ b/block.c @@ -911,6 +911,10 @@ static int check_extroot(char *path) char tag[64]; char uuid[64] = { 0 }; + snprintf(tag, sizeof(tag), "%s/etc", path); + if (stat(tag, &s)) + mkdir_p(tag); + snprintf(tag, sizeof(tag), "%s/etc/.extroot-uuid", path); if (stat(tag, &s)) { fp = fopen(tag, "w+"); -- 2.25.1