From f4662d8c06d2c045ba939cc282ce37a33321d40c Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 18 Oct 2017 10:05:46 +0200 Subject: [PATCH] boomisc: Create /run/uuid for Void Linux if uuid user exists Signed-off-by: Joachim Nilsson --- plugins/bootmisc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/bootmisc.c b/plugins/bootmisc.c index e863f19f..6b818025 100644 --- a/plugins/bootmisc.c +++ b/plugins/bootmisc.c @@ -98,7 +98,7 @@ static void bootclean(void) */ static void setup(void *arg) { - int gid; + int uid, gid; /* Cleanup stale files, if any still linger on. */ bootclean(); @@ -165,6 +165,15 @@ static void setup(void *arg) makefifo("/dev/xconsole", 0640); /* sysklogd */ chown("/dev/xconsole", 0, getgroup("tty")); + /* Void Linux has a uuidd that runs as uuid:uuid and needs /run/uuid */ + uid = getuser("uuid", NULL); + if (uid >= 0) { + gid = getgroup("uuid"); + if (gid < 0) + gid = 0; + makedir("/var/run/uuid", uid, gid); + } + umask(022); }