Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001390 [1003.1(2016/18)/Issue7+TC2] Shell and Utilities Objection Omission 2020-08-13 19:54 2020-08-14 09:01
Reporter kre View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name Robert Elz
Organization
User Reference
Section XCU 2.9.1.1 (In Issue 8 draft 1, section 2.9.1.4)
Page Number 2367-8 (in Issue 8 draft 1: 2293-4)
Line Number 75545-75627 (In Issue 8 Draft 1, lines 74140-74183)
Interp Status ---
Final Accepted Text
Summary 0001390: No method to invoke a non-standard built-in utility
Description The procedures in XCU 2.9.1.1 (which is 2.9.1.4 in Issue 8 draft 1)
and specifically sub-section 1 of that section, specify how to
choose an actual command to invoke given a command name that does
not contain a slash.

All shells implement some built-in commands. The standard
specifies the procedures to invoke the special built-in commands,
a set of specific built-in commands (in Issue 8 called Intrinsic
built-in commands) and built-in commands that are standard utilities.
The specification of the last form is incorrect, as noted in
0001389 but that is immaterial here.

However some shells (most shells?) provide extra built-in utilities
that are not standard utilities, not intrinsic utilities, and not
special built-in utilities. The standard as currently written
provides no mechanism to allow such non-standard built-in utilities
to be invoked.

If 0001389 is resolved as accepted, either as written, or in some
substantially similar fashion, this bug can be closed, as it will
have already been resolved.

If 0001389 is rejected, then a change will be needed to allow for
non-standard built-in utilities to be invoked.

This is because (sub-sections of 2.9.1.1 1)
        a does not apply, the built-in is not a special built-in
        b can be assumed not to apply, at least most of the time,
          the new built-in will not have one of the designated names.
        c does not apply, the command to be invoked is not defined as
          a function
        d does not apply, the command name of the relevant utility is
          not one of those listed.
        e is all that remains, and specifies a PATH search to locate the
          utility. That search fails, as the built-in in question is
          not implemented as a file system command. Note that XCU 1.6
          requires ant standard utility implemented as a built-in to
          also be available for use via one of the exec() family of
          functions, but nothing is required in a similar fashion for
          non-standard utilities. A shell is entitled to implement a
          new non-standard utility as a built-in without making it also
          available in the filesystem. Since this search fails
          2.9.1.1 1.e.ii applies, and specifies:
If the search is unsuccessful, the command shall fail with
an exit status of 127 and the shell shall write an error message.


That is, any attempt to invoke a non-standard built-in utility is
required to fail (as written, this is not optional, it is mandatory).

Shells that implement non-standard built-in utilities (most of them)
do not act like that, and instead invoke the utility, just like any
other built-in utility.

An example of such a built-in is the "jobid" built-in from the NetBSD (and
FreeBSD) shells, which maps between shell job identifiers (%% etc) and
lead process id's (process group id) of the job (and so makes no sense at
all to implement outside the shell, as job identifiers exist only as an
internal shell notation).

The standard needs to be amended to correct this omission.
Desired Action In section 2.9.1.1 1.d after the words
If the command name matches the name of the type or ulimit
utility, or of a utility listed in the following table,

add the new clause
or matches the name of any non-standard
built-in utility [xref XCU 1.6],


As amended (to become 2.9.1.4 1.d in Issue 8 draft 1), the relevant change
is to add after the words:
If the command name matches the name of an intrinsic utility
(see Section 1.7, on page 2268),

add the new clause
or matches the name of any non-standard
built-in utility [xref XCU 1.6],


Note that the words to be added are the same, but the text that precedes
them has altered between Issue 7 and Issue 8. In either case the text
that follows
that utility shall be invoked.

is unchanged, as is the list of command names that follows in Issue 7.
Tags No tags attached.
Attached Files

- Relationships
related to 0001389New Shell command search procedure is incorrect 
related to 0001391New Unclear language in specification of utilities implemented as functions 

-  Notes
(0004921)
geoffclare (manager)
2020-08-14 09:01

"The standard as currently written provides no mechanism to allow such non-standard built-in utilities to be invoked."

This was solved in Issue 8 draft 1 by allowing implementations to add to the list of intrinsic utilities. See XCU 1.7 (P2268 L73117) in the draft: "Whether any additional utility is considered an intrinsic utility is implementation-defined."
All the implementation needs to do is document the additions.

This practice is not recommended (through the use of "should not" on L73119) but is allowed.

- Issue History
Date Modified Username Field Change
2020-08-13 19:54 kre New Issue
2020-08-13 19:54 kre Name => Robert Elz
2020-08-13 19:54 kre Section => XCU 2.9.1.1 (In Issue 8 draft 1, section 2.9.1.4)
2020-08-13 19:54 kre Page Number => 2367-8 (in Issue 8 draft 1: 2293-4)
2020-08-13 19:54 kre Line Number => 75545-75627 (In Issue 8 Draft 1, lines 74140-74183)
2020-08-13 21:17 Don Cragun Relationship added related to 0001389
2020-08-13 21:19 Don Cragun Relationship added related to 0001391
2020-08-14 08:30 geoffclare Interp Status => ---
2020-08-14 08:30 geoffclare Description Updated
2020-08-14 09:01 geoffclare Note Added: 0004921


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker