NetBSD Problem Report #11197

Received: (qmail 27538 invoked from network); 12 Oct 2000 12:22:59 -0000
Message-Id: <Pine.SOL.4.21.0010121311080.20571-100000@draco.cus.cam.ac.uk>
Date: Thu, 12 Oct 2000 13:22:49 +0100 (BST)
From: Ben Harris <bjh21@netbsd.org>
Sender: Ben Harris <bjh21@cus.cam.ac.uk>
To: gnats-bugs@gnats.netbsd.org
Subject: POSIX.2: regular builtins can't be exec'ed.

>Number:         11197
>Category:       standards
>Synopsis:       POSIX.2: regular builtins can't be exec'ed.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 12 12:24:00 +0000 2000
>Closed-Date:    Wed Dec 05 07:52:47 +0000 2018
>Last-Modified:  Thu Dec 13 05:15:00 +0000 2018
>Originator:     Ben Harris
>Release:        2000-02-07
>Organization:
	Me!
>Environment:
NetBSD cromarty 1.4X NetBSD 1.4X (CROMARTY) #9: Wed May  3 23:49:51 BST 2000
     bjh21@cromarty:/usr/src/sys/arch/macppc/compile/CROMARTY macppc

>Description:
POSIX.2 requires that all utilities be able to be run by the likes of
xargs.  This includes things that are usually shell builtins.  In NetBSD,
of the utilities in the base standard, "cd", "command", "getopts",
"umask" and "wait" cannot be so run.

There are also some builtins in the User Portability Extension that are
likely to need the same treatment.
>How-To-Repeat:
$ export PATH=`getconf PATH`
$ echo "eep" | xargs cd
xargs: cd: No such file or directory
$ echo "eep" | xargs command
xargs: command: No such file or directory
$ echo "eep" | xargs getopts
xargs: getopts: No such file or directory
$ echo "eep" | xargs umask
xargs: umask: No such file or directory
$ echo "eep" | xargs wait
xargs: wait: No such file or directory

>Fix:
The relevant section of the POSIX.2 rationale suggests making each of
these a symlink to the following shell script:

$0 "$@"

Crude, but probably good enough for the purpose at hand.

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL:http://www.netbsd.org/Ports/arm26/>

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: kre@NetBSD.org
State-Changed-When: Wed, 05 Dec 2018 07:52:47 +0000
State-Changed-Why:
It is a pity that no-one has replied to, or acted upon, this PR
in the past 18 years ...

The last time I raised this issue, the consensus was strongly
that POSIX was insane in this area (my interpretation) and that
we should not implement this (even though doing so is trivial
and almost cost free).

Thus, rather than simply leave this PR sitting open for another
18 years, I'm closing it as a "will not fix".


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: standards/11197 (POSIX.2: regular builtins can't be exec'ed.)
Date: Thu, 13 Dec 2018 05:11:14 +0000

 On Wed, Dec 05, 2018 at 07:52:47AM +0000, kre@NetBSD.org wrote:
  > Synopsis: POSIX.2: regular builtins can't be exec'ed.
  > 
  > State-Changed-From-To: open->closed
  > State-Changed-By: kre@NetBSD.org
  > State-Changed-When: Wed, 05 Dec 2018 07:52:47 +0000
  > State-Changed-Why:
  > It is a pity that no-one has replied to, or acted upon, this PR
  > in the past 18 years ...
  > 
  > The last time I raised this issue, the consensus was strongly
  > that POSIX was insane in this area (my interpretation) and that
  > we should not implement this (even though doing so is trivial
  > and almost cost free).

 It is not free to install nonfunctioning junk scripts on the system.
 An implementation that hides the insanity inside xargs as a set of
 special cases after exec fails is not free either (bloat, maintenance
 cost, you name it).

  > Thus, rather than simply leave this PR sitting open for another
  > 18 years, I'm closing it as a "will not fix".

 +1

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.