aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-09-04 13:59:02 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-09-04 13:59:02 +0000
commitc8928081a5a9cbfaf16b14d4db57476bda8e1189 (patch)
tree2d7b495cd4352fd5facdeaeb500a394ba17b7714 /sink.c
parente588fb0f217d4ab7d1bfe8a1d292b8f556cefcb8 (diff)
downloadfetchmail-c8928081a5a9cbfaf16b14d4db57476bda8e1189.tar.gz
fetchmail-c8928081a5a9cbfaf16b14d4db57476bda8e1189.tar.bz2
fetchmail-c8928081a5a9cbfaf16b14d4db57476bda8e1189.zip
Cygwin port fix.
svn path=/trunk/; revision=3692
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sink.c b/sink.c
index ca2dc657..4e160206 100644
--- a/sink.c
+++ b/sink.c
@@ -937,6 +937,9 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg,
#ifdef HAVE_SIGACTION
struct sigaction sa_new;
#endif /* HAVE_SIGACTION */
+#ifdef HAVE_SETEUID
+ uid_t orig_uid;
+#endif /* HAVE_SETEUID */
struct idlist *idp;
int length = 0, fromlen = 0, nameslen = 0;
char *names = NULL, *before, *after, *from = NULL;
@@ -1062,6 +1065,7 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg,
* MDA creates properly. (The seteuid call is available
* under all BSDs and Linux)
*/
+ orig_uid = getuid();
seteuid(ctl->uid);
#endif /* HAVE_SETEUID */
@@ -1071,7 +1075,7 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg,
#ifdef HAVE_SETEUID
/* this will fail quietly if we didn't start as root */
- seteuid(0);
+ seteuid(orig_uid);
#endif /* HAVE_SETEUID */
if (!sinkfp)