Set aux group vector for PERM_RUNAS and restore group vector for

PERM_ROOT if we previously changed it.  Stash the runas group vector
so we don't have to call initgroups more than once. Also add no-op
check to check_perms.
This commit is contained in:
Todd C. Miller
2007-11-25 13:07:21 +00:00
parent f9f4aca556
commit a766300007
2 changed files with 98 additions and 20 deletions

View File

@@ -353,9 +353,8 @@ log_error(flags, fmt, va_alist)
va_start(ap);
#endif
/* Become root if we are not already to avoid user control */
if (geteuid() != 0)
set_perms(PERM_ROOT);
/* Become root if we are not already to avoid user interference */
set_perms(PERM_ROOT);
/* Expand printf-style format + args. */
evasprintf(&message, fmt, ap);