From owner-freebsd-bugs Tue Mar 12 22:30:22 2002 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 8328737B41D for ; Tue, 12 Mar 2002 22:30:09 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2D6U9805878; Tue, 12 Mar 2002 22:30:09 -0800 (PST) (envelope-from gnats) Received: from aaz.links.ru (aaz.links.ru [193.125.152.37]) by hub.freebsd.org (Postfix) with ESMTP id 0FE1137B402 for ; Tue, 12 Mar 2002 22:23:12 -0800 (PST) Received: (from babolo@localhost) by aaz.links.ru (8.9.3/8.9.3) id JAA24905; Wed, 13 Mar 2002 09:31:04 +0300 (MSK) Message-Id: <200203130631.JAA24905@aaz.links.ru> Date: Wed, 13 Mar 2002 09:31:04 +0300 (MSK) From: .@babolo.ru Reply-To: .@babolo.ru To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/35842: rm -rf fails to delete nonexistent file [patch] 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: 35842 >Category: bin >Synopsis: rm -f nonexistent file successful but rm -fr is not in some conditions >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 12 22:30:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Aleksandr A. Babaylov >Release: FreeBSD 4.5-STABLE i386 >Organization: home >Environment: uname -a FreeBSD cicuta.babolo.ru 4.5-STABLE FreeBSD 4.5-STABLE #7: Thu Feb 28 06:47:27 MSK 2002 babolo@cicuta.babolo.ru:/tmp/babolo/usr/src/sys/cicuta i386 >Description: choose nonexistant file in ro mount filesystem: 0cicuta~(53)>mount | grep mnt /dev/ad4s1h on /mnt (ufs, local, read-only) 0cicuta~(54)>stat /mnt/a/e Can't lstat /mnt/a/e 2cicuta~(55)>rm -f /mnt/a/e 0cicuta~(56)>rm -fr /mnt/a/e rm: /mnt/a/e: Read-only file system 1cicuta~(57)> This affects, for example buildworld on ro mount sources. (another thing - I do non understand contrib/libgmp/mp[zfq] existanse) >How-To-Repeat: See Description >Fix: --- bin/rm/rm.c Wed Aug 1 09:15:56 2001 +++ bin/rm/rm.c Wed Mar 13 08:54:54 2002 @@ -268,6 +268,14 @@ } break; + case FTS_NS: + /* + * FTS_NS: assume that if can't stat the file, it + * can't be unlinked. + */ + if (fflag) + continue; + /* breakthrough */ default: if (Pflag) rm_overwrite(p->fts_accpath, NULL); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message