From owner-freebsd-standards@FreeBSD.ORG Mon Oct 15 11:06:14 2012 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66E60519 for ; Mon, 15 Oct 2012 11:06:14 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 33C318FC2B for ; Mon, 15 Oct 2012 11:06:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9FB6E8k011614 for ; Mon, 15 Oct 2012 11:06:14 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9FB6Egp011613 for freebsd-standards@FreeBSD.org; Mon, 15 Oct 2012 11:06:14 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 15 Oct 2012 11:06:14 GMT Message-Id: <201210151106.q9FB6Egp011613@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 11:06:14 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). From owner-freebsd-standards@FreeBSD.ORG Wed Oct 17 05:40:00 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6D9B3F2 for ; Wed, 17 Oct 2012 05:40:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 9A6698FC1D for ; Wed, 17 Oct 2012 05:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9H5e0g2049993 for ; Wed, 17 Oct 2012 05:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9H5e08k049992; Wed, 17 Oct 2012 05:40:00 GMT (envelope-from gnats) Resent-Date: Wed, 17 Oct 2012 05:40:00 GMT Resent-Message-Id: <201210170540.q9H5e08k049992@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-standards@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Zhihao Yuan Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9E6CC4 for ; Wed, 17 Oct 2012 05:30:35 +0000 (UTC) (envelope-from lichray@gmail.com) Received: from mail-ia0-f182.google.com (mail-ia0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6D9AE8FC14 for ; Wed, 17 Oct 2012 05:30:35 +0000 (UTC) Received: by mail-ia0-f182.google.com with SMTP id k10so6794235iag.13 for ; Tue, 16 Oct 2012 22:30:34 -0700 (PDT) Received: by 10.50.197.169 with SMTP id iv9mr498491igc.32.1350451834602; Tue, 16 Oct 2012 22:30:34 -0700 (PDT) Received: from localhost (md75036d0.tmodns.net. [208.54.80.215]) by mx.google.com with ESMTPS id x7sm10876715igk.8.2012.10.16.22.30.30 (version=SSLv3 cipher=OTHER); Tue, 16 Oct 2012 22:30:33 -0700 (PDT) Message-Id: <507e4279.8728320a.3464.ffffbdbd@mx.google.com> Date: Tue, 16 Oct 2012 22:30:33 -0700 (PDT) From: Zhihao Yuan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: standards/172805: Fix catopen(3)'s EINVAL usage and document EFTYPE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Zhihao Yuan List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 05:40:00 -0000 >Number: 172805 >Category: standards >Synopsis: Fix catopen(3)'s EINVAL usage and document EFTYPE >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 17 05:40:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Zhihao Yuan >Release: FreeBSD 8.3-STABLE amd64 >Organization: Northern Illinois University >Environment: System: FreeBSD elitebook.hp 8.3-STABLE FreeBSD 8.3-STABLE #4 r240363: Tue Sep 11 10:40:15 CDT 2012 lichray@elitebook.hp:/usr/obj/usr/src/sys/HOUKAGO amd64 >Description: 1. catopen("", 0) should set errno to ENOENT; 2. Document EFTYPE. POSIX says nothing about how to report a corrupt catalog. NetBSD and OpenBSD do nothing (errno == 0), while we set EFTYPE. Document it. 3. Fix errno under a rare condition (fstat(2) fails after open(2)). >How-To-Repeat: >Fix: --- catopen3.patch begins here --- diff --git lib/libc/nls/catopen.3 lib/libc/nls/catopen.3 index 7a16ee5..219c2cb 100644 --- lib/libc/nls/catopen.3 +++ lib/libc/nls/catopen.3 @@ -27,7 +27,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd February 12, 2005 +.Dd October 17, 2012 .Dt CATOPEN 3 .Os .Sh NAME @@ -132,10 +132,13 @@ Otherwise, (nl_catd) -1 is returned and is set to indicate the error. .Sh ERRORS .Bl -tag -width Er +.It Bq Er EFTYPE +The named message catalog is corrupt. .It Bq Er EINVAL Argument .Fa name -does not point to a valid message catalog, or catalog is corrupt. +points to +.Dv NULL . .It Bq Er ENAMETOOLONG An entire path to the message catalog exceeded 1024 characters. .It Bq Er ENOENT @@ -154,4 +157,4 @@ Insufficient memory is available. The .Fn catopen function conforms to -.St -p1003.1-2001 . +.St -p1003.1-2008 . diff --git lib/libc/nls/msgcat.c lib/libc/nls/msgcat.c index 44b1440..2c77788 100644 --- lib/libc/nls/msgcat.c +++ lib/libc/nls/msgcat.c @@ -119,8 +119,10 @@ catopen(const char *name, int type) char path[PATH_MAX]; /* sanity checking */ - if (name == NULL || *name == '\0') + if (name == NULL) NLRETERR(EINVAL); + if (*name == '\0') + NLRETERR(ENOENT); if (strchr(name, '/') != NULL) /* have a pathname */ @@ -367,6 +369,7 @@ load_msgcat(const char *path, const char *name, const char *lang) struct catentry *np; void *data; int fd; + int saved_errno; /* path/name will never be NULL here */ @@ -390,9 +393,10 @@ load_msgcat(const char *path, const char *name, const char *lang) } if (_fstat(fd, &st) != 0) { + saved_errno = errno; _close(fd); - SAVEFAIL(name, lang, EFTYPE); - NLRETERR(EFTYPE); + SAVEFAIL(name, lang, saved_errno); + NLRETERR(saved_errno); } /* @@ -408,7 +412,7 @@ load_msgcat(const char *path, const char *name, const char *lang) if ((data = mmap(0, (size_t)st.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, (off_t)0)) == MAP_FAILED) { - int saved_errno = errno; + saved_errno = errno; _close(fd); SAVEFAIL(name, lang, saved_errno); NLRETERR(saved_errno); --- catopen3.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-standards@FreeBSD.ORG Wed Oct 17 08:50:01 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED14D471 for ; Wed, 17 Oct 2012 08:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id D548F8FC0C for ; Wed, 17 Oct 2012 08:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9H8o17Y073674 for ; Wed, 17 Oct 2012 08:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9H8o1HI073673; Wed, 17 Oct 2012 08:50:01 GMT (envelope-from gnats) Date: Wed, 17 Oct 2012 08:50:01 GMT Message-Id: <201210170850.q9H8o1HI073673@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org Cc: From: Zhihao Yuan Subject: Re: standards/172805: Fix catopen(3)' s EINVAL usage and document EFTYPE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Zhihao Yuan List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 08:50:02 -0000 The following reply was made to PR standards/172805; it has been noted by GNATS. From: Zhihao Yuan To: bug-followup@FreeBSD.org, lichray@gmail.com Cc: Subject: Re: standards/172805: Fix catopen(3)'s EINVAL usage and document EFTYPE Date: Wed, 17 Oct 2012 03:42:41 -0500 --f46d04339c4cf73c4604cc3d4023 Content-Type: text/plain; charset=UTF-8 Further points out more EFTYPE errors. The exact explanation of EFTYPE here should be "The file designated by the named catalog is not a regular file or a symbolic link pointing to a regular file, or its data format is not POSIX NLS catalog.", which confirms with the general meaning of EFTYPE "Inappropriate file type or format. The file was the wrong type for the operation, or a data file had the wrong format.". Please help improve the wording in catopen.3 is you find that the current version is not enough. -- Zhihao Yuan, nickname lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/ --f46d04339c4cf73c4604cc3d4023 Content-Type: application/octet-stream; name="catopen3_1.patch" Content-Disposition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kJc2F2ZWRfZXJybm8gPSBFRlRZUEU7CisJCWVsc2UKKwkJCXNhdmVkX2Vy cm5vID0gZXJybm87CiAJCV9jbG9zZShmZCk7CiAJCVNBVkVGQUlMKG5hbWUsIGxhbmcsIHNhdmVk X2Vycm5vKTsKIAkJTkxSRVRFUlIoc2F2ZWRfZXJybm8pOwo= --f46d04339c4cf73c4604cc3d4023-- From owner-freebsd-standards@FreeBSD.ORG Wed Oct 17 19:08:38 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C0CD194; Wed, 17 Oct 2012 19:08:38 +0000 (UTC) (envelope-from sem@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id DB8888FC0C; Wed, 17 Oct 2012 19:08:37 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9HJ8bKB012831; Wed, 17 Oct 2012 19:08:37 GMT (envelope-from sem@freefall.freebsd.org) Received: (from sem@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9HJ8bR1012827; Wed, 17 Oct 2012 19:08:37 GMT (envelope-from sem) Date: Wed, 17 Oct 2012 19:08:37 GMT Message-Id: <201210171908.q9HJ8bR1012827@freefall.freebsd.org> To: sem@FreeBSD.org, freebsd-standards@FreeBSD.org, sem@FreeBSD.org From: sem@FreeBSD.org Subject: Re: standards/154842: invalid request authenticator in the second and subsequent acct-packets, generated by libradius X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2012 19:08:38 -0000 Synopsis: invalid request authenticator in the second and subsequent acct-packets, generated by libradius Responsible-Changed-From-To: freebsd-standards->sem Responsible-Changed-By: sem Responsible-Changed-When: Wed Oct 17 19:08:37 UTC 2012 Responsible-Changed-Why: Take it to check and fix in my current work on libradius http://www.freebsd.org/cgi/query-pr.cgi?pr=154842