NetBSD Problem Report #1292

From gnats  Fri Jul 28 12:51:01 1995
Received: from miller.cs.uwm.edu (miller.cs.uwm.edu [129.89.35.13]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id MAA02693 for <gnats-bugs@gnats.netbsd.org>; Fri, 28 Jul 1995 12:51:00 -0400
Message-Id: <199507281651.LAA07810@miller.cs.uwm.edu>
Date: Fri, 28 Jul 1995 11:51:06 -0500 (CDT)
From: James Jegers <jimj@miller.cs.uwm.edu>
To: gnats-bugs@gnats.netbsd.org
Subject: rexecd setlogin fix

>Number:         1292
>Category:       bin
>Synopsis:       rexed should set the login name
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 28 13:05:01 +0000 1995
>Closed-Date:    Tue May 21 11:06:30 +0000 1996
>Last-Modified:  Thu Jun 05 05:57:40 +0000 1997
>Originator:     James Jegers
>Release:        Current as of Jul 5<NetBSD-current source date>
>Organization:

>Environment:

System: NetBSD jimj.home.edu 1.0A NetBSD 1.0A (JIMJ) #4: Fri Jul 28 09:42:32 CDT 1995 jimj@jimj.home.edu:/usr/src/sys/arch/i386/compile/JIMJ i386

>Description:
	I run rexec from another machine to fire off an xterm on my screen.
	When I do this the xterm runs but my login id is not current.
	it comes up as root instead of me(the one who rexed'd in)
>How-To-Repeat:

>Fix:
	add the below line to rexecd/rexec.c similar to how it's done in rshd.


        if (*pwd->pw_shell == '\0')                                            
                pwd->pw_shell = _PATH_BSHELL;                                  
        if (f > 2)                                                             
                (void) close(f);                                               
-->     setlogin(pwd->pw_name);                                                
        (void) setgid((gid_t)pwd->pw_gid);                                     
        initgroups(pwd->pw_name, pwd->pw_gid);                                 
        (void) setuid((uid_t)pwd->pw_uid);                                     
        (void)strcat(path, _PATH_DEFPATH);                                     


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mrg 
State-Changed-When: Tue May 21 07:06:30 EDT 1996 
State-Changed-Why:  
added setlogin() call. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.