summaryrefslogtreecommitdiff
path: root/libexec/rexecd/rexecd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-22 01:59:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-22 01:59:21 +0000
commite8518c53ce38e3d83fefe33b9c1fb5447c97c3a6 (patch)
tree482c7f9a08c967eb12a1f70b258545fc7b4bf3dc /libexec/rexecd/rexecd.c
parent9ed58b9939fbb1691e61761b51324d562e62fa94 (diff)
seteuid for chdir
Diffstat (limited to 'libexec/rexecd/rexecd.c')
-rw-r--r--libexec/rexecd/rexecd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c
index e7062fed397..32caa98687b 100644
--- a/libexec/rexecd/rexecd.c
+++ b/libexec/rexecd/rexecd.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)rexecd.c 5.12 (Berkeley) 2/25/91";*/
-static char rcsid[] = "$Id: rexecd.c,v 1.2 1996/05/26 08:34:56 deraadt Exp $";
+static char rcsid[] = "$Id: rexecd.c,v 1.3 1996/07/22 01:59:20 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -161,10 +161,15 @@ doit(f, fromp)
exit(1);
}
}
+ setegid(pwd->pw_gid);
+ seteuid(pwd->pw_uid);
if (chdir(pwd->pw_dir) < 0) {
error("No remote directory.\n");
exit(1);
}
+ seteuid(0);
+ setegid(0); /* XXX use a saved gid instead? */
+
(void) write(2, "\0", 1);
if (port) {
(void) pipe(pv);