From: Todd C. Miller Date: Mon, 28 Feb 1994 01:55:10 +0000 (+0000) Subject: saved current umask ans restores it X-Git-Tag: SUDO_1_3_1~317 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35bc172d3c16b3c8f6d98b83930344cc232392cb;p=sudo saved current umask ans restores it --- diff --git a/check.c b/check.c index 83fed9523..74bf0e41f 100644 --- 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 */ }