Package: posh
Version: 0.8.6
Severity: wishlist

POSIX sayeth:

        Implementations may ignore the value of IFS in the
        environment, or the absence of IFS from the
        environment, at the time the shell is invoked, in
        which case the shell shall set IFS to <space> <tab>
        <newline> when it is invoked.

Why two choices?  Inheriting IFS is the ancient and more intuitive
behavior.  The family tree looks like this, according to [1] (history
flows roughly left to right):


 v7 --- ... --- SVR4 --- ... --- S5.6 --- S5.7 --- ...
  | \               \
  |  \               Irix5
  GC  ...
         \
          4.2BSD --- 4.3BSD

version 7 shell, SVR4 shell, 4.2BSD sh, SunOS 5.6 sh:
        inherits IFS

Irix 5 sh:
        resets IFS if and only if running as root or setuid/gid

4.3BSD sh:
        resets IFS if and only if uid=0 or euid!=uid

SunOS 5.7 sh, Geoff Collyer's v7 shell port:
        resets IFS unconditionally

Almost all modern shells (including ash and ksh88) reset IFS at
startup unconditionally in order to make privileged scripts
harder to exploit.

Inheriting IFS would violate the assumptions of many scripts.
It would make it easier to catch bugs like
<http://bugs.debian.org/95447>.

On the other hand, it obviously seems worth considering requiring
IFS to be reset at startup for the usual portability and reliability
reasons.  That would probably be the better fix.

Thoughts welcome, as always.

[1] http://www.in-ulm.de/~mascheck/bourne/



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to