From eb7d4c81c12f79c29ad33d7671fe88632573fcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Fri, 3 Apr 1998 22:55:47 +0200 Subject: [PATCH] Fixed security hole. Rev: src/modules/Pipe/pipe.c:1.18 --- src/modules/Pipe/pipe.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/Pipe/pipe.c b/src/modules/Pipe/pipe.c index 8e1cd73fd7..cb5243499b 100644 --- a/src/modules/Pipe/pipe.c +++ b/src/modules/Pipe/pipe.c @@ -22,7 +22,7 @@ #include <fcntl.h> #include "global.h" -RCSID("$Id: pipe.c,v 1.17 1998/04/03 20:06:48 grubba Exp $"); +RCSID("$Id: pipe.c,v 1.18 1998/04/03 20:55:47 grubba Exp $"); #include "threads.h" #include "stralloc.h" @@ -446,15 +446,16 @@ static INLINE struct pike_string* gimme_some_data(unsigned long pos) this->firstinput && this->bytes_in_buffer<MAX_BYTES_IN_BUFFER) { - if (this->type == I_BLOCKING_OBJ) { + if (this->firstinput->type == I_BLOCKING_OBJ) { push_int(8192); push_int(1); /* We don't care if we don't get all 8192 bytes. */ - apply(i->u.obj, "read", 2); + apply(i->firstinput->u.obj, "read", 2); if (sp[-1].type == T_STRING) { append_buffer(sp[-1].u.string); } else { /* FIXME: Should probably check the return value. */ /* EOF */ + this->sleeping = 0; input_finish(); } pop_stack(); @@ -687,7 +688,7 @@ static void pipe_input(INT32 args) #ifdef HAVE_GETEUID if(ou) { #ifdef HAVE_SETEUID - seteuid(0); + seteuid(ou); #else /* ! HAVE_SETEUID */ #ifdef HAVE_SETREUID setresuid(-1, ou, -1); -- GitLab