From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 2 23:20:07 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F1ED106566B for ; Fri, 2 Apr 2010 23:20:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB278FC0C for ; Fri, 2 Apr 2010 23:20:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o32NK7B7025769 for ; Fri, 2 Apr 2010 23:20:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o32NK72Q025768; Fri, 2 Apr 2010 23:20:07 GMT (envelope-from gnats) Resent-Date: Fri, 2 Apr 2010 23:20:07 GMT Resent-Message-Id: <201004022320.o32NK72Q025768@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19BD81065672 for ; Fri, 2 Apr 2010 23:13:40 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id C797E8FC08 for ; Fri, 2 Apr 2010 23:13:40 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o32NDexU067143 for ; Fri, 2 Apr 2010 23:13:40 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o32NDeIs067142; Fri, 2 Apr 2010 23:13:40 GMT (envelope-from nobody) Message-Id: <201004022313.o32NDeIs067142@www.freebsd.org> Date: Fri, 2 Apr 2010 23:13:40 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/145308: tar(1) -C functionality unused when -c or -r is specified X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 23:20:07 -0000 >Number: 145308 >Category: bin >Synopsis: tar(1) -C functionality unused when -c or -r is specified >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 02 23:20:06 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9-CURRENT >Organization: Cisco Systems, Inc. >Environment: FreeBSD bayonetta.local 9.0-CURRENT FreeBSD 9.0-CURRENT #5 r205310: Sat Mar 20 01:32:51 PDT 2010 gcooper@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA amd64 >Description: $ (cd /var/db/pkg/apr-gdbm-db42-1.3.9.1.3.9_1/ && tar -cvjf /dev/null . -C /tmp) > /dev/null a . a ./+CONTENTS a ./+DESC a ./+COMMENT a ./+MTREE_DIRS a ./+REQUIRED_BY The following item fails to properly catch chdir fail on r205310's copy of tar(1) // libarchive: $ (cd /var/db/pkg/apr-gdbm-db42-1.3.9.1.3.9_1/ && tar -cvjf /dev/null . -C /nonexistent/directory) a . a ./+CONTENTS a ./+DESC a ./+COMMENT a ./+MTREE_DIRS a ./+REQUIRED_BY $ This should have failed immediately instead of continuing on. -C with -r is also broken in a similar way: $ (cd /var/db/pkg/apr-gdbm-db42-1.3.9.1.3.9_1/ && tar -rvf /tmp/foo . -C /tmp) > /dev/null a . a ./+CONTENTS a ./+DESC a ./+COMMENT a ./+MTREE_DIRS a ./+REQUIRED_BY This issue has also been filed upstream in the Google Code project page so that it's visible to folks outside of FreeBSD as well as within FreeBSD: http://code.google.com/p/libarchive/issues/detail?id=84 >How-To-Repeat: (cd / && tar -cvf /dev/null . -C /tmp) - should pass and all of the contents of /tmp should be printed if /tmp exists (cd / && tar -cvf /dev/null . -C /nonexistent/directory) - should flat out fail tmpdir=$(mktemp -d /tmp.XXXX) (cd / && tar -rf $tmpdir/foo -C /tmp) - should pass printing out the contents of /tmp again. >Fix: >Release-Note: >Audit-Trail: >Unformatted: