Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001258 [1003.1(2016)/Issue7+TC2] Shell and Utilities Objection Error 2019-06-14 10:56 2019-11-20 16:01
Reporter stephane View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Stephane Chazelas
Organization
User Reference
Section export utility
Page Number 2402 (in 2018 edition)
Line Number 76898 (in 2018 edition)
Interp Status ---
Final Accepted Text See Note: 0004488
Summary 0001258: incorrect usage of "." utility in "export" example.
Description The "EXAMPLES" section of the "export" utility has:

export −p > temp-file
unset a lot of variables
... processing
. temp-file


In POSIX compliant shells, "." looks up files in $PATH, not the current directory when the file argument doesn't contain any slash, so it should be: ". ./temp-file".

It may also be worth mentioning that it may not work if the "unset a lot of variables" part unsets LC_CTYPE, LANG or LC_ALL variables (or the "processing" part sets any of them) as the "." utility could then be run in an environment where the charset is different from that used to generate the "export -p" output (in practice it is a problem and a source of security vulnerabilities).

And that it would not "restore an exported variable" that was previously unset but exported if the "processing" part sets those variables. Same if "processing" sets the readonly attribute on any of the variables.
Desired Action Change line 76898 from

   . temp-file

to:

   . ./temp-file

Also, address the other objections in the description if deemed necessary.
Tags tc3-2008
Attached Files

- Relationships

-  Notes
(0004488)
nick (manager)
2019-07-22 15:43

On page 2402 line 76893, change:
    
export PATH=/local/bin:$PATH

to:
    
export PATH="/local/bin:$PATH"


On page 2402 line 76895, change:
   
export −p > temp-file
    unset a lot of variables
    ... processing
    . temp-file

to (note loss of italics on "temp-file"):
    
export −p > temp-file
    unset a lot of variables
    ... processing
    . ./temp-file

Note: If LANG, LC_CTYPE or LC_ALL are left altered or unset in the above example prior to sourcing temp-file, the results may be undefined.

- Issue History
Date Modified Username Field Change
2019-06-14 10:56 stephane New Issue
2019-06-14 10:56 stephane Name => Stephane Chazelas
2019-06-14 10:56 stephane Section => export utility
2019-06-14 10:56 stephane Page Number => 2402 (in 2018 edition)
2019-06-14 10:56 stephane Line Number => 76898 (in 2018 edition)
2019-07-22 15:43 nick Note Added: 0004488
2019-07-22 15:44 nick Interp Status => ---
2019-07-22 15:44 nick Status New => Resolved
2019-07-22 15:44 nick Resolution Open => Accepted As Marked
2019-07-22 15:44 nick Final Accepted Text => See Note: 0004488
2019-07-22 15:44 nick Tag Attached: tc3-2008
2019-11-20 16:01 geoffclare Status Resolved => Applied


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