From scott@nts.umn.edu  Thu May  2 13:17:44 2002
Return-Path: <scott@nts.umn.edu>
Received: from nts.nts.umn.edu (nts.nts.umn.edu [128.101.4.1])
	by hub.freebsd.org (Postfix) with ESMTP id 246FC37B9A2
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 May 2002 13:15:48 -0700 (PDT)
Received: from ssb2.nts.umn.edu (ssb2.nts.umn.edu [160.94.7.1])
	by nts.nts.umn.edu (8.9.1a/8.9.1) with ESMTP id PAA27691;
	Thu, 2 May 2002 15:15:42 -0500 (CDT)
Received: (from scott@localhost)
	by ssb2.nts.umn.edu (8.11.6/8.10.2) id g42KFeh20323;
	Thu, 2 May 2002 15:15:40 -0500 (CDT)
Message-Id: <200205022015.g42KFeh20323@ssb2.nts.umn.edu>
Date: Thu, 2 May 2002 15:15:40 -0500 (CDT)
From: Scott Bertilson <scott@nts.umn.edu>
Reply-To: Scott Bertilson <scott@nts.umn.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Scott Bertilson <scott@nts.umn.edu>
Subject: misuse of inet_aton() in $FreeBSD: src/usr.sbin/portmap/portmap.c,v 1.10.2.1
X-Send-Pr-Version: 3.113

>Number:         37680
>Category:       bin
>Synopsis:       misuse of inet_aton() in $FreeBSD: src/usr.sbin/portmap/portmap.c,v 1.10.2.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dwmalone
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 02 13:20:01 PDT 2002
>Closed-Date:    Sun Aug 11 07:03:35 PDT 2002
>Last-Modified:  Sun Aug 11 07:03:35 PDT 2002
>Originator:     Scott Bertilson
>Release:        FreeBSD 4.4-RELEASE-p1 i386
>Organization:
University of Minnesota / OIT
>Environment:
System: FreeBSD ssb2.nts.umn.edu 4.4-RELEASE-p1 FreeBSD 4.4-RELEASE-p1 #13: Tue Apr 30 19:16:22 CDT 2002 scott@ssb2.nts.umn.edu:/home/src/sys/compile/SSB i386


>Description:
	at line 175:
	if (inet_aton(hosts[nhosts], &addr.sin_addr) < 0) {
>How-To-Repeat:
	Enter hostname instead of IP for "-h".
	Results in "address already in use" because it attempts
	to rebind 127.0.0.1.
>Fix:

	Change to conform to documented behavior of inet_aton()
	returning 0 for failure, 1 for success:
	if (!inet_aton(hosts[nhosts], &addr.sin_addr)) {

	Looks like it is also misused in $FreeBSD: src/usr.sbin/pppd/options.c,v 1.20.2.1
	at line 1815:
	if ((inet_aton(*argv, &mask)) == -1 || (netmask & ~mask.s_addr)) {
	which should be:
	if ((inet_aton(*argv, &mask)) != 1 || (netmask & ~mask.s_addr)) {
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Mon May 6 01:39:52 PDT 2002 
Responsible-Changed-Why:  
I've fixed pppd in -current, but the portmapper has been replaced 
by rpcbind in -current so there is nothing to fix there. I've asked 
the release engineers if I can fix the portmapper in -stable before 
4.6 is released. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37680 
State-Changed-From-To: open->closed 
State-Changed-By: dwmalone 
State-Changed-When: Sun Aug 11 07:00:20 PDT 2002 
State-Changed-Why:  
Fixed in -current and -stable some time ago, but I forgot to close 
the PR. Thanks for the patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37680 
>Unformatted:
