]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
jail: Reset umask to 022
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 17:44:44 +0000 (17:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 17:44:44 +0000 (17:44 +0000)
Fixes: #13806
Reported-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/jail.c

index 1941c889a4797b60179813e92cf2da5649ff1af2..48940fe048f99296729c054ac57c735d96497aad 100644 (file)
@@ -32,6 +32,7 @@
 #include <sys/personality.h>
 #include <sys/prctl.h>
 #include <sys/resource.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 
 // libnl3
@@ -1254,6 +1255,9 @@ static int pakfire_jail_child(struct pakfire_jail* jail, struct pakfire_jail_exe
                }
        }
 
+       // Reset umask to 022 - this always succeeds
+       umask(S_IWGRP|S_IWOTH);
+
        // Create a new session
        r = setsid();
        if (r < 0) {