[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

user/3623: /usr/bin/strip -s eats the following arg



>Number:         3623
>Category:       user
>Synopsis:       /usr/bin/strip -s eats the following arg
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 01 05:30:01 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Wim Lewis
>Release:        OPENBSD_3_4
>Organization:
      Wim Lewis (wiml@hhhh.org), Seattle, WA, USA. PGP keyID 27F772C1
>Environment:
	
	System      : OpenBSD 3.4
	Architecture: OpenBSD.i386
	Machine     : i386
>Description:
The 'strip' utility (which identifies itself as GNU strip 2.11.2)
has a command-line option '-s' which directs it to strip all
symbols. It doesn't use an argument, but the word on the command-line
immediately following the '-s' is consumed anyway.

The problem looks to be an incorrect spec string passed to getopt_long().

>How-To-Repeat:

Create an object or executable, say 'foo.o'. If you invoke "strip -s foo.o",
strip will die with a usage message. "strip -s" causes strip to complain
that "-s" requires an argument, followed by a usage message saying that "-s"
does not take an argument. "strip -s dummy foo.o" will strip the symbols
("dummy" can be any word; it's ignored).

>Fix:

The spec string passed to getopt_long() at
  /usr/src/gnu/usr.bin/binutils/binutils/objcopy.c line 1834
has an ':' following the 's', although the 'case' branch for the 's'
option does not use optarg. Suggested fix: remove the ':'.

It appears that the '-g' option has the same problem.


>Release-Note:
>Audit-Trail:
>Unformatted: