Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120608141239.GK163@brightrain.aerifal.cx>
Date: Fri, 8 Jun 2012 10:12:39 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: bug? sysinfo() and getopt_long() misbehavior

On Fri, Jun 08, 2012 at 08:12:06PM +0800, orc wrote:
> > Binutils 2.20, musl compiled with -Bsymbolic-functions. But statically
> > or dynamically linked iptables still rejects to accept arguments.
> > It required ugly fix to work, mostly same as iproute2, removing some
> > non-conformant extensions, correct headers, maybe there is a fault. It
> > also expects somewhere that we have glibc (#ifdef __GLIBC__) headers.
> > Maybe it's code is non-conformant in whole. I will try to see where it
> > fails on host.
> Iptables fails because it sets optind to zero and getopt_long
> immidately returns with -1 in the first line (argv[0][0] !=
> '-'). But problem does not fixed with just removing 'optind = 0;' from
> source code.
> For what reason one can set optind to zero?

I believe it's a common but non-portable way of restarting option
scanning. Of course that would make no sense if this is the first scan
of options anyway. I'll try to look into what's going wrong here..

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.