Subject: bin/4507: /sbin/route error message lacks program name
To: None <gnats-bugs@gnats.netbsd.org>
From: Andreas Gustafsson <gson@araneus.fi>
List: netbsd-bugs
Date: 11/16/1997 17:29:51
>Number:         4507
>Category:       bin
>Synopsis:       /sbin/route error message lacks program name
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 16 07:35:01 1997
>Last-Modified:
>Originator:     Andreas Gustafsson <gson@araneus.fi>
>Organization:
Araneus Information Systems Oy
>Release:        1.2
>Environment:
	
System: NetBSD guava.araneus.fi 1.2 NetBSD 1.2 (GUAVA) #0: Sun Sep 28 15:10:44 EET DST 1997 gson@guava.araneus.fi:/z/src/sys/arch/i386/compile/GUAVA i386


>Description:

If /sbin/route is given an unresolvable host name as an argument, it
will issue an error message which does not identify itself as being
from the "route" command.

>How-To-Repeat:

Misguidedly put a domain-less hostname, say, "guano", in /etc/myname,
omit said hostname from /etc/hosts, reboot, and see the following
error message scroll by amidst the boot messages:

  guano: bad value

Wonder which one of all the commands in /etc/rc issued the message.

>Fix:

Apply the following patch.  The patch is against 1.2, but the
bug also seems to exist in 1.3_ALPHA.

*** sbin/route/route.c.orig	Sun Nov 16 17:13:49 1997
--- sbin/route/route.c	Sun Nov 16 17:14:49 1997
***************
*** 885,891 ****
  		memcpy(&su->sin.sin_addr, hp->h_addr, hp->h_length);
  		return (1);
  	}
! 	(void) fprintf(stderr, "%s: bad value\n", s);
  	exit(1);
  }
  
--- 885,891 ----
  		memcpy(&su->sin.sin_addr, hp->h_addr, hp->h_length);
  		return (1);
  	}
! 	(void) fprintf(stderr, "route: %s: bad value\n", s);
  	exit(1);
  }
  
>Audit-Trail:
>Unformatted: