Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 28 Aug 2017 17:17:06 +0200
From: Denys Vlasenko <>
To: musl <>, Rich Felker <>, 
	Waldemar Brodkorb <>
Subject: Re: getopt() not exposing __optpos - shell needs it

On Mon, Aug 28, 2017 at 12:18 PM, Denys Vlasenko
<> wrote:
> glibc/uclibc need more extensive changes, since they use a pointer to store
> the position. This is a test in busybox tree which fails miserably
> because of that:
> # This test can fail with libc with buggy getopt() implementation.
> # If getopt() wants to parse multi-option args (-abc),
> # it needs to remember a position within current arg.
> #
> # If this position is kept as a POINTER, not an offset,
> # and if argv[] ADDRESSES (not contents!) change, it blows up.

uclibc would need something like this patch (not tested at all):

View attachment "z.diff" of type "text/plain" (12275 bytes)

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.