From owner-freebsd-bugs Tue Mar 25 14:40:16 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 892A637B401 for ; Tue, 25 Mar 2003 14:40:13 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8825643FA3 for ; Tue, 25 Mar 2003 14:40:12 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2PMeCNS000885 for ; Tue, 25 Mar 2003 14:40:12 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2PMeCqa000884; Tue, 25 Mar 2003 14:40:12 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7AF1437B401 for ; Tue, 25 Mar 2003 14:31:15 -0800 (PST) Received: from marius.org (cdm-66-156-207-bcst.cox-internet.com [66.76.156.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC46343FE1 for ; Tue, 25 Mar 2003 14:31:14 -0800 (PST) (envelope-from marius@marius.org) Received: from marius.org (localhost [127.0.0.1]) by marius.org (8.12.8/8.12.6) with ESMTP id h2PMVED5079989 for ; Tue, 25 Mar 2003 16:31:14 -0600 (CST) (envelope-from marius@marius.org) Received: (from marius@localhost) by marius.org (8.12.8/8.12.6/Submit) id h2PMVD8H079988; Tue, 25 Mar 2003 16:31:13 -0600 (CST) Message-Id: <200303252231.h2PMVD8H079988@marius.org> Date: Tue, 25 Mar 2003 16:31:13 -0600 (CST) From: Marius Strom Reply-To: Marius Strom To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: misc/50299: Resolver rejects hostnames with underscores X-Spam-Status: No, hits=-19.6 required=5.0 tests=AWL,PATCH_UNIFIED_DIFF,RESENT_TO autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 50299 >Category: misc >Synopsis: Resolver rejects hostnames with underscores >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Mar 25 14:40:12 PST 2003 >Closed-Date: >Last-Modified: >Originator: Marius Strom >Release: FreeBSD 4.7-STABLE i386 >Organization: marius dot org >Environment: System: FreeBSD sashimi.marius.org 4.7-STABLE FreeBSD 4.7-STABLE #2: Mon Nov 4 21:52:24 CST 2002 root@sashimi.marius.org:/usr/obj/usr/src/sys/SASHIMI.MARIUS.ORG-AMD i386 >Description: FreeBSD's resolver will reject hostnames/domains that have underscores in them. While RFC952 forbids these, RFC952 does not cover DNS. RFC2181 does, and lists no such restriction. Other OS (Microsoft, Mac OS X, Linux, etc.) do not have this restriction. >How-To-Repeat: ping host_name_with_underscore.domain.tld (subsitute ping for any tool using the FreeBSD resolver) >Fix: Apply this patch: --- lib/libc/net/res_comp.c.orig Tue Mar 25 16:23:06 2003 +++ lib/libc/net/res_comp.c Tue Mar 25 16:24:21 2003 @@ -144,13 +144,14 @@ #define hyphenchar(c) ((c) == 0x2d) #define bslashchar(c) ((c) == 0x5c) #define periodchar(c) ((c) == PERIOD) +#define uscorechar(c) ((c) == 0x5f) #define asterchar(c) ((c) == 0x2a) #define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \ || ((c) >= 0x61 && (c) <= 0x7a)) #define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) #define borderchar(c) (alphachar(c) || digitchar(c)) -#define middlechar(c) (borderchar(c) || hyphenchar(c)) +#define middlechar(c) (borderchar(c) || hyphenchar(c) || uscorechar(c)) #define domainchar(c) ((c) > 0x20 && (c) < 0x7f) int >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message