2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Stash umask in struct sudo_user so we don't need to look it up later.

This commit is contained in:
Todd C. Miller
2013-03-28 15:40:32 -04:00
parent 5bac16f5cc
commit 38dac1e0a4
3 changed files with 9 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <stdio.h>
#ifdef STDC_HEADERS
@@ -318,6 +319,10 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
user_ngids = ngids;
}
/* Stash initial umask for later use. */
user_umask = umask(SUDO_UMASK);
umask(user_umask);
/* Setup debugging if indicated. */
if (debug_flags != NULL) {
sudo_debug_init(NULL, debug_flags);