- (djm) Warning fix on entropy.c saved uid stuff. Patch from Mark Miller

<markm@swoon.net>
This commit is contained in:
Damien Miller 2001-02-27 09:47:16 +11:00
parent 5a7613186b
commit 248131ae99
2 changed files with 8 additions and 6 deletions

View File

@ -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
<markm@swoon.net>
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 $

View File

@ -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 */