[illumos-Developer] [REVIEW] 850 system(3C) and similar could just use /bin/sh

Richard Lowe richlowe at richlowe.net
Mon Apr 4 13:07:36 PDT 2011


All,

I'd like review for:
    850 system(3C) and similar could just use /bin/sh
    873 Want a bsd-like <paths.h>

webrev:
    http://richlowe.net/webrevs/il_850

850:
  We had a bunch of code in libc which conditionalized on __xpg4 to
decide whether to run /bin/sh or /usr/xpg4/bin/sh.  With Illumos,
these are the same shell, so none of this is necessary.

873:
  In doing this, Gordon suggested that perhaps it'd be nice to have a
BSD-like define for "the shell", so I have here imported NetBSD's
<paths.h> with those entries which do not apply to us removed, and
changes made as necessary to fit with illumos (for instance, the PATH
and STDPATH changes).

  A <paths.h> with similar definitions is present on all BSD systems
(including OS X), and systems using the GNU C Library (such as Linux).

  I plan in the future to use this header to commonise the various
default $PATH definitions currently within libc (all those which say
"Keep in sync with CSPATH", and haven't been).

Testing:
  - Used the ! command in ed and xpg4/ed under truss, made sure it was
executing /usr/bin/sh

  - Used both at and xpg4/at while trussing cron, made sure the
correct shell was being used

  - Wrote some small crappy bits of code which call execvp(3C),
system(3C), popen(3C), and posix_spawnp(3C) in conditions which cause
them to execute the shell, and verified both that they executed
anything, and that what they executed was /usr/bin/sh

  I also plan to re-test ahead of integration.

-- Rich



More information about the Developer mailing list