This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]