Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jan 2011 21:07:30 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/bin/sh exec.c src/tools/regression/bin/sh/execution path1.0
Message-ID:  <201101092109.p09L9IVZ093653@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

jilles      2011-01-09 21:07:30 UTC

  FreeBSD src repository

  Modified files:
    bin/sh               exec.c 
  Added files:
    tools/regression/bin/sh/execution path1.0 
  Log:
  SVN rev 217206 on 2011-01-09 21:07:30Z by jilles
  
  sh: Remove special %builtin PATH entry.
  All builtins are now always found before a PATH search.
  
  Most ash derivatives have an undocumented feature where the presence of an
  entry "%builtin" in $PATH will cause builtins to be checked at that point of
  the PATH search, rather than before looking at any directories as documented
  in the man page (very old versions do document this feature).
  
  I am removing this feature from sh, as it complicates the code, may violate
  expectations (for example, /usr/bin/alias is very close to a forkbomb with
  PATH=/usr/bin:%builtin, only /usr/bin/builtin not being another link saves
  it) and appears to be unused (all the %builtin google code search finds is
  in some sort of ash source code).
  
  Note that aliases and functions took and take precedence above builtins.
  Because aliases work on a lexical level they can only ever be overridden on
  a lexical level (quoting or preceding 'builtin' or 'command'). Allowing
  override of functions via PATH does not really fit in the model of sh and it
  would work differently from %builtin if implemented.
  
  Note: POSIX says special builtins are found before functions. We comply to
  this because we do not allow functions with the same name as a special
  builtin.
  
  Silence from:   freebsd-hackers@ (message sent 20101225)
  Discussed with: dougb
  
  Revision  Changes    Path
  1.47      +7 -33     src/bin/sh/exec.c
  1.1       +15 -0     src/tools/regression/bin/sh/execution/path1.0 (new)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101092109.p09L9IVZ093653>