diff options
author | Tim Rice <tim@multitalents.net> | 2002-04-21 11:26:10 -0700 |
---|---|---|
committer | Tim Rice <tim@multitalents.net> | 2002-04-21 11:26:10 -0700 |
commit | f02dccc0dc5711d5bdfb45f92a2f1bba41e365f0 (patch) | |
tree | db24726055f610d63839c5f1c6bcfb0f72e5d35a | |
parent | a370f4dcc6ae04c430ad97c28a2bd945c2350120 (diff) |
[entropy.c.] Portability fix for SCO Unix 3.2v4.x (SCO OSR 3.0).
entropy.c needs seteuid(getuid()) for the setuid(original_uid) to succeed.
Patch by gert@greenie.muc.de. This fixes one part of Bug 208
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | entropy.c | 9 |
2 files changed, 11 insertions, 5 deletions
@@ -1,3 +1,8 @@ | |||
1 | 20020421 | ||
2 | - (tim) [entropy.c.] Portability fix for SCO Unix 3.2v4.x (SCO OSR 3.0). | ||
3 | entropy.c needs seteuid(getuid()) for the setuid(original_uid) to succeed. | ||
4 | Patch by gert@greenie.muc.de. This fixes one part of Bug 208 | ||
5 | |||
1 | 20020418 | 6 | 20020418 |
2 | - (djm) Avoid SIGCHLD breakage when run from rsync. Fix from | 7 | - (djm) Avoid SIGCHLD breakage when run from rsync. Fix from |
3 | Sturle Sunde <sturle.sunde@usit.uio.no> | 8 | Sturle Sunde <sturle.sunde@usit.uio.no> |
@@ -8258,4 +8263,4 @@ | |||
8258 | - Wrote replacements for strlcpy and mkdtemp | 8263 | - Wrote replacements for strlcpy and mkdtemp |
8259 | - Released 1.0pre1 | 8264 | - Released 1.0pre1 |
8260 | 8265 | ||
8261 | $Id: ChangeLog,v 1.2060 2002/04/18 12:53:22 djm Exp $ | 8266 | $Id: ChangeLog,v 1.2061 2002/04/21 18:26:10 tim Exp $ |
@@ -45,7 +45,7 @@ | |||
45 | * XXX: we should tell the child how many bytes we need. | 45 | * XXX: we should tell the child how many bytes we need. |
46 | */ | 46 | */ |
47 | 47 | ||
48 | RCSID("$Id: entropy.c,v 1.42 2002/04/18 12:53:27 djm Exp $"); | 48 | RCSID("$Id: entropy.c,v 1.43 2002/04/21 18:26:10 tim Exp $"); |
49 | 49 | ||
50 | #ifndef OPENSSL_PRNG_ONLY | 50 | #ifndef OPENSSL_PRNG_ONLY |
51 | #define RANDOM_SEED_SIZE 48 | 51 | #define RANDOM_SEED_SIZE 48 |
@@ -87,9 +87,10 @@ seed_rng(void) | |||
87 | close(devnull); | 87 | close(devnull); |
88 | 88 | ||
89 | if (original_uid != original_euid && | 89 | if (original_uid != original_euid && |
90 | setuid(original_uid) == -1) { | 90 | ( seteuid(getuid()) == -1 || |
91 | fprintf(stderr, "(rand child) setuid: %s\n", | 91 | setuid(original_uid) == -1) ) { |
92 | strerror(errno)); | 92 | fprintf(stderr, "(rand child) setuid(%d): %s\n", |
93 | original_uid, strerror(errno)); | ||
93 | _exit(1); | 94 | _exit(1); |
94 | } | 95 | } |
95 | 96 | ||