NetBSD Problem Report #417

From gnats  Tue Aug 16 14:13:58 1994
Received: from sunny.celsiustech.se (root@sunny.celsiustech.se [139.58.1.12]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id OAA00418 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Tue, 16 Aug 1994 14:13:40 -0700
Message-Id: <199408162022.WAA11537@sunny.celsiustech.se>
Date: Tue, 16 Aug 1994 22:22:20 +0200
From: maja@celsiustech.se
Reply-To: maja@celsiustech.se
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: NIS support in chpass seems to have some problems
X-Send-Pr-Version: 3.2

>Number:         417
>Category:       bin
>Synopsis:       Call to getrpcport in pw_yp (in chpass) destroys input param.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 16 14:20:04 +0000 1994
>Closed-Date:    Wed Aug 24 04:47:50 +0000 1994
>Last-Modified:  
>Originator:     Mats O Jansson
>Release:        NetBSD 1.0_BETA
>Organization:
CelsiusTech System AB, Jaerfaella, Sweden.
>Environment:
i386 at least...
System: NetBSD sunny.celsiustech.se 1.0_BETA NetBSD 1.0_BETA (SPARC) #1: Mon Aug 8 23:40:30 MET DST 1994 ppan@sunny.celsiustech.se:/usr/src/sys/arch/sparc/compile/SPARC sparc


>Description:
When developing rpc.yppasswdd I found that the daemon got
                the gecos information destroyed. The gecos information is
                truncated and seems to be replaced by parts of the clients
                hostname. When trying too decide where the information got
                corrupted I added printf lines in the pw_yp routine in chpass.

                At routine entry the contence of pw->pw_gecos was as
                expected.

                After the first and second code segment in the routine
                pw->pw_gecos is still ok.

	        After the 3:th code segment (call to getrpcport) the
                field is destroyed.

                It seems to be a result of gethostname that cause the
                the problem.

	        The same problem occurres when running against a Sun
                NIS server with a rpc.yppasswdd running.

>How-To-Repeat:
As user maja I run chpass

                traci# chpass
                #Changing user database information for maja.
                Full Name: Mats O Jansson
                Location: D0089
                Office Phone: 6016
                Home Phone: 08-711 70 37

                after exiting and a new chpass command all information
                except Home Phone is ok, Home Phone line is

                Home Phone: 0traci.celsiustech.se

                When I added the printf lines in the code the hostname
                was placed on the Location line.

>Fix:
	This was actually caused by pw_scan() passing around a pointer to an
	automatic variable, and the YP code keeping it and using it later,
	when it was no longer valid.  The simplest fix was to make the
	variable static.  - mycroft (explaining deraadt's change)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mycroft 
State-Changed-When: Tue Aug 23 21:47:50 PDT 1994 
State-Changed-Why:  
Fixed. 
>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.