]> granicus.if.org Git - sudo/commitdiff
saved current umask ans restores it
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 28 Feb 1994 01:55:10 +0000 (01:55 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 28 Feb 1994 01:55:10 +0000 (01:55 +0000)
check.c

diff --git a/check.c b/check.c
index 83fed95235eb3e7333411fcfb3267cc1c7337d9f..74bf0e41f2043460bc3aa1beb6edc91209bbf643 100644 (file)
--- a/check.c
+++ b/check.c
@@ -77,15 +77,16 @@ static int timedir_is_good;
 void check_user()
 {
     register int rtn;
+    mode_t oldmask;
 
-    umask(077);                        /* make sure the timestamp files are private */
+    oldmask = umask(077);      /* make sure the timestamp files are private */
 
     rtn = check_timestamp();
     if (rtn && uid)            /* if timestamp is not current... */
        check_passwd();
 
     update_timestamp();
-    umask(022);                        /* want a real umask to exec() the command */
+    (void) umask(oldmask);     /* want a real umask to exec() the command */
 
 }