Subject: bin/5831: [PATCH] atc should use nodename, not sysname
To: None <gnats-bugs@gnats.netbsd.org>
From: Joseph Myers <jsm@octomino.demon.co.uk>
List: netbsd-bugs
Date: 07/24/1998 14:29:01
>Number:         5831
>Category:       bin
>Synopsis:       [PATCH] atc should use nodename, not sysname
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 24 10:05:02 1998
>Last-Modified:
>Originator:     Joseph Samuel Myers
>Organization:
Trinity College, University of Cambridge, UK
>Release:        NetBSD-current of 1998-07-11
>Environment:
	
[
System: Linux octomino 2.0.35 #1 Tue Jul 14 19:09:50 UTC 1998 i586 unknown
Architecture: i586
]
>Description:

atc uses the sysname field of a struct utsname where it should use the
nodename field.  The patch below, from the Linux port of the NetBSD
games, fixes this problem.

>How-To-Repeat:

Get a score in the table and observe that the host is wrongly given as
the operating system name.

>Fix:

--- atc/log.c	Sat Oct 11 11:49:41 1997
+++ atc+/log.c	Fri Jul 24 13:48:50 1998
@@ -157,7 +157,7 @@
 		}
 		strcpy(thisscore.name, pw->pw_name);
 		uname(&name);
-		strncpy(thisscore.host, name.sysname, sizeof(thisscore.host)-1);
+		strncpy(thisscore.host, name.nodename, sizeof(thisscore.host)-1);
 		thisscore.host[sizeof(thisscore.host) - 1] = '\0';
 
 		cp = strrchr(file, '/');
>Audit-Trail:
>Unformatted: