From 811ad38e6f3d4f95fe9237dde95ced33c9164f52 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Wed, 1 Feb 2023 21:44:46 +0900 Subject: [PATCH] tests: (mkfds) check the privilege required in the factory to run Signed-off-by: Masatake YAMATO --- tests/helpers/test_mkfds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c index e37225aaf2..7f8f199f04 100644 --- a/tests/helpers/test_mkfds.c +++ b/tests/helpers/test_mkfds.c @@ -2065,6 +2065,9 @@ int main(int argc, char **argv) errx(EXIT_FAILURE, _("not enough file descriptors given for %s"), factory->name); + if (factory->priv && getuid() != 0) + errx(EXIT_FAILURE, "%s factory requires root privilege", factory->name); + for (int i = 0; i < MAX_N; i++) { fdescs[i].fd = -1; fdescs[i].close = NULL; -- 2.47.3