From owner-freebsd-current@FreeBSD.ORG Sun Jun 15 18:55:00 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 288FF37B401; Sun, 15 Jun 2003 18:55:00 -0700 (PDT) Received: from obsecurity.dyndns.org (adsl-64-169-104-32.dsl.lsan03.pacbell.net [64.169.104.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id 881E343FD7; Sun, 15 Jun 2003 18:54:59 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: from rot13.obsecurity.org (rot13.obsecurity.org [10.0.0.5]) by obsecurity.dyndns.org (Postfix) with ESMTP id 4BAA566B9B; Sun, 15 Jun 2003 18:54:59 -0700 (PDT) Received: by rot13.obsecurity.org (Postfix, from userid 1000) id 2B6A8B78; Sun, 15 Jun 2003 18:54:59 -0700 (PDT) Date: Sun, 15 Jun 2003 18:54:59 -0700 From: Kris Kennaway To: current@FreeBSD.org, julian@FreeBSD.org Message-ID: <20030616015459.GA35478@rot13.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: Bogus "temporary" gethostbyaddr_r() in libc for 6 years X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 01:55:00 -0000 --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline There's a bogus implementation of gethostbyaddr_r() in lib/libc/net/gethostnamadr.c that was committed 6 years and nine months ago: /* * Temporary function (not thread safe) */ int gethostbyaddr_r(const char *addr, int len, int type, struct hostent *result, struct hostent_data *buffer) { struct hostent *hp; int ret; if ((hp = gethostbyaddr(addr, len, type)) == NULL) { ret = -1; } else { memcpy(result, hp, sizeof(struct hostent)); ret = 0; } return(ret); } What's the deal here? Despite the fact that this is not prototyped in a header, some ports are detecting this, and -- one assumes -- not behaving correctly since this implementation isn't thread-safe. Kris --ew6BAiZeqk4r7MaW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE+7SNyWry0BWjoQKURAsNSAJ0Q0gIQ7pAeJCK7Y5Mq8nwBKiD2OACgke/Z 4ZXfqwrGkAggEonA20rgVNw= =Mpmp -----END PGP SIGNATURE----- --ew6BAiZeqk4r7MaW--