be_* -> setperms()
This commit is contained in:
@@ -279,7 +279,7 @@ void log_error(code)
|
|||||||
#ifdef _PATH_SUDO_LOGFILE
|
#ifdef _PATH_SUDO_LOGFILE
|
||||||
|
|
||||||
/* become root */
|
/* become root */
|
||||||
be_root();
|
set_perms(PERM_ROOT);
|
||||||
|
|
||||||
oldmask = umask(077);
|
oldmask = umask(077);
|
||||||
fp = fopen(_PATH_SUDO_LOGFILE, "a");
|
fp = fopen(_PATH_SUDO_LOGFILE, "a");
|
||||||
@@ -343,7 +343,7 @@ void log_error(code)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* relinquish root */
|
/* relinquish root */
|
||||||
be_user();
|
set_perms(PERM_USER);
|
||||||
#endif /* _PATH_SUDO_LOGFILE */
|
#endif /* _PATH_SUDO_LOGFILE */
|
||||||
|
|
||||||
/* send mail if appropriate */
|
/* send mail if appropriate */
|
||||||
@@ -398,7 +398,7 @@ static void send_mail()
|
|||||||
/*
|
/*
|
||||||
* we don't want any security problems ...
|
* we don't want any security problems ...
|
||||||
*/
|
*/
|
||||||
be_full_user();
|
set_perms(PERM_FULL_USER);
|
||||||
|
|
||||||
#ifdef POSIX_SIGNALS
|
#ifdef POSIX_SIGNALS
|
||||||
action.sa_handler = SIG_IGN;
|
action.sa_handler = SIG_IGN;
|
||||||
|
4
parse.c
4
parse.c
@@ -532,7 +532,7 @@ int validate()
|
|||||||
int i, return_code;
|
int i, return_code;
|
||||||
|
|
||||||
/* become root */
|
/* become root */
|
||||||
be_root();
|
set_perms(PERM_ROOT);
|
||||||
|
|
||||||
if ((sudoers_fp = fopen(_PATH_SUDO_SUDOERS, "r")) == NULL) {
|
if ((sudoers_fp = fopen(_PATH_SUDO_SUDOERS, "r")) == NULL) {
|
||||||
perror(_PATH_SUDO_SUDOERS);
|
perror(_PATH_SUDO_SUDOERS);
|
||||||
@@ -558,7 +558,7 @@ int validate()
|
|||||||
(void) fclose(sudoers_fp);
|
(void) fclose(sudoers_fp);
|
||||||
|
|
||||||
/* relinquish root */
|
/* relinquish root */
|
||||||
be_user();
|
set_perms(PERM_USER);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if a parsing error occurred, set return_code accordingly
|
* if a parsing error occurred, set return_code accordingly
|
||||||
|
Reference in New Issue
Block a user