diff options
| author | dsl <dsl@NetBSD.org> | 2003-03-03 18:29:55 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2003-03-03 18:29:55 +0000 |
| commit | 2bc2d2208dfb2b0301d76b2cbf3825a874912bd6 (patch) | |
| tree | 5a8b215cd3620d11f53128b86645d1325e55da69 /libexec | |
| parent | de1c071819a2523633e8ae84891934ade9b1700c (diff) | |
Call setsid() before (setusercontext() calls) setlogin() so we don't change
the username of inetd and everyone else that is logged in.
(approved by christos)
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/rshd/rshd.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c index cca82b01887..197e7a73b74 100644 --- a/libexec/rshd/rshd.c +++ b/libexec/rshd/rshd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rshd.c,v 1.28 2002/09/23 12:48:03 mycroft Exp $ */ +/* $NetBSD: rshd.c,v 1.29 2003/03/03 18:29:55 dsl Exp $ */ /* * Copyright (C) 1998 WIDE Project. @@ -73,7 +73,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; #else -__RCSID("$NetBSD: rshd.c,v 1.28 2002/09/23 12:48:03 mycroft Exp $"); +__RCSID("$NetBSD: rshd.c,v 1.29 2003/03/03 18:29:55 dsl Exp $"); #endif #endif /* not lint */ @@ -542,16 +542,12 @@ fail: } while ((set[0].revents | set[1].revents) & POLLIN); exit(0); } - setpgrp(0, getpid()); (void) close(s); (void) close(pv[0]); dup2(pv[1], 2); close(pv[1]); } -#if BSD > 43 - if (setlogin(pwd->pw_name) < 0) - syslog(LOG_ERR, "setlogin() failed: %m"); -#endif + setsid(); if (*pwd->pw_shell == '\0') pwd->pw_shell = _PATH_BSHELL; |
