From owner-freebsd-standards@FreeBSD.ORG Mon Feb 16 02:10:32 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9349516A4CF for ; Mon, 16 Feb 2004 02:10:32 -0800 (PST) Received: from mailtoaster1.pipeline.ch (mailtoaster1.pipeline.ch [62.48.0.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DC3E43D39 for ; Mon, 16 Feb 2004 02:10:32 -0800 (PST) (envelope-from andre@freebsd.org) Received: (qmail 58437 invoked from network); 16 Feb 2004 10:10:30 -0000 Received: from unknown (HELO freebsd.org) ([62.48.0.47]) (envelope-sender ) by mailtoaster1.pipeline.ch (qmail-ldap-1.03) with SMTP for ; 16 Feb 2004 10:10:30 -0000 Message-ID: <40309723.5020808@freebsd.org> Date: Mon, 16 Feb 2004 11:10:43 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7a) Gecko/20040125 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org, freebsd-standards@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: writev(2) and IOV_MAX confusion X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2004 10:10:32 -0000 The is a big confusion over the correct definition of IOV_MAX in relation to writev(2). The man page for write(2)/writev(2) says you only have to include to get everything. Unfortunatly IOV_MAX is not (no longer?) defined there but in . Both Net- and OpenBSD still define it in but NetBSD only for compatibility. For them the correct place seems to be too but only when _XOPEN_SOURCE is defined. What is the correct place for IOV_MAX? And what has to be adjusted, the man page or the .h files? -- Andre From owner-freebsd-standards@FreeBSD.ORG Mon Feb 16 02:32:56 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13A0916A4CE; Mon, 16 Feb 2004 02:32:56 -0800 (PST) Received: from VARK.homeunix.com (adsl-68-122-2-18.dsl.pltn13.pacbell.net [68.122.2.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id E6D7743D1F; Mon, 16 Feb 2004 02:32:55 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i1GAWsHp007852; Mon, 16 Feb 2004 02:32:54 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i1GAWsv0007851; Mon, 16 Feb 2004 02:32:54 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Mon, 16 Feb 2004 02:32:54 -0800 From: David Schultz To: Andre Oppermann Message-ID: <20040216103254.GA7779@VARK.homeunix.com> Mail-Followup-To: Andre Oppermann , freebsd-current@FreeBSD.ORG, freebsd-standards@FreeBSD.ORG References: <40309723.5020808@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40309723.5020808@freebsd.org> cc: freebsd-current@FreeBSD.ORG cc: freebsd-standards@FreeBSD.ORG Subject: Re: writev(2) and IOV_MAX confusion X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2004 10:32:56 -0000 On Mon, Feb 16, 2004, Andre Oppermann wrote: > The is a big confusion over the correct definition of IOV_MAX in relation > to writev(2). The man page for write(2)/writev(2) says you only have to > include to get everything. Unfortunatly IOV_MAX is not (no > longer?) defined there but in . Both Net- and OpenBSD > still define it in but NetBSD only for compatibility. For > them the correct place seems to be too but only when > _XOPEN_SOURCE is defined. > > What is the correct place for IOV_MAX? And what has to be adjusted, the > man page or the .h files? In POSIX, you get IOV_MAX only by including , and FreeBSD's includes , so the code is correct here. As far as I can tell, the man page doesn't say anything about what you have to include to get IOV_MAX, but I suppose it could be more clear. From owner-freebsd-standards@FreeBSD.ORG Mon Feb 16 07:40:05 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 463EB16A4D0 for ; Mon, 16 Feb 2004 07:40:05 -0800 (PST) Received: from mailtoaster1.pipeline.ch (mailtoaster1.pipeline.ch [62.48.0.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8836643D2F for ; Mon, 16 Feb 2004 07:40:04 -0800 (PST) (envelope-from andre@freebsd.org) Received: (qmail 82567 invoked from network); 16 Feb 2004 15:40:03 -0000 Received: from unknown (HELO freebsd.org) ([62.48.0.53]) (envelope-sender ) by mailtoaster1.pipeline.ch (qmail-ldap-1.03) with SMTP for ; 16 Feb 2004 15:40:03 -0000 Message-ID: <4030E452.FFD6A59E@freebsd.org> Date: Mon, 16 Feb 2004 16:40:02 +0100 From: Andre Oppermann X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: David Schultz References: <40309723.5020808@freebsd.org> <20040216103254.GA7779@VARK.homeunix.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-current@FreeBSD.ORG cc: freebsd-standards@FreeBSD.ORG Subject: Re: writev(2) and IOV_MAX confusion X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2004 15:40:05 -0000 David Schultz wrote: > > On Mon, Feb 16, 2004, Andre Oppermann wrote: > > The is a big confusion over the correct definition of IOV_MAX in relation > > to writev(2). The man page for write(2)/writev(2) says you only have to > > include to get everything. Unfortunatly IOV_MAX is not (no > > longer?) defined there but in . Both Net- and OpenBSD > > still define it in but NetBSD only for compatibility. For > > them the correct place seems to be too but only when > > _XOPEN_SOURCE is defined. > > > > What is the correct place for IOV_MAX? And what has to be adjusted, the > > man page or the .h files? > > In POSIX, you get IOV_MAX only by including , and > FreeBSD's includes , so the code is > correct here. As far as I can tell, the man page doesn't say > anything about what you have to include to get IOV_MAX, but I > suppose it could be more clear. Yes, the write(2) man page is missing any reference to . I'd say the man page should mention that. -- Andre From owner-freebsd-standards@FreeBSD.ORG Mon Feb 16 08:29:46 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37B2F16A4D3; Mon, 16 Feb 2004 08:29:46 -0800 (PST) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDA1743D1F; Mon, 16 Feb 2004 08:29:45 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (sccrmhc13) with ESMTP id <20040216162944016005dehae>; Mon, 16 Feb 2004 16:29:44 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i1GGU2hd059422; Mon, 16 Feb 2004 11:30:02 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i1GGU2wB059421; Mon, 16 Feb 2004 11:30:02 -0500 (EST) (envelope-from rodrigc) Date: Mon, 16 Feb 2004 11:30:02 -0500 From: Craig Rodrigues To: Andre Oppermann Message-ID: <20040216163002.GA56357@crodrigues.org> References: <40309723.5020808@freebsd.org> <20040216103254.GA7779@VARK.homeunix.com> <4030E452.FFD6A59E@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4030E452.FFD6A59E@freebsd.org> User-Agent: Mutt/1.4.1i cc: David Schultz cc: freebsd-current@freebsd.org cc: freebsd-standards@freebsd.org Subject: Re: writev(2) and IOV_MAX confusion X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2004 16:29:46 -0000 On Mon, Feb 16, 2004 at 04:40:02PM +0100, Andre Oppermann wrote: > Yes, the write(2) man page is missing any reference to . > I'd say the man page should mention that. This is a reasonable thing to do. In the Single Unix Specification, v.3, the man page for writev() has this text: Traditionally, the maximum number of scatter/gather elements the system can process in one call were described by the symbolic value {UIO_MAXIOV}. In IEEE Std 1003.1-2001 this value is replaced by the constant {IOV_MAX} which can be found in . -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-standards@FreeBSD.ORG Mon Feb 16 11:01:46 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B55AE16A4CE for ; Mon, 16 Feb 2004 11:01:46 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99DAB43D1D for ; Mon, 16 Feb 2004 11:01:46 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) i1GJ1kbv034270 for ; Mon, 16 Feb 2004 11:01:46 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1GJ1jwb034264 for freebsd-standards@freebsd.org; Mon, 16 Feb 2004 11:01:45 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 16 Feb 2004 11:01:45 -0800 (PST) Message-Id: <200402161901.i1GJ1jwb034264@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2004 19:01:46 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- s [2001/01/23] misc/24590 standards timezone function not compatible witn Sin o [2002/02/25] bin/35307 standards standard include files are not standard c o [2003/03/05] bin/48958 standards The type 'bool' has different sizes for C o [2003/04/21] standards/51209standards [PATCH] add a64l()/l64a/l64a_r functions p [2003/06/05] standards/52972standards /bin/sh arithmetic not POSIX compliant o [2003/06/20] standards/53554standards interval timers not cleared in fork() o [2003/07/12] standards/54410standards one-true-awk not POSIX compliant (no exte o [2003/09/15] standards/56906standards Several math(3) functions fail to set err o [2003/12/31] standards/60772standards _Bool and bool should be unsigned o [2004/02/05] standards/62388standards sys/resource.h does not pull in dependenc 10 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/01/16] bin/24390 standards Replacing old dir-symlinks when using /bi o [2001/11/20] standards/32126standards getopt(3) not Unix-98 conformant s [2002/03/18] standards/36076standards Implementation of POSIX fuser command o [2002/06/13] standards/39256standards [v]snprintf aren't POSIX-conformant for s o [2002/07/09] misc/40378 standards stdlib.h gives needless warnings with -an p [2002/08/12] standards/41576standards POSIX compliance of ln(1) o [2002/10/23] standards/44425standards getcwd() succeeds even if current dir has o [2002/12/09] standards/46119standards Priority problems for SCHED_OTHER using p o [2002/12/23] standards/46504standards Warnings in headers o [2003/06/22] standards/53613standards FreeBSD doesn't define EPROTO o [2003/06/24] bin/53682 standards [PATCH] add fuser(1) utitity o [2003/07/24] standards/54809standards pcvt deficits o [2003/07/24] standards/54833standards more pcvt deficits o [2003/07/25] standards/54839standards pcvt deficits o [2003/07/31] standards/55112standards glob.h, glob_t's gl_pathc should be "size o [2003/09/04] standards/56476standards cd9660 unicode support simple hack o [2003/09/27] standards/57295standards [patch] make does not include cmd line va o [2003/10/12] standards/57911standards fnmatch ("[[:alpha:]]","x", FNM_PATHNAME) o [2003/10/29] standards/58676standards grantpt(3) alters storage used by ptsname o [2003/11/29] standards/59797standards Implement C99's round[f]() math fucntions p [2003/12/26] standards/60597standards FreeBSD's /usr/include lacks of cpio.h o [2004/01/26] standards/61934standards [PATCH] FreeBSD's mailx not completely SU o [2004/02/14] standards/62858standards malloc(0) not C99 compliant 23 problems total. From owner-freebsd-standards@FreeBSD.ORG Mon Feb 16 11:03:33 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F091B16A4CE for ; Mon, 16 Feb 2004 11:03:33 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED1E843D1D for ; Mon, 16 Feb 2004 11:03:33 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.10/8.12.10) with ESMTP id i1GJ3Xbv036229 for ; Mon, 16 Feb 2004 11:03:33 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1GJ3X0U036223 for standards@freebsd.org; Mon, 16 Feb 2004 11:03:33 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 16 Feb 2004 11:03:33 -0800 (PST) Message-Id: <200402161903.i1GJ3X0U036223@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: standards@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2004 19:03:34 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/03/05] bin/25542 standards /bin/sh: null char in quoted string 1 problem total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- f [1995/01/11] i386/105 standards Distributed libm (msun) has non-standard o [2000/09/24] bin/21519 standards sys/dir.h should be deprecated some more o [2000/12/05] kern/23304 standards POSIX clock_gettime, clock_getres return s [2001/06/18] kern/28260 standards UIO_MAXIOV needs to be made public 4 problems total. From owner-freebsd-standards@FreeBSD.ORG Mon Feb 16 11:35:25 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 298DD16A4CE; Mon, 16 Feb 2004 11:35:25 -0800 (PST) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF15A43D1F; Mon, 16 Feb 2004 11:35:24 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost.nic.fr [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id i1GJZNDa046413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK CN=khavrinen.lcs.mit.edu issuer=SSL+20Client+20CA); Mon, 16 Feb 2004 14:35:23 -0500 (EST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.9/8.12.9/Submit) id i1GJZNfh046410; Mon, 16 Feb 2004 14:35:23 -0500 (EST) (envelope-from wollman) Date: Mon, 16 Feb 2004 14:35:23 -0500 (EST) From: Garrett Wollman Message-Id: <200402161935.i1GJZNfh046410@khavrinen.lcs.mit.edu> To: David Schultz In-Reply-To: <20040216103254.GA7779@VARK.homeunix.com> References: <40309723.5020808@freebsd.org> <20040216103254.GA7779@VARK.homeunix.com> X-Spam-Score: -19.8 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES X-Scanned-By: MIMEDefang 2.37 cc: freebsd-standards@FreeBSD.ORG Subject: Re: writev(2) and IOV_MAX confusion X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2004 19:35:25 -0000 < said: > In POSIX, you get IOV_MAX only by including , and > FreeBSD's includes , so the code is > correct here. As far as I can tell, the man page doesn't say > anything about what you have to include to get IOV_MAX, but I > suppose it could be more clear. I have long advocated for support in -mdoc for POSIX's distinctive {CONFIG_VAR} typograhpy to make it clear(er) what these variables are (and incidentally not imply that they will always be defined). -GAWollman From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:45:33 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60FDB16A4CE; Tue, 17 Feb 2004 07:45:33 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40FBB43D1D; Tue, 17 Feb 2004 07:45:33 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFjXbv005182; Tue, 17 Feb 2004 07:45:33 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFjXdY005178; Tue, 17 Feb 2004 07:45:33 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:45:33 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171545.i1HFjXdY005178@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: bin/25542: /bin/sh: null char in quoted string X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:45:33 -0000 X-List-Received-Date: Tue, 17 Feb 2004 15:45:33 -0000 Synopsis: /bin/sh: null char in quoted string Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:45:16 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=25542 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:45:33 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60FDB16A4CE; Tue, 17 Feb 2004 07:45:33 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40FBB43D1D; Tue, 17 Feb 2004 07:45:33 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFjXbv005182; Tue, 17 Feb 2004 07:45:33 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFjXdY005178; Tue, 17 Feb 2004 07:45:33 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:45:33 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171545.i1HFjXdY005178@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: bin/25542: /bin/sh: null char in quoted string X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:45:33 -0000 Synopsis: /bin/sh: null char in quoted string Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:45:16 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=25542 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:45:54 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1392816A4CE; Tue, 17 Feb 2004 07:45:53 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9E7443D31; Tue, 17 Feb 2004 07:45:53 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFjrbv005238; Tue, 17 Feb 2004 07:45:53 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFjrWM005234; Tue, 17 Feb 2004 07:45:53 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:45:53 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171545.i1HFjrWM005234@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: i386/105: Distributed libm (msun) has non-standard error handling. X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:45:54 -0000 Synopsis: Distributed libm (msun) has non-standard error handling. Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:45:40 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=105 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:45:54 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1392816A4CE; Tue, 17 Feb 2004 07:45:53 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9E7443D31; Tue, 17 Feb 2004 07:45:53 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFjrbv005238; Tue, 17 Feb 2004 07:45:53 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFjrWM005234; Tue, 17 Feb 2004 07:45:53 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:45:53 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171545.i1HFjrWM005234@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: i386/105: Distributed libm (msun) has non-standard error handling. X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:45:54 -0000 Synopsis: Distributed libm (msun) has non-standard error handling. Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:45:40 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=105 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:46:10 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E7DC016A4CF; Tue, 17 Feb 2004 07:46:10 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC27243D1D; Tue, 17 Feb 2004 07:46:10 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFkAbv005283; Tue, 17 Feb 2004 07:46:10 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFkAQo005279; Tue, 17 Feb 2004 07:46:10 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:46:10 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171546.i1HFkAQo005279@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: bin/21519: sys/dir.h should be deprecated some more X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:46:11 -0000 X-List-Received-Date: Tue, 17 Feb 2004 15:46:11 -0000 Synopsis: sys/dir.h should be deprecated some more Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:46:02 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=21519 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:46:10 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E7DC016A4CF; Tue, 17 Feb 2004 07:46:10 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC27243D1D; Tue, 17 Feb 2004 07:46:10 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFkAbv005283; Tue, 17 Feb 2004 07:46:10 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFkAQo005279; Tue, 17 Feb 2004 07:46:10 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:46:10 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171546.i1HFkAQo005279@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: bin/21519: sys/dir.h should be deprecated some more X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:46:11 -0000 Synopsis: sys/dir.h should be deprecated some more Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:46:02 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=21519 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:46:25 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EECB16A4CE; Tue, 17 Feb 2004 07:46:25 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62E9943D1F; Tue, 17 Feb 2004 07:46:25 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFkPbv005338; Tue, 17 Feb 2004 07:46:25 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFkPpX005334; Tue, 17 Feb 2004 07:46:25 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:46:25 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171546.i1HFkPpX005334@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: kern/23304: POSIX clock_gettime, clock_getres return errno invalid argument for CLOCK_PROF and CLOCK_VIRTUAL X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:46:25 -0000 Synopsis: POSIX clock_gettime, clock_getres return errno invalid argument for CLOCK_PROF and CLOCK_VIRTUAL Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:46:15 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=23304 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:46:25 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EECB16A4CE; Tue, 17 Feb 2004 07:46:25 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62E9943D1F; Tue, 17 Feb 2004 07:46:25 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFkPbv005338; Tue, 17 Feb 2004 07:46:25 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFkPpX005334; Tue, 17 Feb 2004 07:46:25 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:46:25 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171546.i1HFkPpX005334@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: kern/23304: POSIX clock_gettime, clock_getres return errno invalid argument for CLOCK_PROF and CLOCK_VIRTUAL X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:46:25 -0000 Synopsis: POSIX clock_gettime, clock_getres return errno invalid argument for CLOCK_PROF and CLOCK_VIRTUAL Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:46:15 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=23304 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:46:42 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FF8116A4CE; Tue, 17 Feb 2004 07:46:42 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0405A43D1F; Tue, 17 Feb 2004 07:46:42 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFkfbv005394; Tue, 17 Feb 2004 07:46:41 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFkf5A005390; Tue, 17 Feb 2004 07:46:41 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:46:41 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171546.i1HFkf5A005390@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: kern/28260: UIO_MAXIOV needs to be made public X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:46:42 -0000 Synopsis: UIO_MAXIOV needs to be made public Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:46:32 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=28260 From owner-freebsd-standards@FreeBSD.ORG Tue Feb 17 07:46:42 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FF8116A4CE; Tue, 17 Feb 2004 07:46:42 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0405A43D1F; Tue, 17 Feb 2004 07:46:42 -0800 (PST) (envelope-from des@FreeBSD.org) Received: from freefall.freebsd.org (des@localhost [127.0.0.1]) i1HFkfbv005394; Tue, 17 Feb 2004 07:46:41 -0800 (PST) (envelope-from des@freefall.freebsd.org) Received: (from des@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1HFkf5A005390; Tue, 17 Feb 2004 07:46:41 -0800 (PST) (envelope-from des) Date: Tue, 17 Feb 2004 07:46:41 -0800 (PST) From: Dag-Erling Smorgrav Message-Id: <200402171546.i1HFkf5A005390@freefall.freebsd.org> To: des@FreeBSD.org, standards@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: kern/28260: UIO_MAXIOV needs to be made public X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 15:46:42 -0000 Synopsis: UIO_MAXIOV needs to be made public Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: des Responsible-Changed-When: Tue Feb 17 07:46:32 PST 2004 Responsible-Changed-Why: Misattributed PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=28260 From owner-freebsd-standards@FreeBSD.ORG Wed Feb 18 04:30:13 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B579516A4CF for ; Wed, 18 Feb 2004 04:30:13 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE13643D1D for ; Wed, 18 Feb 2004 04:30:13 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1ICUDbv059436 for ; Wed, 18 Feb 2004 04:30:13 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1ICUDCe059435; Wed, 18 Feb 2004 04:30:13 -0800 (PST) (envelope-from gnats) Date: Wed, 18 Feb 2004 04:30:13 -0800 (PST) Message-Id: <200402181230.i1ICUDCe059435@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Wartan Hachaturow Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Wartan Hachaturow List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 12:30:13 -0000 The following reply was made to PR standards/61934; it has been noted by GNATS. From: Wartan Hachaturow To: Mike Heffner Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant Date: Wed, 18 Feb 2004 15:18:56 +0300 On Mon, Feb 09, 2004 at 12:59:59AM -0500, Mike Heffner wrote: > your modified setfile() should work in those cases as well. So, can you > modify setfile to return a more descriptive error code like in your > checkmail and use it instead for the -e option? Also, the fprintf that Well, if we're agreed on not printing "No mail for .." in -e case, then there's a problem with setfile usage, which prints that for other usage cases. Of course, I can add an additional flag to arguments, but.. Isn't it clearer to use another function? There is also an option of splitting setfile() in smaller parts, but it isn't pretty applicable here -- hardly any part of it could be used in other places, than check_mail(). Your words are my command :) -- Regards, Wartan. "Be different: conform." From owner-freebsd-standards@FreeBSD.ORG Wed Feb 18 06:30:21 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 920C216A4D1 for ; Wed, 18 Feb 2004 06:30:21 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A40043D1D for ; Wed, 18 Feb 2004 06:30:21 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1IEULbv043771 for ; Wed, 18 Feb 2004 06:30:21 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1IEULHv043770; Wed, 18 Feb 2004 06:30:21 -0800 (PST) (envelope-from gnats) Date: Wed, 18 Feb 2004 06:30:21 -0800 (PST) Message-Id: <200402181430.i1IEULHv043770@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Mike Heffner Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Mike Heffner List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 14:30:21 -0000 The following reply was made to PR standards/61934; it has been noted by GNATS. From: Mike Heffner To: Wartan Hachaturow Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant Date: Wed, 18 Feb 2004 09:20:40 -0500 (EST) On 18-Feb-2004 Wartan Hachaturow wrote: | On Mon, Feb 09, 2004 at 12:59:59AM -0500, Mike Heffner wrote: | |> your modified setfile() should work in those cases as well. So, can you |> modify setfile to return a more descriptive error code like in your |> checkmail and use it instead for the -e option? Also, the fprintf that | | Well, if we're agreed on not printing "No mail for .." in -e case, then | there's | a problem with setfile usage, which prints that for other usage cases. | Of | course, I can add an additional flag to arguments, but.. Isn't it | clearer to use another function? Yes, something like this should do: if (!eOption) fprintf("No mail for..."); Duplicating the ~100 lines of code for setfile for this change and slight change to the return code is really not a good idea, IMHO. The only current uses of setfile() are: cmd3.c:560: if (setfile(*argv) < 0) extern.h:219:int setfile(char *); lex.c:65:setfile(name) main.c:250: if (setfile(ef) < 0) Therefore, changing setfile to have a tri-state return value (< 0, 0, 1) will still work in these cases that are simply testing for a failure. Mike -- Mike Heffner From owner-freebsd-standards@FreeBSD.ORG Wed Feb 18 12:00:55 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 279ED16A4E4 for ; Wed, 18 Feb 2004 12:00:55 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A43743D8C for ; Wed, 18 Feb 2004 12:00:49 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1IK0nbv008319 for ; Wed, 18 Feb 2004 12:00:49 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1IK0nX8008318; Wed, 18 Feb 2004 12:00:49 -0800 (PST) (envelope-from gnats) Date: Wed, 18 Feb 2004 12:00:49 -0800 (PST) Message-Id: <200402182000.i1IK0nX8008318@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Wartan Hachaturow Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Wartan Hachaturow List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 20:00:55 -0000 The following reply was made to PR standards/61934; it has been noted by GNATS. From: Wartan Hachaturow To: Mike Heffner Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant Date: Wed, 18 Feb 2004 22:55:37 +0300 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 18, 2004 at 09:20:40AM -0500, Mike Heffner wrote: > Therefore, changing setfile to have a tri-state return value (< 0, 0, 1) > will still work in these cases that are simply testing for a failure. Okay, here's the new patch that (hopefully :) fixes the issues you've pointed. Note also that -e works with -f, which is a SUS extension (SUS requires only to check the system mailbox) -- quite handy. Solaris does the same. -- Regards, Wartan. "Be different: conform." --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mailx.patch.2" diff -ur ./mail_HEAD.orig/extern.h ./mail_HEAD.patched/extern.h --- ./mail_HEAD.orig/extern.h Tue Jun 25 09:24:29 2002 +++ ./mail_HEAD.patched/extern.h Fri Jan 23 12:57:04 2004 @@ -73,6 +73,7 @@ char *value(const char *); char *vcopy(const char *); char *yankword(char *, char []); +char *yanklogin(char *, char []); int Fclose(FILE *); int More(int *); int Pclose(FILE *); diff -ur ./mail_HEAD.orig/glob.h ./mail_HEAD.patched/glob.h --- ./mail_HEAD.orig/glob.h Sun Mar 25 08:57:04 2001 +++ ./mail_HEAD.patched/glob.h Wed Feb 18 17:23:46 2004 @@ -51,6 +51,8 @@ int sourcing; /* Currently reading variant file */ int loading; /* Loading user definitions */ int cond; /* Current state of conditional exc. */ +int record_recip; /* -F flag set */ +int check_mode; /* -e flag set */ FILE *itf; /* Input temp file buffer */ FILE *otf; /* Output temp file buffer */ int image; /* File descriptor for image of msg */ diff -ur ./mail_HEAD.orig/lex.c ./mail_HEAD.patched/lex.c --- ./mail_HEAD.orig/lex.c Sun Jun 30 09:25:06 2002 +++ ./mail_HEAD.patched/lex.c Wed Feb 18 22:30:52 2004 @@ -60,6 +60,9 @@ * If the first character of name is %, we are considered to be * editing the file, otherwise we are reading our mail which has * signficance for mbox and so forth. + * This function is also used for -e option implementation, so + * exit codes are designed to serve that need: + * Return -1 in case of error, 0 if there's no mail, 1 if there is. */ int setfile(name) @@ -147,9 +150,17 @@ (void)Fclose(ibuf); relsesigs(); sawcom = 0; + if (check_mode) { + if (msgCount >= 1) + return (1); + else + return (0); + } + if (!edit && msgCount == 0) { nomail: - fprintf(stderr, "No mail for %s\n", who); + if (!check_mode) + fprintf(stderr, "No mail for %s\n", who); return (-1); } return (0); diff -ur ./mail_HEAD.orig/mail.1 ./mail_HEAD.patched/mail.1 --- ./mail_HEAD.orig/mail.1 Thu Jan 9 04:08:33 2003 +++ ./mail_HEAD.patched/mail.1 Wed Feb 18 22:53:45 2004 @@ -46,15 +46,23 @@ .Op Fl s Ar subject .Op Fl c Ar cc-addr .Op Fl b Ar bcc-addr +.Op Fl F .Ar to-addr ... .Op Fl Ar sendmail-option ... .Nm -.Op Fl EiInNv +.Op Fl EHiInNv +.Op Fl F .Fl f .Op Ar name .Nm -.Op Fl EiInNv +.Op Fl EHiInNv +.Op Fl F .Op Fl u Ar user +.Nm +.Fl e +.Op Fl f Ar name +.Nm +.Op Fl H .Sh INTRODUCTION The .Nm @@ -69,6 +77,13 @@ Verbose mode. The details of delivery are displayed on the user's terminal. +.It Fl e +Test for the presence of mail in the (by default, system) +mailbox. An exit status of 0 is returned if +it has mail; otherwise, an exit status +of 1 is returned. +.It Fl H +Write a header summary only. .It Fl E Do not send messages with an empty body. This is useful for piping errors from @@ -126,6 +141,15 @@ .Ic quit , .Nm writes undeleted messages back to this file. +.It Fl F +Record the message in a file named after the first +recipient. The name is the login-name portion of the +address found first on the +.Dq Li To: +line in the mail header. +Overrides the +.Va record +variable, if set. .It Fl u Is equivalent to: .Pp diff -ur ./mail_HEAD.orig/main.c ./mail_HEAD.patched/main.c --- ./mail_HEAD.orig/main.c Sun Jun 30 09:25:06 2002 +++ ./mail_HEAD.patched/main.c Wed Feb 18 22:53:34 2004 @@ -65,6 +65,7 @@ char *argv[]; { int i; + int header_sum_mode = 0; struct name *to, *cc, *bcc, *smopts; char *subject, *replyto; char *ef, *rc; @@ -93,7 +94,7 @@ bcc = NULL; smopts = NULL; subject = NULL; - while ((i = getopt(argc, argv, "EINT:b:c:dfins:u:v")) != -1) { + while ((i = getopt(argc, argv, "FEHINT:b:c:edfins:u:v")) != -1) { switch (i) { case 'T': /* @@ -123,6 +124,25 @@ case 'd': debug++; break; + case 'e': + /* + * User wants to check mail and exit. + */ + check_mode++; + break; + case 'H': + /* + * User wants a header summary only. + */ + header_sum_mode++; + break; + case 'F': + /* + * User wants to record messages to files + * named after first recipient username. + */ + record_recip++; + break; case 's': /* * Give a subject field for sending from @@ -189,11 +209,13 @@ break; case '?': fprintf(stderr, "\ -Usage: %s [-EiInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\ +Usage: %s [-EiInv] [-s subject] [-c cc-addr] [-b bcc-addr] [-F] to-addr ...\n\ %*s [- sendmail-options ...]\n\ - %s [-EiInNv] -f [name]\n\ - %s [-EiInNv] [-u user]\n",__progname, strlen(__progname), "", - __progname, __progname); + %s [-EHiInNv] [-F] -f [name]\n\ + %s [-EHiInNv] [-F] [-u user]\n\ + %s -e [-f name]\n\ + %s -H\n",__progname, strlen(__progname), "", + __progname, __progname, __progname, __progname); exit(1); } } @@ -240,6 +262,19 @@ */ exit(senderr); } + + if(check_mode) { + if (ef == NULL) + ef = "%"; + if (setfile(ef) <= 0) { + exit(1); /* Either an error has occured, or no mail */ + } else { + exit(0); + } + /* NOTREACHED */ + exit(1); + } + /* * Ok, we are reading mail. * Decide whether we are editing a mailbox or reading @@ -259,6 +294,11 @@ (void)fflush(stdout); (void)signal(SIGINT, prevint); } + + /* If we were in header summary mode, it's time to exit. */ + if (header_sum_mode) + exit(0); + commands(); (void)signal(SIGHUP, SIG_IGN); (void)signal(SIGINT, SIG_IGN); diff -ur ./mail_HEAD.orig/names.c ./mail_HEAD.patched/names.c --- ./mail_HEAD.orig/names.c Sun Jun 30 09:25:06 2002 +++ ./mail_HEAD.patched/names.c Mon Jan 26 13:51:04 2004 @@ -210,6 +210,79 @@ } /* + * Grab a single login name (liberal word) + * Throw away things between ()'s, take anything between <>, + * and look for words before metacharacters %, @, !. + */ +char * +yanklogin(ap, wbuf) + char *ap, wbuf[]; +{ + char *cp, *cp2, *cp_temp; + int n; + + cp = ap; + for (;;) { + if (*cp == '\0') + return (NULL); + if (*cp == '(') { + int nesting = 0; + + while (*cp != '\0') { + switch (*cp++) { + case '(': + nesting++; + break; + case ')': + --nesting; + break; + } + if (nesting <= 0) + break; + } + } else if (*cp == ' ' || *cp == '\t' || *cp == ',') + cp++; + else + break; + } + + /* + * Now, let's go forward till we meet the needed character, + * and step one word back. + */ + + /* First, remember current point. */ + cp_temp = cp; + n = 0; + + /* + * Note that we look ahead in a cycle. This is safe, since + * non-end of string is checked first. + */ + while(*cp != '\0' && strchr("@%!", *(cp + 1)) == NULL) + cp++; + + /* + * Now, start stepping back to the first non-word character, + * while counting the number of symbols in a word. + */ + while(cp != cp_temp && strchr(" \t,<>", *(cp - 1)) == NULL) { + n++; + cp--; + } + + /* Finally, grab the word forward. */ + cp2 = wbuf; + while(n >= 0) { + *cp2++=*cp++; + n--; + } + + *cp2 = '\0'; + return (cp); +} + +/* * For each recipient in the passed name list with a / * in the name, append the message to the end of the named file * and remove him from the recipient list. diff -ur ./mail_HEAD.orig/send.c ./mail_HEAD.patched/send.c --- ./mail_HEAD.orig/send.c Sun Jun 30 09:25:06 2002 +++ ./mail_HEAD.patched/send.c Fri Jan 23 12:56:28 2004 @@ -303,9 +303,10 @@ int printheaders; { char *cp; + char *nbuf; int pid; char **namelist; - struct name *to; + struct name *to, *nsto; FILE *mtf; /* @@ -354,6 +355,18 @@ to = elide(to); if (count(to) == 0) goto out; + if (record_recip) { + /* + * Before fixing the header, save old To:. + * We do this because elide above has sorted To: list, and + * we would like to save message in a file named by the first + * recipient the user has entered, not the one being the first + * after sorting happened. + */ + if ((nsto = malloc(sizeof(struct name))) == NULL) + err(1, "Out of memory"); + bcopy(hp->h_to, nsto, sizeof(struct name)); + } fixhead(hp, to); if ((mtf = infix(hp, mtf)) == NULL) { fprintf(stderr, ". . . message lost, sorry.\n"); @@ -369,8 +382,21 @@ printf("\n"); goto out; } - if ((cp = value("record")) != NULL) - (void)savemail(expand(cp), mtf); + if (record_recip) { + /* + * Extract first recipient username from saved To: and use it + * as a filename. + */ + if ((nbuf = malloc(strlen(detract(nsto, 0)) + 1)) == NULL) + err(1, "Out of memory"); + if ((cp = yanklogin(detract(nsto, 0), nbuf)) != NULL) + (void)savemail(expand(nbuf), mtf); + free(nbuf); + free(nsto); + } else { + if ((cp = value("record")) != NULL) + (void)savemail(expand(cp), mtf); + } /* * Fork, set up the temporary mail file as standard * input for "mail", and exec with the user list we generated --Q68bSM7Ycu6FN28Q-- From owner-freebsd-standards@FreeBSD.ORG Sat Feb 21 08:00:42 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B74016A4CF for ; Sat, 21 Feb 2004 08:00:42 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6DD9343D2D for ; Sat, 21 Feb 2004 08:00:42 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1LG0gbv010611 for ; Sat, 21 Feb 2004 08:00:42 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1LG0gos010608; Sat, 21 Feb 2004 08:00:42 -0800 (PST) (envelope-from gnats) Resent-Date: Sat, 21 Feb 2004 08:00:42 -0800 (PST) Resent-Message-Id: <200402211600.i1LG0gos010608@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, Marius Strobl Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74E1C16A4CE; Sat, 21 Feb 2004 07:57:09 -0800 (PST) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id B90E043D1F; Sat, 21 Feb 2004 07:57:08 -0800 (PST) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) id i1LFv6rN044177; Sat, 21 Feb 2004 16:57:06 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.12.10/8.12.10/Submit) id i1LFv6Ed044176; Sat, 21 Feb 2004 16:57:06 +0100 (CET) (envelope-from marius) Message-Id: <200402211557.i1LFv6Ed044176@alchemy.franken.de> Date: Sat, 21 Feb 2004 16:57:06 +0100 (CET) From: Marius Strobl To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: ru@FreeBSD.org Subject: standards/63173: Patch to add getopt_long_only(3) to libc X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Marius Strobl List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 16:00:42 -0000 >Number: 63173 >Category: standards >Synopsis: Patch to add getopt_long_only(3) to libc >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Feb 21 08:00:42 PST 2004 >Closed-Date: >Last-Modified: >Originator: Marius Strobl >Release: FreeBSD 5.2-CURRENT sparc64 >Organization: >Environment: >Description: On September 29 2002 the NetBSD implementation of getopt_long(3) was added to the FreeBSD libc. In the course of time bsd.port.mk introduced the USE_GETOPT_LONG variable and FreeBSD ports began to use the getopt_long(3) provided by the FreeBSD 5 libc instead of the GNU implementation provided by the devel/libgnugetopt port and just recently GNU parts in the FreeBSD base sources were also switched to use the getopt_long(3) in libc. However, the current situation is still not satisfactory as the FreeBSD libc doesn't also provide getopt_long_only(3), which allows long options to also start with "-" in addition to "--", therefore devel/libgnugetopt is still required for ports depending on getopt_long_only() on FreeBSD 5. Moreover, the devel/libgnugetopt port causes problems with C++ and GCC 3, breaking ports like multimedia/mjpegtools (PR 54866). Other ports like security/nmap completely disabled using existing getopt.h (either the FreeBSD system header or the one installed by devel/libgnugetopt) because of this and use their own version of getopt(3)/getopt_long(3). See also the FreeBSD ports mailing list for more than one report about breakage caused by devel/libgnugetopt. Of course the latter issues are problems of devel/libgnugetopt and it needs to be also fixed, but they show the badness of the current situation. The patch referenced below adds getopt_long_only(3) to the FreeBSD libc based on the OpenBSD implementation. Besides adding this function it also brings over some fixes and cleanups from OpenBSD. The OpenBSD implementation of getopt_long(3) and getopt_long_only(3) also sort of fits FreeBSD a bit better as it doesn't bring support for the cross-OS-compilation support of NetBSD with it. Protection against multiple definitions is also added. FreeBSD-specific changes in the patch include fixing errors introduced in revision 1.2 of FreeBSD src/lib/libc/stdlib/getopt_long.3, e.g. it should read "`W;'" instead of "`W';" in multiple instances. Other than the OpenBSD version of getopt_long.c the FreeBSD version before and after applying the patch still doesn't implement getopt(3) and therefore replace src/lib/libc/stdlib/getopt.c, i.e. it doesn't define REPLACE_GETOPT, yet. This is something that should be taken into consideration for FreeBSD 6 (regardless if the patch is applied or not). I've been running with the first version of this patch for about 3 months on i386 and sparc64 without problems. I also successfully converted some ports like security/nmap and x11/xstroke to use it. I just recently merged in revision 1.16 of OpenBSD getopt_long.c and 1.10 of getopt_long.3 and then the recent FreeBSD changes to the affected files. If this gets commited __FreeBSD_version should be bumped so bsd.port.mk can introduce something like USE_GETOPT_LONG. The consumers of getopt_long_only(3) in GNU parts of the FreeBSD base sources like binutils and gdb then also can be switched over to the libc version and their getopt*.* files removed. It would be great to have this in FreeBSD 5.3 and therefore in FreeBSD 5-STABLE. >How-To-Repeat: >Fix: ftp://ftp.zeist.de/pub/patches/src_getopt_long_only.diff >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-standards@FreeBSD.ORG Sat Feb 21 08:50:18 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4CBC16A4CE for ; Sat, 21 Feb 2004 08:50:18 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFC6943D1F for ; Sat, 21 Feb 2004 08:50:18 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1LGoIbv020011 for ; Sat, 21 Feb 2004 08:50:18 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1LGoImr020010; Sat, 21 Feb 2004 08:50:18 -0800 (PST) (envelope-from gnats) Date: Sat, 21 Feb 2004 08:50:18 -0800 (PST) Message-Id: <200402211650.i1LGoImr020010@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Wartan Hachaturow Subject: Re: standards/63173: Patch to add getopt_long_only(3) to libc X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Wartan Hachaturow List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 16:50:18 -0000 The following reply was made to PR standards/63173; it has been noted by GNATS. From: Wartan Hachaturow To: Marius Strobl Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: standards/63173: Patch to add getopt_long_only(3) to libc Date: Sat, 21 Feb 2004 19:45:16 +0300 On Sat, Feb 21, 2004 at 04:57:06PM +0100, Marius Strobl wrote: > > >Category: standards > >Synopsis: Patch to add getopt_long_only(3) to libc Hm. Not to offend in any way -- what standard exactly requires the implementation to support getopt_long_only? Shouldn't it be placed in some other category? -- Regards, Wartan. "Be different: conform." From owner-freebsd-standards@FreeBSD.ORG Sat Feb 21 09:30:25 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16FB816A4CE for ; Sat, 21 Feb 2004 09:30:25 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F31643D1D for ; Sat, 21 Feb 2004 09:30:25 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1LHUObv026980 for ; Sat, 21 Feb 2004 09:30:24 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1LHUOYW026976; Sat, 21 Feb 2004 09:30:24 -0800 (PST) (envelope-from gnats) Date: Sat, 21 Feb 2004 09:30:24 -0800 (PST) Message-Id: <200402211730.i1LHUOYW026976@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Marius Strobl Subject: Re: standards/63173: Patch to add getopt_long_only(3) to libc X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Marius Strobl List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 17:30:25 -0000 The following reply was made to PR standards/63173; it has been noted by GNATS. From: Marius Strobl To: Wartan Hachaturow Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: standards/63173: Patch to add getopt_long_only(3) to libc Date: Sat, 21 Feb 2004 18:22:54 +0100 On Sat, Feb 21, 2004 at 07:45:16PM +0300, Wartan Hachaturow wrote: > On Sat, Feb 21, 2004 at 04:57:06PM +0100, Marius Strobl wrote: > > > > >Category: standards > > >Synopsis: Patch to add getopt_long_only(3) to libc > > Hm. Not to offend in any way -- what standard exactly requires > the implementation to support getopt_long_only? > Shouldn't it be placed in some other category? > Non really, except the Linux Standard Base Specification. However, I couldn't think of a better matching category and it would be great if a standards-guru could have a look at the changes to the unistd.h and getopt.h headers and verify that they don't break conformance to standards. From owner-freebsd-standards@FreeBSD.ORG Sat Feb 21 10:50:13 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F65216A4CF for ; Sat, 21 Feb 2004 10:50:13 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56F1843D1F for ; Sat, 21 Feb 2004 10:50:13 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1LIoDbv041530 for ; Sat, 21 Feb 2004 10:50:13 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1LIoDJW041528; Sat, 21 Feb 2004 10:50:13 -0800 (PST) (envelope-from gnats) Date: Sat, 21 Feb 2004 10:50:13 -0800 (PST) Message-Id: <200402211850.i1LIoDJW041528@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Andrey Chernov Subject: Re: standards/63173: Patch to add getopt_long_only(3) to libc X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Andrey Chernov List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 18:50:13 -0000 The following reply was made to PR standards/63173; it has been noted by GNATS. From: Andrey Chernov To: Marius Strobl Cc: FreeBSD-gnats-submit@FreeBSD.ORG, ru@FreeBSD.ORG Subject: Re: standards/63173: Patch to add getopt_long_only(3) to libc Date: Sat, 21 Feb 2004 21:48:14 +0300 On Sat, Feb 21, 2004 at 04:57:06PM +0100, Marius Strobl wrote: > after applying the patch still doesn't implement getopt(3) and > therefore replace src/lib/libc/stdlib/getopt.c, i.e. it doesn't > define REPLACE_GETOPT, yet. This is something that should be taken > into consideration for FreeBSD 6 (regardless if the patch is applied > or not). Please always consider POSIX as superceeded standard against GNU/Linux. It means your patch for header is wrong. If POSIX says that getopt() must be declared in , it is only place where is must be declared, and not in etc. If you need its declaration in non-standard header , must be included, as was done before your patch. Also please remove all getopt()-related redeclarations from Forget about REPLACE_GETOPT, it will never be defined, we already have standard-conforming one. Making getopt() like getopt_long() really breaks some strict getopt() syntax. If some GNU program likes to use plain getopt() as getopt_long(), it should either use separate library or it source code should replace getopt->getopt_long. Otherwise it looks fine. -- Andrey Chernov | http://ache.pp.ru/ From owner-freebsd-standards@FreeBSD.ORG Sat Feb 21 11:20:05 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 387A816A4D2 for ; Sat, 21 Feb 2004 11:20:05 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DF6B43D1F for ; Sat, 21 Feb 2004 11:20:05 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1LJK5bv047401 for ; Sat, 21 Feb 2004 11:20:05 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1LJK4p7047399; Sat, 21 Feb 2004 11:20:04 -0800 (PST) (envelope-from gnats) Date: Sat, 21 Feb 2004 11:20:04 -0800 (PST) Message-Id: <200402211920.i1LJK4p7047399@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Mike Heffner Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Mike Heffner List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 19:20:05 -0000 The following reply was made to PR standards/61934; it has been noted by GNATS. From: Mike Heffner To: Wartan Hachaturow Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant Date: Sat, 21 Feb 2004 14:16:21 -0500 (EST) This message is in MIME format --_=XFMail.1.5-DEVEL.FreeBSD:20040221141621:330=_ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 18-Feb-2004 Wartan Hachaturow wrote: | On Wed, Feb 18, 2004 at 09:20:40AM -0500, Mike Heffner wrote: | |> Therefore, changing setfile to have a tri-state return value (< 0, 0, |> 1) |> will still work in these cases that are simply testing for a failure. | | Okay, here's the new patch that (hopefully :) fixes the issues you've | pointed. | Note also that -e works with -f, which is a SUS extension (SUS requires | only to check the system mailbox) -- quite handy. Solaris does the same. | I've made some changes so that this is consistent with the current style in mail(1). I plan to commit the attached patch unless you see/have any problems with it. Mike -- Mike Heffner --_=XFMail.1.5-DEVEL.FreeBSD:20040221141621:330=_ Content-Disposition: attachment; filename="mail-sus.diff" Content-Transfer-Encoding: 7bit Content-Description: mail-sus.diff Content-Type: text/plain; charset=us-ascii; name=mail-sus.diff; SizeOnDisk=8881 Index: extern.h =================================================================== RCS file: /cvs/ncvs/src/usr.bin/mail/extern.h,v retrieving revision 1.8 diff -u -r1.8 extern.h --- extern.h 25 Jun 2002 05:24:29 -0000 1.8 +++ extern.h 21 Feb 2004 19:51:45 -0000 @@ -73,6 +73,7 @@ char *value(const char *); char *vcopy(const char *); char *yankword(char *, char []); +char *yanklogin(char *, char []); int Fclose(FILE *); int More(int *); int Pclose(FILE *); Index: lex.c =================================================================== RCS file: /cvs/ncvs/src/usr.bin/mail/lex.c,v retrieving revision 1.14 diff -u -r1.14 lex.c --- lex.c 30 Jun 2002 05:25:06 -0000 1.14 +++ lex.c 21 Feb 2004 19:51:45 -0000 @@ -60,13 +60,17 @@ * If the first character of name is %, we are considered to be * editing the file, otherwise we are reading our mail which has * signficance for mbox and so forth. + * + * If the -e option is being passed to mail, this function has a + * tri-state return code: -1 on error, 0 on no mail, 1 if there is + * mail. */ int setfile(name) char *name; { FILE *ibuf; - int i, fd; + int checkmode, i, fd; struct stat stb; char isedit = *name != '%' || getuserid(myname) != getuid(); char *who = name[1] ? name + 1 : myname; @@ -147,12 +151,17 @@ (void)Fclose(ibuf); relsesigs(); sawcom = 0; - if (!edit && msgCount == 0) { + checkmode = value("checkmode") != NULL; + + if ((checkmode || !edit) && msgCount == 0) { nomail: - fprintf(stderr, "No mail for %s\n", who); - return (-1); + if (!checkmode) { + fprintf(stderr, "No mail for %s\n", who); + return (-1); + } else + return (0); } - return (0); + return (checkmode ? 1 : 0); } /* Index: mail.1 =================================================================== RCS file: /cvs/ncvs/src/usr.bin/mail/mail.1,v retrieving revision 1.42 diff -u -r1.42 mail.1 --- mail.1 9 Jan 2003 01:08:33 -0000 1.42 +++ mail.1 21 Feb 2004 19:51:45 -0000 @@ -46,15 +46,23 @@ .Op Fl s Ar subject .Op Fl c Ar cc-addr .Op Fl b Ar bcc-addr +.Op Fl F .Ar to-addr ... .Op Fl Ar sendmail-option ... .Nm -.Op Fl EiInNv +.Op Fl EHiInNv +.Op Fl F .Fl f .Op Ar name .Nm -.Op Fl EiInNv +.Op Fl EHiInNv +.Op Fl F .Op Fl u Ar user +.Nm +.Fl e +.Op Fl f Ar name +.Nm +.Op Fl H .Sh INTRODUCTION The .Nm @@ -69,6 +77,13 @@ Verbose mode. The details of delivery are displayed on the user's terminal. +.It Fl e +Test for the presence of mail in the (by default, system) +mailbox. An exit status of 0 is returned if +it has mail; otherwise, an exit status +of 1 is returned. +.It Fl H +Write a header summary only. .It Fl E Do not send messages with an empty body. This is useful for piping errors from @@ -126,6 +141,15 @@ .Ic quit , .Nm writes undeleted messages back to this file. +.It Fl F +Record the message in a file named after the first +recipient. The name is the login-name portion of the +address found first on the +.Dq Li To: +line in the mail header. +Overrides the +.Va record +variable, if set. .It Fl u Is equivalent to: .Pp Index: main.c =================================================================== RCS file: /cvs/ncvs/src/usr.bin/mail/main.c,v retrieving revision 1.13 diff -u -r1.13 main.c --- main.c 30 Jun 2002 05:25:06 -0000 1.13 +++ main.c 21 Feb 2004 19:51:45 -0000 @@ -93,7 +93,7 @@ bcc = NULL; smopts = NULL; subject = NULL; - while ((i = getopt(argc, argv, "EINT:b:c:dfins:u:v")) != -1) { + while ((i = getopt(argc, argv, "FEHINT:b:c:edfins:u:v")) != -1) { switch (i) { case 'T': /* @@ -123,6 +123,25 @@ case 'd': debug++; break; + case 'e': + /* + * User wants to check mail and exit. + */ + assign("checkmode", ""); + break; + case 'H': + /* + * User wants a header summary only. + */ + assign("headersummary", ""); + break; + case 'F': + /* + * User wants to record messages to files + * named after first recipient username. + */ + assign("recordrecip", ""); + break; case 's': /* * Give a subject field for sending from @@ -189,11 +208,13 @@ break; case '?': fprintf(stderr, "\ -Usage: %s [-EiInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\ +Usage: %s [-EiInv] [-s subject] [-c cc-addr] [-b bcc-addr] [-F] to-addr ...\n\ %*s [- sendmail-options ...]\n\ - %s [-EiInNv] -f [name]\n\ - %s [-EiInNv] [-u user]\n",__progname, strlen(__progname), "", - __progname, __progname); + %s [-EHiInNv] [-F] -f [name]\n\ + %s [-EHiInNv] [-F] [-u user]\n\ + %s -e [-f name]\n\ + %s -H\n",__progname, strlen(__progname), "", + __progname, __progname, __progname, __progname); exit(1); } } @@ -240,6 +261,18 @@ */ exit(senderr); } + + if(value("checkmode") != NULL) { + if (ef == NULL) + ef = "%"; + if (setfile(ef) <= 0) + /* Either an error has occured, or no mail */ + exit(1); + else + exit(0); + /* NOTREACHED */ + } + /* * Ok, we are reading mail. * Decide whether we are editing a mailbox or reading @@ -259,6 +292,11 @@ (void)fflush(stdout); (void)signal(SIGINT, prevint); } + + /* If we were in header summary mode, it's time to exit. */ + if (value("headersummary") != NULL) + exit(0); + commands(); (void)signal(SIGHUP, SIG_IGN); (void)signal(SIGINT, SIG_IGN); Index: names.c =================================================================== RCS file: /cvs/ncvs/src/usr.bin/mail/names.c,v retrieving revision 1.8 diff -u -r1.8 names.c --- names.c 30 Jun 2002 05:25:06 -0000 1.8 +++ names.c 21 Feb 2004 19:51:45 -0000 @@ -210,6 +210,79 @@ } /* + * Grab a single login name (liberal word) + * Throw away things between ()'s, take anything between <>, + * and look for words before metacharacters %, @, !. + */ +char * +yanklogin(ap, wbuf) + char *ap, wbuf[]; +{ + char *cp, *cp2, *cp_temp; + int n; + + cp = ap; + for (;;) { + if (*cp == '\0') + return (NULL); + if (*cp == '(') { + int nesting = 0; + + while (*cp != '\0') { + switch (*cp++) { + case '(': + nesting++; + break; + case ')': + --nesting; + break; + } + if (nesting <= 0) + break; + } + } else if (*cp == ' ' || *cp == '\t' || *cp == ',') + cp++; + else + break; + } + + /* + * Now, let's go forward till we meet the needed character, + * and step one word back. + */ + + /* First, remember current point. */ + cp_temp = cp; + n = 0; + + /* + * Note that we look ahead in a cycle. This is safe, since + * non-end of string is checked first. + */ + while(*cp != '\0' && strchr("@%!", *(cp + 1)) == NULL) + cp++; + + /* + * Now, start stepping back to the first non-word character, + * while counting the number of symbols in a word. + */ + while(cp != cp_temp && strchr(" \t,<>", *(cp - 1)) == NULL) { + n++; + cp--; + } + + /* Finally, grab the word forward. */ + cp2 = wbuf; + while(n >= 0) { + *cp2++=*cp++; + n--; + } + + *cp2 = '\0'; + return (cp); +} + +/* * For each recipient in the passed name list with a / * in the name, append the message to the end of the named file * and remove him from the recipient list. Index: send.c =================================================================== RCS file: /cvs/ncvs/src/usr.bin/mail/send.c,v retrieving revision 1.13 diff -u -r1.13 send.c --- send.c 30 Jun 2002 05:25:06 -0000 1.13 +++ send.c 21 Feb 2004 19:51:45 -0000 @@ -303,9 +303,10 @@ int printheaders; { char *cp; + char *nbuf; int pid; char **namelist; - struct name *to; + struct name *to, *nsto; FILE *mtf; /* @@ -354,6 +355,18 @@ to = elide(to); if (count(to) == 0) goto out; + if (value("recordrecip") != NULL) { + /* + * Before fixing the header, save old To:. + * We do this because elide above has sorted To: list, and + * we would like to save message in a file named by the first + * recipient the user has entered, not the one being the first + * after sorting happened. + */ + if ((nsto = malloc(sizeof(struct name))) == NULL) + err(1, "Out of memory"); + bcopy(hp->h_to, nsto, sizeof(struct name)); + } fixhead(hp, to); if ((mtf = infix(hp, mtf)) == NULL) { fprintf(stderr, ". . . message lost, sorry.\n"); @@ -369,8 +382,21 @@ printf("\n"); goto out; } - if ((cp = value("record")) != NULL) - (void)savemail(expand(cp), mtf); + if (value("recordrecip") != NULL) { + /* + * Extract first recipient username from saved To: and use it + * as a filename. + */ + if ((nbuf = malloc(strlen(detract(nsto, 0)) + 1)) == NULL) + err(1, "Out of memory"); + if ((cp = yanklogin(detract(nsto, 0), nbuf)) != NULL) + (void)savemail(expand(nbuf), mtf); + free(nbuf); + free(nsto); + } else { + if ((cp = value("record")) != NULL) + (void)savemail(expand(cp), mtf); + } /* * Fork, set up the temporary mail file as standard * input for "mail", and exec with the user list we generated --_=XFMail.1.5-DEVEL.FreeBSD:20040221141621:330=_-- End of MIME message From owner-freebsd-standards@FreeBSD.ORG Sat Feb 21 11:30:22 2004 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80AF816A4CE for ; Sat, 21 Feb 2004 11:30:22 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6454443D1F for ; Sat, 21 Feb 2004 11:30:22 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1LJUMbv048173 for ; Sat, 21 Feb 2004 11:30:22 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1LJUMg4048172; Sat, 21 Feb 2004 11:30:22 -0800 (PST) (envelope-from gnats) Date: Sat, 21 Feb 2004 11:30:22 -0800 (PST) Message-Id: <200402211930.i1LJUMg4048172@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Wartan Hachaturow Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Wartan Hachaturow List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 19:30:22 -0000 The following reply was made to PR standards/61934; it has been noted by GNATS. From: Wartan Hachaturow To: Mike Heffner Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant Date: Sat, 21 Feb 2004 22:23:41 +0300 On Sat, Feb 21, 2004 at 02:16:21PM -0500, Mike Heffner wrote: > I've made some changes so that this is consistent with the current style > in mail(1). I plan to commit the attached patch unless you see/have any > problems with it. Oh, it's fine with me, thanks for looking. -- Regards, Wartan. "Be different: conform."