From owner-freebsd-bugs Tue Jun 19 4:30: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A6DE937B408 for ; Tue, 19 Jun 2001 04:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5JBU3U85582; Tue, 19 Jun 2001 04:30:03 -0700 (PDT) (envelope-from gnats) Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218]) by hub.freebsd.org (Postfix) with ESMTP id 6555237B401; Tue, 19 Jun 2001 04:21:44 -0700 (PDT) (envelope-from jhein@timing.com) Received: from brain.timing.com (brain.timing.com [206.168.13.195]) by Daffy.timing.com (8.9.3/8.9.3) with ESMTP id FAA23394; Tue, 19 Jun 2001 05:21:43 -0600 (MDT) (envelope-from jhein@timing.com) Received: (from jhein@localhost) by brain.timing.com (8.11.3/8.11.3) id f5JBLge58580; Tue, 19 Jun 2001 05:21:42 -0600 (MDT) (envelope-from jhein) Message-Id: <200106191121.f5JBLge58580@brain.timing.com> Date: Tue, 19 Jun 2001 05:21:42 -0600 (MDT) From: jhein@timing.com Reply-To: jhein@timing.com To: FreeBSD-gnats-submit@freebsd.org Cc: jkh@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/28274: [PATCH] for pkg_add sym link issue in isdir() in pkg_install/lib/file.c Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 28274 >Category: bin >Synopsis: [PATCH] for pkg_add to sym linked dir that is > 1 sym link deep >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 19 04:30:02 PDT 2001 >Closed-Date: >Last-Modified: >Originator: John Hein >Release: FreeBSD 4.3-RELEASE i386, and -CURRENT >Organization: Timing Solutions Corporation >Environment: System: FreeBSD brain.timing.com 4.3-RELEASE-TSC FreeBSD 4.3-RELEASE-TSC #0: Fri Jun 15 15:37:47 MDT 2001 imp@marvin.timing.com:/net/brain/uv/staging/imp/FreeBSD-tsc-4/sys/compile/BRAIN i386 System: FreeBSD bugs.timing.com 5.0-CURRENT FreeBSD 5.0-CURRENT #4: Fri Jun 8 18:36:42 MDT 2001 imp@bugs.timing.com:/net/brain/uv/staging/imp/FreeBSD-current/src/sys/compile/BUGS i386 >Description: The fix in rev 1.40 (jkh) of usr.sbin/pkg_install/lib/file.c to handle sym linked dirs doesn't catch sym links deeper than one. >How-To-Repeat: mkdir /tmp/prefix ln -s /tmp/prefix /tmp/a ln -s /tmp/a /tmp/b pkg_add -p /tmp/b some_pkg.tgz You should see something to the effect of: pkg_add: extract_plist: unable to cwd to '/tmp/b' >Fix: Follow sym link all the way to '.' (patch against -current version of the file...) $ cvs diff -u file.c Index: file.c =================================================================== RCS file: /base/FreeBSD-CVS/src/usr.sbin/pkg_install/lib/file.c,v retrieving revision 1.49 diff -u -r1.49 file.c --- file.c 2001/06/13 11:55:40 1.49 +++ file.c 2001/06/19 11:05:55 @@ -48,7 +48,7 @@ if (lstat(fname, &sb) != FAIL && S_ISDIR(sb.st_mode)) return TRUE; - else if (lstat(strconcat(fname, "/"), &sb) != FAIL && S_ISDIR(sb.st_mode)) + else if (lstat(strconcat(fname, "/."), &sb) != FAIL && S_ISDIR(sb.st_mode)) return TRUE; else return FALSE; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message