Subject: bin/417: NIS support in chpass seems to have some problems
To: None <gnats-admin>
From: None <maja@celsiustech.se>
List: netbsd-bugs
Date: 08/16/1994 14:20:05
>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 (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 16 14:20:04 1994
>Originator:     Mats O Jansson
>Organization:
CelsiusTech System AB, Jaerfaella, Sweden.
>Release:        NetBSD 1.0_BETA
>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:
I don't know, it might be problems the allocation of the
                result string for the gecos information.
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------