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

Full log


View this message in rfc822 format

From: Pavel Raiskup <praiskup <at> redhat.com>
To: 18458 <at> debbugs.gnu.org
Subject: bug#18458: 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 335 days ago.

Previous Next


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