This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: getopt() argument permuting considered risky
- From: Roland McGrath <roland at redhat dot com>
- To: Geoff Clare <geoff at gclare dot org dot uk>
- Cc: Michael T Kerrisk <mtk-lists at gmx dot net>,Paul Eggert <eggert at CS dot UCLA dot EDU>, libc-alpha at sources dot redhat dot com
- Date: Wed, 4 Aug 2004 13:11:13 -0700
- Subject: Re: getopt() argument permuting considered risky
> The problem is that many people porting scripts from Unix systems to
> glibc-based systems are likely to be unaware of this difference in
> getopt(), and therefore unaware of the need to set POSIXLY_CORRECT to
> protect against the risk that it creates. (Until something breaks.)
Anyone do porting should be aware of what the target system's documented
way to get a standard environment is.
> In my view a much better way to handle this extension would be for
> the default behaviour to be as per the standard, and for there to
> be an environment variable such as GNU_GETOPT_PERMUTING which can be
> set to enable the extension when it is wanted.
We don't agree. We have considered all the issues you are raising, with
great deliberation and quite a long time ago, and decided differently than
you have. Sorry. If you want to put together a system that behaves this
way, it is pretty easy to put POSIXLY_CORRECT=1 in /etc/profile and the like.