Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Sat, 07 Jan 2017 08:13:48 -0700
From: <>
Subject: RE: bug in getopt_long()

> -------- Original Message --------
> Subject: [musl] bug in getopt_long()
> From: "Anthony G. Basile" <>
> Date: Thu, January 05, 2017 9:00 am
> To:
> Hi,
> We hit a bug in Gentoo with getopt_long(). It appears the alpine people
> hit it too The problem was
> encountered in open-iscsi but I got some reduced code which I've
> attached. If you build and run that code as `./test --portal
> --discover` then you get
> p
> D
> unrecognized character 'D'
> On a glibc system, you don't get the "unrecognized character 'D'" which
> is what we'd expect. Rich suggested a patch to musl which looked like
> it might work, but it didn't. I didn't investigate further. I'm just
> reporting it first to see if others know what's up.

The attached patch should work, I believe; tested with both of the

./a.out --portal --discover
./a.out --portal --discover -- foo bar


> -- 
> Anthony G. Basile, Ph.D.
> Gentoo Linux Developer [Hardened]
> E-Mail :
> GnuPG FP : 1FED FAD9 D82C 52A5 3BAB DC79 9384 FA6E F52D 4BBA
> GnuPG ID : F52D4BBA

View attachment "getopt_long.patch" of type "text/x-diff" (1296 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.