[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#267142: debian-policy: Sections 10.4 and 6.1 are inconsistent (Posix doesn't say what you think it says)



On Fri, 20 Aug 2004 23:20:15 +0200, Thomas Bushnell BSG wrote:
> What is going on here is that Posix allows a conformant shell to
> implement programs as builtins.  ANY program.  ANY program WHATSOEVER!

10.4 tells script authors to use only POSIX features (and echo -n)
so that their scripts will work with all shells that implement
POSIX features and echo -n.  Implicit in this is a recommendation
to the maintainer of a shell package to make his shell follow
POSIX rules and implement echo -n so that administrators can point
/bin/sh to that shell without breaking maintainer scripts.

You quite correctly observe that, given the possibility of shells
building in commands, the aforementioned restriction isn't enough
to guarantee portability across such shells, especially given the
deprecation in 6.1 of the use of full pathnames.

Looking through the list of ways to address this problem I find 
that I agree with you in strongly preferring:

> OPTION 2: Restrict /bin/sh to a specified list of shells, rather
>   than "any POSIX compatible shell", and require that shell scripts
>   run correctly on that list.

Current practice is to support bash and dash.  Efforts are made to
support posh too because this seems like the easiest way to ensure
that a script satisfies 10.4 as it is currently written.

This practice might as well be endorsed by policy.  I suggest that
10.4 be changed to require that scripts run correctly on bash, dash
and posh.  The reason for including posh in the list is that this
will continue to discourage the use of extensions that happen to be
implemented by both bash and dash; this keeps open the possibility
that other shells can be added to the list in the future.

-- 
Thomas Hood



Reply to: