From bfd4d4d0525e6afc2f6da0762e4ca5a596ffcf30 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sun, 15 Aug 2021 12:02:32 -0700 Subject: [PATCH] Fix container teardown failing --- system/src/riju-system-privileged.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/src/riju-system-privileged.c b/system/src/riju-system-privileged.c index b3f2bcd..aaf07e0 100644 --- a/system/src/riju-system-privileged.c +++ b/system/src/riju-system-privileged.c @@ -413,6 +413,8 @@ void exec(char *uuid, int argc, char **cmdline, bool pty) void teardown(char *uuid) { + if (setuid(0) != 0) + die("setuid failed"); char *cmdline; if (uuid != NULL) { if (asprintf(&cmdline, "rm -rf /var/cache/riju/shares/%s", uuid) < 0) @@ -433,8 +435,8 @@ void teardown(char *uuid) int main(int argc, char **argv) { init(); - if (setuid(0) != 0) - die("setuid failed"); + if (seteuid(0) != 0) + die("seteuid failed"); if (argc < 2) die_with_usage(); if (!strcmp(argv[1], "session")) {