From owner-freebsd-bugs Tue Nov 26 4:20: 4 2002 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 58D6337B401 for ; Tue, 26 Nov 2002 04:20:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83FC243EA9 for ; Tue, 26 Nov 2002 04:20:01 -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 gAQCK1x3043101 for ; Tue, 26 Nov 2002 04:20:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gAQCK1pR043100; Tue, 26 Nov 2002 04:20:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5882D37B401 for ; Tue, 26 Nov 2002 04:12:39 -0800 (PST) Received: from 61-27-47-65.home.ne.jp (61-27-47-65.home.ne.jp [61.27.47.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11E1643E9C for ; Tue, 26 Nov 2002 04:12:38 -0800 (PST) (envelope-from shinra@61-27-47-65.home.ne.jp) Received: from 61-27-47-65.home.ne.jp (localhost [127.0.0.1]) by 61-27-47-65.home.ne.jp (8.12.6/8.12.6) with ESMTP id gAQCCVI6002593 for ; Tue, 26 Nov 2002 21:12:31 +0900 (JST) (envelope-from shinra@61-27-47-65.home.ne.jp) Received: (from shinra@localhost) by 61-27-47-65.home.ne.jp (8.12.6/8.12.6/Submit) id gAQCCUqp002592; Tue, 26 Nov 2002 21:12:30 +0900 (JST) (envelope-from shinra) Message-Id: <200211261212.gAQCCUqp002592@61-27-47-65.home.ne.jp> Date: Tue, 26 Nov 2002 21:12:30 +0900 (JST) From: AIDA Shinra Reply-To: AIDA Shinra To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/45749: [PATCH] rm -f in MS-DOS directory 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: 45749 >Category: bin >Synopsis: [PATCH] rm -f in MS-DOS directory >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 Nov 26 04:20:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: AIDA Shinra >Release: FreeBSD 4.7-STABLE i386 >Organization: >Environment: System: FreeBSD e-note 4.7-STABLE FreeBSD 4.7-STABLE #2: Thu Nov 21 16:44:44 JST 2002 shinra@e-note:/usr/obj/usr/freebsd/src/sys/LOCAL i386 >Description: For stat(), unlink() and others with an invalid filename fails with EINVAL on msdosfs, rm(1) can't ignore such an argument even if -f is specified. This means many usual commands such as "rm -f *.c" in empty directory fails in "Invalid argument". >How-To-Repeat: >Fix: Ignore EINVAL in addition to ENOENT. diff -u -r1.1.1.2 -r1.3 --- rm.c 20 Jul 2002 11:31:00 -0000 1.1.1.2 +++ rm.c 26 Nov 2002 11:30:19 -0000 1.3 @@ -202,7 +202,8 @@ */ if (!needstat) break; - if (!fflag || p->fts_errno != ENOENT) { + if (!fflag || (p->fts_errno != ENOENT + && p->fts_errno != EINVAL)) { warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); eval = 1; @@ -271,7 +272,9 @@ if (Pflag) rm_overwrite(p->fts_accpath, NULL); rval = unlink(p->fts_accpath); - if (rval == 0 || (fflag && errno == ENOENT)) { + if (rval == 0 || + (fflag && (errno == ENOENT + || errno == EINVAL))) { if (rval == 0 && vflag) (void)printf("%s\n", p->fts_path); @@ -304,7 +307,8 @@ if (Wflag) { sb.st_mode = S_IFWHT|S_IWUSR|S_IRUSR; } else { - if (!fflag || errno != ENOENT) { + if (!fflag || (errno != ENOENT + && errno != EINVAL)) { warn("%s", f); eval = 1; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message