From: Alexandre Rossi <niol@zincube.net>
Description: use secure --daemonize umask
  When using --pidfile with --daemonize, the created pidfile is world writeable
  and this breaks stop action of initscripts using start-stop-daemon.
  This may also enable a normal user to kill any process.
Forwarded: https://github.com/unbit/uwsgi/pull/2752

--- uwsgi.git.orig/core/utils.c	2025-08-15 09:04:11.886145707 +0200
+++ uwsgi.git/core/utils.c	2026-02-22 18:01:37.268355840 +0100
@@ -159,7 +159,7 @@
 	}
 
 	if (!uwsgi.do_not_change_umask) {
-		umask(0);
+		umask(022);
 	}
 
 	/*if (chdir("/") != 0) {
