Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2001 09:30:36 +1100 (EST)
From:      Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        bug-gnu-utils@prep.ai.mit.edu
Subject:   bin/26010: tar(1) core-dumps on '-I file'
Message-ID:  <200103222230.f2MMUaT09764@gsmx07.alcatel.com.au>

next in thread | raw e-mail | index | archive | help

>Number:         26010
>Category:       bin
>Synopsis:       tar(1) core-dumps on '-I file'
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 22 14:40:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter Jeremy
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Alcatel Australia Limited
>Environment:
System: FreeBSD gsmx07.alcatel.com.au 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Thu Jan 18 05:05:46 EST 2001 root@gsmx07.alcatel.com.au:/usr/obj/3.0/cvs/src/sys/gsmx i386

	GNU tar 1.11.2

>Description:
	The '-I' option of tar is used to specify a file containing a list
	of files to create/extract.  Whilst the option parsing code expects
	'-I' to take an option, the string passed to getoldopts() specifies
	that '-I' doesn't take an option.  This leads to NULL being passed
	to strcmp().

>How-To-Repeat:
	echo "/bin" >/tmp/foo
	tar -cf /dev/null -I /tmp/foo

>Fix:

Index: tar.c
===================================================================
RCS file: /home/CVSROOT/src/gnu/usr.bin/tar/tar.c,v
retrieving revision 1.23
diff -u -r1.23 tar.c
--- tar.c	2000/12/24 10:52:23	1.23
+++ tar.c	2001/03/22 22:21:32
@@ -324,7 +324,7 @@
 
   /* Parse options */
   while ((c = getoldopt (argc, argv,
-	       "-01234567Ab:BcC:df:F:g:GhiIjkK:lL:mMnN:oOpPrRsStT:uUvV:wWxX:yzZ",
+	       "-01234567Ab:BcC:df:F:g:GhiI:jkK:lL:mMnN:oOpPrRsStT:uUvV:wWxX:yzZ",
 			 long_options, &ind)) != EOF)
     {
       switch (c)

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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103222230.f2MMUaT09764>