From owner-freebsd-bugs Thu Feb 13 20:30: 7 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AE3E37B401 for ; Thu, 13 Feb 2003 20:30:05 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF1D243FB1 for ; Thu, 13 Feb 2003 20:30:04 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h1E4U4NS031494 for ; Thu, 13 Feb 2003 20:30:04 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h1E4U4R3031491; Thu, 13 Feb 2003 20:30:04 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9634037B401 for ; Thu, 13 Feb 2003 20:22:21 -0800 (PST) Received: from out008.verizon.net (out008pub.verizon.net [206.46.170.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DF2F43FBD for ; Thu, 13 Feb 2003 20:22:20 -0800 (PST) (envelope-from arlankfo@verizon.net) Received: from verizon.net ([138.88.47.217]) by out008.verizon.net (InterMail vM.5.01.05.20 201-253-122-126-120-20021101) with ESMTP id <20030214042220.SJRH25811.out008.verizon.net@verizon.net> for ; Thu, 13 Feb 2003 22:22:20 -0600 Message-Id: <20030214042220.SJRH25811.out008.verizon.net@verizon.net> Date: Thu, 13 Feb 2003 23:22:11 -0500 From: arlankfo@141.com Reply-To: Andrew Lankford To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/48271: bug with find's -delete option 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: 48271 >Category: bin >Synopsis: bug with find's -delete option >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 13 20:30:00 PST 2003 >Closed-Date: >Last-Modified: >Originator: Andrew Lankford >Release: FreeBSD 5.0-CURRENT i386 >Organization: none >Environment: System: FreeBSD bogushost2 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Thu Feb 13 20:27:55 EST 2003 root@bogushost2:/usr/obj/usr/src/sys/ARL5KERNEL i386 >Description: Find's -delete option incorrectly checks for relative pathnames. >How-To-Repeat: # cd / # mkdir testdir # mkdir testdir/testdir2 # find /testdir -delete find: -delete: /testdir: relative path potentially not safe >Fix: --- /usr/src/usr.bin/find/function.c 2003/02/13 06:42:07 1.1 +++ /usr/src/usr.bin/find/function.c 2003/02/13 07:14:57 @@ -395,7 +395,7 @@ errx(1, "-delete: insecure options got turned on"); /* Potentially unsafe - do not accept relative paths whatsoever */ - if (strchr(entry->fts_accpath, '/') != NULL) + if (*(entry->fts_accpath) != '/') errx(1, "-delete: %s: relative path potentially not safe", entry->fts_accpath); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message