From f91df76b59853cdcd8074ce50dd6dead18394831 Mon Sep 17 00:00:00 2001
From: C-Tim <tim@c-hack.de>
Date: Sun, 12 Sep 2021 23:13:28 +0200
Subject: [PATCH] fix(uffd-admin): Fix bug with util-linux fallback path

Use runuser instead of su, as su does not really support multiple arguments to -c

Fixes #112
---
 debian/contrib/uffd-admin | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/contrib/uffd-admin b/debian/contrib/uffd-admin
index 71cc81e5..eaa1063d 100755
--- a/debian/contrib/uffd-admin
+++ b/debian/contrib/uffd-admin
@@ -9,8 +9,8 @@ if [ "$(whoami)" = "uffd" ]; then
 	flask "$@"
 elif command -v sudo &> /dev/null; then
 	exec sudo --preserve-env=FLASK_APP,CONFIG_FILENAME -u uffd flask "$@"
-elif command -v su &> /dev/null; then
-	exec su -s /bin/sh --preserve-environment uffd -c flask "$@"
+elif command -v runuser &> /dev/null; then
+	exec runuser --preserve-environment -u uffd -- flask "$@"
 else
 	echo "Could not not become 'uffd' user, exiting"
 	exit 255
-- 
GitLab