[asterisk-bugs] [Asterisk 0012883]: build_tools/strip_nonapi 1.4/1.6 may run strip with -N as last argument

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Jun 18 11:00:46 CDT 2008


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.digium.com/view.php?id=12883 
====================================================================== 
Reported By:                Nik Soggia
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12883
Category:                   General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0-beta6 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             06-18-2008 11:00 CDT
Last Modified:              06-18-2008 11:00 CDT
====================================================================== 
Summary:                    build_tools/strip_nonapi 1.4/1.6 may run strip with
-N as last argument
Description: 
it happens on some old systems (mine is slackware 10.2), newer system are
unlikely to be affected because today command lines can be longer than some
time ago.

when the whole list of arguments generated by "sed" cannot fit in a single
command execution, "xargs" will run "strip" a few times.
"-N" and its argument are not guaranteed to stay together because they are
separated by spaces.

the bug can be reproduced with a bit of luck, replacing "xargs" with
"xargs -s 1000" and decrementing "1000" by 5 until one execution ends with
"-N" and the next one starts with the symbol name without the "-N" in
front.

I solved the problem with this:
sed -i 's|/-N /|/--strip-symbol=/|g' build_tools/strip_nonapi
before running the top-level make.

with this workaround "xargs" still splits its stdin, but as long as
symbols don't contain spaces the resulting command-line should be always
correct.

I hope that this workaround is portable, if not, we may have to add a
check such as:

if "${STRIP}" 2>&1 | grep -q -e --strip-symbol ; then
    echo you may use "--strip-symbol="
else
    echo you should use "-N "
fi
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-18-08 11:00  Nik Soggia     Asterisk Version          => 1.6.0-beta6     
06-18-08 11:00  Nik Soggia     SVN Branch (only for SVN checkou => N/A          
  
======================================================================




More information about the asterisk-bugs mailing list