From 248131ae9905cb3e45e8bee9246bd1b0cc96fb62 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 27 Feb 2001 09:47:16 +1100 Subject: [PATCH] - (djm) Warning fix on entropy.c saved uid stuff. Patch from Mark Miller --- ChangeLog | 4 +++- entropy.c | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f743c781..258bc047e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ - (djm) Search for -lcrypt on FreeBSD too - (djm) fatal() on OpenSSL version mismatch - (djm) Move PAM init to after fork for non-Solaris derived PAMs + - (djm) Warning fix on entropy.c saved uid stuff. Patch from Mark Miller + 20010226 - (bal) Fixed bsd-snprinf.c so it now honors 'BROKEN_SNPRINTF' again. @@ -4146,4 +4148,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.831 2001/02/26 22:28:23 djm Exp $ +$Id: ChangeLog,v 1.832 2001/02/26 22:47:16 djm Exp $ diff --git a/entropy.c b/entropy.c index 2b983bba3..04fdc5cce 100644 --- a/entropy.c +++ b/entropy.c @@ -40,7 +40,7 @@ #include "pathnames.h" #include "log.h" -RCSID("$Id: entropy.c,v 1.32 2001/02/26 22:20:58 djm Exp $"); +RCSID("$Id: entropy.c,v 1.33 2001/02/26 22:47:16 djm Exp $"); #ifndef offsetof # define offsetof(type, member) ((size_t) &((type *)0)->member) @@ -850,8 +850,8 @@ void init_rng(void) * Propagate the privileged uid to all of our uids. * Set the effective uid to the given (unprivileged) uid. */ - if (original_uid != original_euid && setuid(original_euid) == -1 || - seteuid(original_uid) == -1) + if (original_uid != original_euid && (setuid(original_euid) == -1 || + seteuid(original_uid) == -1)) fatal("Couldn't give up privileges"); #endif /* SAVED_IDS_WORK_WITH_SETEUID */ @@ -866,8 +866,8 @@ void init_rng(void) * Propagate the real uid (usually more privileged) to effective uid * as well. */ - if (original_uid != original_euid && seteuid(original_euid) == -1 || - setuid(original_uid) == -1) + if (original_uid != original_euid && (seteuid(original_euid) == -1 || + setuid(original_uid) == -1)) fatal("Couldn't restore privileges"); #endif /* SAVED_IDS_WORK_WITH_SETEUID */