From owner-freebsd-standards@FreeBSD.ORG Mon Sep 10 11:10:13 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 9062110656EC for ; Mon, 10 Sep 2012 11:10:13 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5FE118FC0A for ; Mon, 10 Sep 2012 11:10:13 +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 q8ABADJX072459 for ; Mon, 10 Sep 2012 11:10:13 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8ABABV0072099 for freebsd-standards@FreeBSD.org; Mon, 10 Sep 2012 11:10:11 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 10 Sep 2012 11:10:11 GMT Message-Id: <201209101110.q8ABABV0072099@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 Cc: Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2012 11:10:13 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o stand/170403 standards wrong ntohs expression type tickling clang o stand/170346 standards Changes to support waitid() and related stuff o stand/169697 standards syslogd(8) is not BOM aware o stand/166349 standards Support the assignment-allocation character for fscanf o stand/164787 standards dirfd() function not available when _POSIX_C_SOURCE is o kern/164674 standards [patch] [libc] vfprintf/vfwprintf return error (EOF) o o stand/162434 standards getaddrinfo: addrinfo.ai_family is an address family, o stand/154842 standards invalid request authenticator in the second and subseq o stand/150093 standards C++ std::locale support is broken o stand/130067 standards Wrong numeric limits in system headers? o stand/124860 standards flockfile(3) doesn't work when the memory has been exh o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/116477 standards rm(1): rm behaves unexpectedly when using -r and relat o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116081 standards make does not work with the directive sinclude p stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) a stand/86484 standards [patch] mkfifo(1) uses wrong permissions o stand/82654 standards C99 long double math functions are missing o stand/81287 standards [patch] fingerd(8) might send a line not ending in CRL a stand/80293 standards sysconf() does not support well-defined unistd values o stand/79056 standards [feature request] [atch] regex(3) regression tests o stand/70813 standards [patch] ls(1) not Posix compliant o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/56476 standards [patch] cd9660 unicode support simple hack o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/44365 standards [headers] [patch] [request] introduce ulong and unchar a stand/41576 standards ln(1): replacing old dir-symlinks a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h s stand/24590 standards timezone function not compatible witn Single Unix Spec o stand/21519 standards sys/dir.h should be deprecated some more s bin/14925 standards getsubopt isn't poisonous enough 34 problems total. From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 13:30:02 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 856FA1065674 for ; Wed, 12 Sep 2012 13:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3CCF68FC19 for ; Wed, 12 Sep 2012 13:30:02 +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 q8CDU2wg029578 for ; Wed, 12 Sep 2012 13:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CDU2Zw029565; Wed, 12 Sep 2012 13:30:02 GMT (envelope-from gnats) Resent-Date: Wed, 12 Sep 2012 13:30:02 GMT Resent-Message-Id: <201209121330.q8CDU2Zw029565@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, Ed Maste Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE93D106564A for ; Wed, 12 Sep 2012 13:23:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A94C18FC14 for ; Wed, 12 Sep 2012 13:23:29 +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 q8CDNTWB085390 for ; Wed, 12 Sep 2012 13:23:29 GMT (envelope-from emaste@freefall.freebsd.org) Received: (from emaste@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CDNTWt085384; Wed, 12 Sep 2012 13:23:29 GMT (envelope-from emaste) Message-Id: <201209121323.q8CDNTWt085384@freefall.freebsd.org> Date: Wed, 12 Sep 2012 13:23:29 GMT From: Ed Maste To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: standards/171572: ptsname(-1) returns errno 0 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Maste List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 13:30:02 -0000 >Number: 171572 >Category: standards >Synopsis: ptsname(-1) returns errno 0 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 12 13:30:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Ed Maste >Release: FreeBSD 9.0-STABLE i386 >Organization: FreeBSD >Environment: System: FreeBSD freefall.freebsd.org 9.0-STABLE FreeBSD 9.0-STABLE #6 r235139: Tue May 8 21:19:03 UTC 2012 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386 >Description: ptsname(fildes) is documented to set errno to EBADF if fildes is not a valid open file descriptor, but ptsname(-1) returns errno = 0. >How-To-Repeat: ==[test-ptsname.c]== #include #include #include int main(int argc, char *argv[]) { char *name; errno = 0; name = ptsname(-1); printf("ptsname(-1) returns %p (%s), errno is %d\n", name, name ? name : "", errno); } ==== [emaste@freefall ~]$ ./test-ptsname ptsname(-1) returns 0x0 (), errno is 0 >Fix: >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 13:50:07 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 E3341106566B for ; Wed, 12 Sep 2012 13:50:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AF9BD8FC0A for ; Wed, 12 Sep 2012 13:50:07 +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 q8CDo77B032813 for ; Wed, 12 Sep 2012 13:50:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CDo7a5032799; Wed, 12 Sep 2012 13:50:07 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 13:50:07 GMT Message-Id: <201209121350.q8CDo7a5032799@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Sergey Kandaurov Cc: Subject: Re: standards/171572: ptsname(-1) returns errno 0 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sergey Kandaurov List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 13:50:08 -0000 The following reply was made to PR standards/171572; it has been noted by GNATS. From: Sergey Kandaurov To: bug-followup@FreeBSD.org, emaste@FreeBSD.org Cc: Subject: Re: standards/171572: ptsname(-1) returns errno 0 Date: Wed, 12 Sep 2012 17:40:22 +0400 This is regression (or was it an intended change?) from 8.x's MPSAFE TTY: in 8.x ptsname() was changed so that: /* Make sure ptsname() does not overwrite errno. */ From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 14:00:13 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B679106566C for ; Wed, 12 Sep 2012 14:00:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF5B8FC0A for ; Wed, 12 Sep 2012 14:00:13 +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 q8CE0CWi039110 for ; Wed, 12 Sep 2012 14:00:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CE0CKJ039092; Wed, 12 Sep 2012 14:00:12 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 14:00:12 GMT Message-Id: <201209121400.q8CE0CKJ039092@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Ed Maste Cc: Subject: Re: standards/171572: ptsname(-1) returns errno 0 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Maste List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 14:00:13 -0000 The following reply was made to PR standards/171572; it has been noted by GNATS. From: Ed Maste To: Sergey Kandaurov Cc: bug-followup@freebsd.org Subject: Re: standards/171572: ptsname(-1) returns errno 0 Date: Wed, 12 Sep 2012 09:53:45 -0400 On 12 September 2012 09:40, Sergey Kandaurov wrote: > This is regression (or was it an intended change?) from 8.x's MPSAFE TTY: > > in 8.x ptsname() was changed so that: > /* Make sure ptsname() does not overwrite errno. */ It looks like it was intentional, probably based on: http://pubs.opengroup.org/onlinepubs/007904975/functions/ptsname.html: ERRORS No errors are defined I guess this was interpreted as "shall not set errno." However - http://austingroupbugs.net/view.php?id=503: At line 54750, after "shall return a null pointer", add ", and may set errno". At line 54754, replace "No errors are defined." with: The ptsname( ) function may fail if: [EBADF] The fildes argument is not a valid file descriptor. [ENOTTY] The file associated with the fildes argument is not a master pseudo-terminal device.. There's some further discussion on ENOTTY vs EINVAL there. It looks like we should at least set errno though: Index: stdlib/ptsname.c =================================================================== --- stdlib/ptsname.c (revision 240164) +++ stdlib/ptsname.c (working copy) @@ -77,7 +77,6 @@ { static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; char *ret = NULL; - int sverrno = errno; /* Make sure fildes points to a master device. */ if (__isptmaster(fildes) != 0) @@ -87,7 +86,6 @@ sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL) ret = pt_slave; -done: /* Make sure ptsname() does not overwrite errno. */ - errno = sverrno; +done: return (ret); } From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 14:10:07 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8AFB106566B for ; Wed, 12 Sep 2012 14:10:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 93A748FC12 for ; Wed, 12 Sep 2012 14:10:07 +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 q8CEA767007701 for ; Wed, 12 Sep 2012 14:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CEA7Pw007687; Wed, 12 Sep 2012 14:10:07 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 14:10:07 GMT Message-Id: <201209121410.q8CEA7Pw007687@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Sergey Kandaurov Cc: Subject: Re: standards/171572: ptsname(-1) returns errno 0 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sergey Kandaurov List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 14:10:07 -0000 The following reply was made to PR standards/171572; it has been noted by GNATS. From: Sergey Kandaurov To: Ed Maste Cc: bug-followup@freebsd.org Subject: Re: standards/171572: ptsname(-1) returns errno 0 Date: Wed, 12 Sep 2012 18:07:16 +0400 On 12 September 2012 17:53, Ed Maste wrote: > On 12 September 2012 09:40, Sergey Kandaurov wrote: >> This is regression (or was it an intended change?) from 8.x's MPSAFE TTY: >> >> in 8.x ptsname() was changed so that: >> /* Make sure ptsname() does not overwrite errno. */ > > It looks like it was intentional, probably based on: > > http://pubs.opengroup.org/onlinepubs/007904975/functions/ptsname.html: > > ERRORS > > No errors are defined > > I guess this was interpreted as "shall not set errno." > > However - http://austingroupbugs.net/view.php?id=503: > > At line 54750, after "shall return a null pointer", add ", and may set errno". > > At line 54754, replace "No errors are defined." with: > > The ptsname( ) function may fail if: > [EBADF] The fildes argument is not a valid file descriptor. > [ENOTTY] The file associated with the fildes argument is not a master > pseudo-terminal device.. > > There's some further discussion on ENOTTY vs EINVAL there. It looks > like we should at least set errno though: Oh, well in 7.x before MPSAFE TTY ptsname() used to return: [EINVAL] fildes is not a master pseudo-terminal device. and the errors specified for the fstat(2) system call. Probably the only we should change is to turn EINVAL into ENOTTY for !master pt (change __isptmaster()) and return errors from fstat() as is if any. -- wbr, pluknet From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 16:00:12 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 74D601065673 for ; Wed, 12 Sep 2012 16:00:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3C0FC8FC0C for ; Wed, 12 Sep 2012 16:00:09 +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 q8CG09SE050827 for ; Wed, 12 Sep 2012 16:00:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CG09Zl050812; Wed, 12 Sep 2012 16:00:09 GMT (envelope-from gnats) Resent-Date: Wed, 12 Sep 2012 16:00:09 GMT Resent-Message-Id: <201209121600.q8CG09Zl050812@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, Ed Maste Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44D4F1065675 for ; Wed, 12 Sep 2012 15:54:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 275988FC1D for ; Wed, 12 Sep 2012 15:54:43 +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 q8CFshgv030403 for ; Wed, 12 Sep 2012 15:54:43 GMT (envelope-from emaste@freefall.freebsd.org) Received: (from emaste@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CFsgL4030388; Wed, 12 Sep 2012 15:54:43 GMT (envelope-from emaste) Message-Id: <201209121554.q8CFsgL4030388@freefall.freebsd.org> Date: Wed, 12 Sep 2012 15:54:43 GMT From: Ed Maste To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Maste List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 16:00:12 -0000 >Number: 171577 >Category: standards >Synopsis: realpath(3) returns ENOTDIR instead of ENOENT >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 12 16:00:08 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Ed Maste >Release: FreeBSD 9.1-PRERELEASE amd64 >Organization: FreeBSD >Environment: FreeBSD feynman 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #1 r240164M: Thu Sep 6 10:40:42 EDT 2012 emaste@feynman:/data2/emaste/obj/home/emaste/src/9/sys/TEST amd64 >Description: When passed a path with a component that does not exist realpath() sets errno to ENOTDIR instead of ENOENT. See kern/128933 for the change that introduced this behaviour. I believe it is incorrect. ENOTDIR is 20 ENOTDIR Not a directory. A component of the specified pathname existed, but it was not a directory, when a directory was expected. >How-To-Repeat: feynman% realpath /does-not-exist/foo realpath: /does-not-exist/foo: Not a directory >Fix: Index: realpath.c =================================================================== --- realpath.c (revision 240400) +++ realpath.c (working copy) @@ -181,8 +181,6 @@ return (NULL); } if (lstat(resolved, &sb) != 0) { - if (errno != ENOENT || p != NULL) - errno = ENOTDIR; if (m) free(resolved); return (NULL); >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 17:00:14 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E0FC106566B for ; Wed, 12 Sep 2012 17:00:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F3D988FC18 for ; Wed, 12 Sep 2012 17:00:13 +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 q8CH0Dhx038858 for ; Wed, 12 Sep 2012 17:00:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CH0DFn038845; Wed, 12 Sep 2012 17:00:13 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 17:00:13 GMT Message-Id: <201209121700.q8CH0DFn038845@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Andrey Chernov Cc: Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andrey Chernov List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 17:00:14 -0000 The following reply was made to PR standards/171577; it has been noted by GNATS. From: Andrey Chernov To: Ed Maste Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT Date: Wed, 12 Sep 2012 20:56:07 +0400 On Wed, Sep 12, 2012 at 03:54:43PM +0000, Ed Maste wrote: > When passed a path with a component that does not exist realpath() sets > errno to ENOTDIR instead of ENOENT. See kern/128933 for the change that > introduced this behaviour. I believe it is incorrect. > > ENOTDIR is > > 20 ENOTDIR Not a directory. A component of the specified pathname > existed, but it was not a directory, when a directory was > expected. > > >How-To-Repeat: > > feynman% realpath /does-not-exist/foo > realpath: /does-not-exist/foo: Not a directory It works as designed. See POSIX realpath ERRORS section http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html [ENOENT] A component of file_name does not name an existing file or file_name points to an empty string. [ENOTDIR] A component of the path prefix is not a directory, or the file_name argument contains at least one non- character and ends with one or more trailing characters and the last pathname component names an existing file that is neither a directory nor a symbolic link to a directory. -- http://ache.vniz.net/ From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 17:08:17 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 0DF671065673 for ; Wed, 12 Sep 2012 17:08:17 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id CE7028FC19 for ; Wed, 12 Sep 2012 17:08:16 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so2833755pbb.13 for ; Wed, 12 Sep 2012 10:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Yu7hFKAues6tri96eH3MfhcHgE+yjmwrIM7BGLItAz4=; b=rNmg4NNliz41vKdQrn2t3sfq32g+FEB9pqXSAQjiFi75UgI3tErPihCGsY5kXy28+Z 64ZJO1m1Ooo2m70yeviH788Zl6kAHM8u+pvIZ6nQfGQ36U5vTJJqelN/V5q7kjzHh/jU T6u8YRYFCI80ulXKTT6FIc/VJDfnQJJX9ONn4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=Yu7hFKAues6tri96eH3MfhcHgE+yjmwrIM7BGLItAz4=; b=UUF0ZYTFPPsU0geJbKaVcPFYM5v0LfXb1aKqln52W5Dz8C0PsnBh2lgnw0LtYtERzb 7ndKN45zyh9lCI7r2icvs/r/5oYhAbSo+OvKHtQq+XK3r07wZjK9MOO1+UbaS3io11q9 ni2hdGygsSVF7LXoKZHFC8b7BWrUmmFL+U+j80MpKHPVt9sYHeLMr9QAKwbLZ9zIcG97 jXg1TFCCRrhU4NKs5k7NDflXGm0k0XRonFvvSK+b+HWx5wTX9VQqzwJuB/fth6LUCxre dzqodQydSHTXsz62he7WL9ahzcdo89G61SUs1aKTbmALbyqra6ytfz2qd0x7gbySJH5m ymIg== Received: by 10.68.213.195 with SMTP id nu3mr17433037pbc.81.1347469696120; Wed, 12 Sep 2012 10:08:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.87.41 with HTTP; Wed, 12 Sep 2012 10:07:44 -0700 (PDT) In-Reply-To: <201209121700.q8CH0DFn038845@freefall.freebsd.org> References: <201209121700.q8CH0DFn038845@freefall.freebsd.org> From: Eitan Adler Date: Wed, 12 Sep 2012 13:07:44 -0400 Message-ID: To: Andrey Chernov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkAixb0pO/omeZ4JmL9GxGCc2smPvNvZAOoivRq+1ajDw9FK/cgaqGE8cSD6PoG+2vkh6lh Cc: FreeBSD Standards , bug-followup@freebsd.org Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 17:08:17 -0000 On 12 September 2012 13:00, Andrey Chernov wrote: > The following reply was made to PR standards/171577; it has been noted by GNATS. > > From: Andrey Chernov > To: Ed Maste > Cc: FreeBSD-gnats-submit@FreeBSD.ORG > Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT > Date: Wed, 12 Sep 2012 20:56:07 +0400 > > On Wed, Sep 12, 2012 at 03:54:43PM +0000, Ed Maste wrote: > > When passed a path with a component that does not exist realpath() sets > > errno to ENOTDIR instead of ENOENT. See kern/128933 for the change that > > introduced this behaviour. I believe it is incorrect. > > > > ENOTDIR is > > > > 20 ENOTDIR Not a directory. A component of the specified pathname > > existed, but it was not a directory, when a directory was > > expected. > > > > >How-To-Repeat: > > > > feynman% realpath /does-not-exist/foo > > realpath: /does-not-exist/foo: Not a directory > > It works as designed. See POSIX realpath ERRORS section > http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html ENOTDIR implies the path exists: [ENOTDIR] Not a directory. A component of the specified pathname exists, but it is not a directory, when a directory was expected. from section 2.3: Error Numbers http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html -- Eitan Adler From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 17:10:07 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6219A106564A for ; Wed, 12 Sep 2012 17:10:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 48BF48FC0C for ; Wed, 12 Sep 2012 17:10:07 +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 q8CHA7B6087774 for ; Wed, 12 Sep 2012 17:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CHA7T3087754; Wed, 12 Sep 2012 17:10:07 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 17:10:07 GMT Message-Id: <201209121710.q8CHA7T3087754@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Eitan Adler Cc: Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eitan Adler List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 17:10:07 -0000 The following reply was made to PR standards/171577; it has been noted by GNATS. From: Eitan Adler To: Andrey Chernov Cc: FreeBSD Standards , bug-followup@freebsd.org Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT Date: Wed, 12 Sep 2012 13:07:44 -0400 On 12 September 2012 13:00, Andrey Chernov wrote: > The following reply was made to PR standards/171577; it has been noted by GNATS. > > From: Andrey Chernov > To: Ed Maste > Cc: FreeBSD-gnats-submit@FreeBSD.ORG > Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT > Date: Wed, 12 Sep 2012 20:56:07 +0400 > > On Wed, Sep 12, 2012 at 03:54:43PM +0000, Ed Maste wrote: > > When passed a path with a component that does not exist realpath() sets > > errno to ENOTDIR instead of ENOENT. See kern/128933 for the change that > > introduced this behaviour. I believe it is incorrect. > > > > ENOTDIR is > > > > 20 ENOTDIR Not a directory. A component of the specified pathname > > existed, but it was not a directory, when a directory was > > expected. > > > > >How-To-Repeat: > > > > feynman% realpath /does-not-exist/foo > > realpath: /does-not-exist/foo: Not a directory > > It works as designed. See POSIX realpath ERRORS section > http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html ENOTDIR implies the path exists: [ENOTDIR] Not a directory. A component of the specified pathname exists, but it is not a directory, when a directory was expected. from section 2.3: Error Numbers http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html -- Eitan Adler From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 17:20:10 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 AA8B2106566B for ; Wed, 12 Sep 2012 17:20:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 95C448FC08 for ; Wed, 12 Sep 2012 17:20:10 +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 q8CHKArr068333 for ; Wed, 12 Sep 2012 17:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CHKAHi068320; Wed, 12 Sep 2012 17:20:10 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 17:20:10 GMT Message-Id: <201209121720.q8CHKAHi068320@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Ed Maste Cc: Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Maste List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 17:20:10 -0000 The following reply was made to PR standards/171577; it has been noted by GNATS. From: Ed Maste To: Andrey Chernov , Ed Maste , FreeBSD-gnats-submit@freebsd.org Cc: Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT Date: Wed, 12 Sep 2012 13:14:50 -0400 On 12 September 2012 12:56, Andrey Chernov wrote: > It works as designed. See POSIX realpath ERRORS section > http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html > > [ENOENT] > A component of file_name does not name an existing file or file_name > points to an empty string. > [ENOTDIR] > A component of the path prefix is not a directory, or the file_name > argument contains at least one non- character and ends with one or > more trailing characters and the last pathname component names an > existing file that is neither a directory nor a symbolic link to a > directory. Hi Andrey, sorry I did not see your comment before I committed the change (or I would have held off to discuss first). I find the wording in the POSIX realpath errors section confusing, but believe it is clear from the description of ENOTDIR in section 2.3 and the general use of ENOENT and ENOTDIR that ENOENT must be used for this case. This is also the behaviour of Solaris and glibc. I am going to try to get the realpath text clarified. -Ed From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 17:20:16 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A77AD106566B for ; Wed, 12 Sep 2012 17:20:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 881FB8FC0A for ; Wed, 12 Sep 2012 17:20:15 +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 q8CHKFwd069134 for ; Wed, 12 Sep 2012 17:20:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CHKFln069120; Wed, 12 Sep 2012 17:20:15 GMT (envelope-from gnats) Date: Wed, 12 Sep 2012 17:20:15 GMT Message-Id: <201209121720.q8CHKFln069120@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Eric Blake Cc: Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eric Blake List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 17:20:16 -0000 The following reply was made to PR standards/171577; it has been noted by GNATS. From: Eric Blake To: bug-followup@FreeBSD.org, emaste@FreeBSD.org, Andrey Chernov Cc: Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT Date: Wed, 12 Sep 2012 11:15:53 -0600 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig27BF737EE4D47602967C34CC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable >> ENOTDIR is >>=20 >> 20 ENOTDIR Not a directory. A component of the specified pathnam= e >> existed, but it was not a directory, when a directory was= >> expected. >>=20 >> >How-To-Repeat: >>=20 >> feynman% realpath /does-not-exist/foo >> realpath: /does-not-exist/foo: Not a directory >=20 > It works as designed. See POSIX realpath ERRORS section > http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html= >=20 > [ENOENT] > A component of file_name does not name an existing file or file_name > points to an empty string. > [ENOTDIR] > A component of the path prefix is not a directory, or the file_name > argument contains at least one non- character and ends with one= or > more trailing characters and the last pathname component names = an > existing file that is neither a directory nor a symbolic link to a > directory. Andrey, you are arguing that since /does-not-exist is missing, it is not a directory; but the POSIX wording for ENOENT vs. ENOTDIR is quite clear:= http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#= tag_15_03 [ENOENT] No such file or directory. A component of a specified pathname does not exist, or the pathname is an empty string. [ENOTDIR] Not a directory. A component of the specified pathname exists, but it is not a directory, when a directory was expected. In this particular case of /does-not-exist/foo, '/does-not-exist' is a path component that does not exist (ENOENT applies), but is NOT a case of a component that exists but is not a directory where a directory was expected (ENOTDIR does not apply). Ed's patch looks correct to me. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig27BF737EE4D47602967C34CC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQUMNKAAoJEKeha0olJ0Nq7F4H/izH/A28gWyNeaeV9l0+ICrJ W3LzwsTF6ebf5vckyargt/4Vgf1p0/vGyWfSaQVXHTGJ2k7UD7Kqrd+lwvgATYCh T6yfevqC/igAfYPGEmIuvW5WlzxMvp/4CAkohi/b668mwEsNANXOaoloxzE57gHJ bGJJPhpULyEjIXCJacYIbW8AWpKU8InBZwbXQvNyEQ25we86DbsAa5cJ5rsKs6NY jHCpK8vI4ggkPXyrk0JhN0s4hP48KcC9LiuHQJ3n2lCliQApghozvjBAJqZIt0rp KksgkPS4ZAZXLoA7vxj37+dsL9VV+A/XdUmUWjmD9d892FerW8HC1ILzaj8HnnU= =0kNd -----END PGP SIGNATURE----- --------------enig27BF737EE4D47602967C34CC-- From owner-freebsd-standards@FreeBSD.ORG Wed Sep 12 17:29:01 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D32B1065670; Wed, 12 Sep 2012 17:29:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 607CB8FC14; Wed, 12 Sep 2012 17:29: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 q8CHT12M044764; Wed, 12 Sep 2012 17:29:01 GMT (envelope-from emaste@freefall.freebsd.org) Received: (from emaste@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8CHT1x3044739; Wed, 12 Sep 2012 17:29:01 GMT (envelope-from emaste) Date: Wed, 12 Sep 2012 17:29:01 GMT Message-Id: <201209121729.q8CHT1x3044739@freefall.freebsd.org> To: emaste@freebsd.org, emaste@FreeBSD.org, freebsd-standards@FreeBSD.org, emaste@FreeBSD.org From: emaste@FreeBSD.org Cc: Subject: Re: standards/171577: realpath(3) returns ENOTDIR instead of ENOENT X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 17:29:01 -0000 Synopsis: realpath(3) returns ENOTDIR instead of ENOENT State-Changed-From-To: open->patched State-Changed-By: emaste State-Changed-When: Wed Sep 12 17:28:01 UTC 2012 State-Changed-Why: Committed as r240410 Responsible-Changed-From-To: freebsd-standards->emaste Responsible-Changed-By: emaste Responsible-Changed-When: Wed Sep 12 17:28:01 UTC 2012 Responsible-Changed-Why: Grab http://www.freebsd.org/cgi/query-pr.cgi?pr=171577 From owner-freebsd-standards@FreeBSD.ORG Thu Sep 13 01:03:48 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 607641065764; Thu, 13 Sep 2012 01:03:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 33CC38FC0A; Thu, 13 Sep 2012 01:03:48 +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 q8D13mne089537; Thu, 13 Sep 2012 01:03:48 GMT (envelope-from emaste@freefall.freebsd.org) Received: (from emaste@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8D13mOZ089521; Thu, 13 Sep 2012 01:03:48 GMT (envelope-from emaste) Date: Thu, 13 Sep 2012 01:03:48 GMT Message-Id: <201209130103.q8D13mOZ089521@freefall.freebsd.org> To: emaste@FreeBSD.org, emaste@FreeBSD.org, freebsd-standards@FreeBSD.org, emaste@FreeBSD.org From: emaste@FreeBSD.org Cc: Subject: Re: standards/171572: ptsname(-1) returns errno 0 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 01:03:48 -0000 Synopsis: ptsname(-1) returns errno 0 State-Changed-From-To: open->patched State-Changed-By: emaste State-Changed-When: Thu Sep 13 01:03:16 UTC 2012 State-Changed-Why: Committed as r240412 Responsible-Changed-From-To: freebsd-standards->emaste Responsible-Changed-By: emaste Responsible-Changed-When: Thu Sep 13 01:03:16 UTC 2012 Responsible-Changed-Why: Grab http://www.freebsd.org/cgi/query-pr.cgi?pr=171572