GNU bug report logs - #18458
Wrapper binary (.libs/lt-PROG.c) corrupts wide character arguments

Previous Next

Package: libtool;

Reported by: Pavel Raiskup <praiskup <at> redhat.com>

Date: Fri, 12 Sep 2014 08:27:02 UTC

Severity: normal

To reply to this bug, email your comments to 18458 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-libtool <at> gnu.org:
bug#18458; Package libtool. (Fri, 12 Sep 2014 08:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pavel Raiskup <praiskup <at> redhat.com>:
New bug report received and forwarded. Copy sent to bug-libtool <at> gnu.org. (Fri, 12 Sep 2014 08:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pavel Raiskup <praiskup <at> redhat.com>
To: bug-libtool <at> gnu.org
Subject: Wrapper binary (.libs/lt-PROG.c) corrupts wide character arguments
Date: Fri, 12 Sep 2014 10:25:52 +0200
Hello,

recently I got a bug report in Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1124436
Short summary:  On windows, the 'argv' in main() function is filled
by "preprocessed" content.  When `./wrapper.exe I ♥ lt`, the argv gets
filled by ["./wrapper.exe", "I", "?", "lt"].  Libtool wrapper parses this
argv[] content and based on this broken arguments it spawns the original
binary.  That way, original binary has different arguments and it
complicates testing, for example.

I tried to look at how it is done in the wrapper;  and I believe the
possible fix is non-trivial enough.  We need probably use the
GetcommandLineW and CommandLineToArgvW functions to obtain wide version of
argv.  That way, however, after removing --lt* arguments, you need to
escape the wide argv same way as for non-wide version (and pass it into
the _wspawnv call, instead of _spawnv).  I am not familiar with windows
api, so if you see that there is simpler/better solution, please say.

Firstly, I would like to know whether upstream is interested in such fix
and whether there is somebody interested in patch-review.  Secondly, TBH,
I'm not perfect example of guy to do such change (I could give it a try,
thought, through wine the problem seems to be reproducible).  If there was
somebody familiar with windows who wanted to write the patch, I would be
glad to do the review and testing.

Thanks for ideas!
Pavel





This bug report was last modified 10 years and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.