From owner-freebsd-current Sun Jan 30 1: 2:19 2000 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 61863152CF for ; Sun, 30 Jan 2000 01:02:17 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id BAA34363; Sun, 30 Jan 2000 01:02:17 -0800 (PST) (envelope-from dillon) Date: Sun, 30 Jan 2000 01:02:17 -0800 (PST) From: Matthew Dillon Message-Id: <200001300902.BAA34363@apollo.backplane.com> To: Giorgos Keramidas Cc: Jun Kuriyama , current@FreeBSD.ORG Subject: Re: "rm -rf" behavior on readonly nfs References: <86aeloo22e.wl@localhost.sky.rim.or.jp> <20000130094043.B10414@hades.hell.gr> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :This happens on either NFS-mounted or real directories. It think that since :the manual of rm(1) says: : : -f Attempt to remove the files without prompting for confirma- : tion, regardless of the file's permissions. If the file does : not exist, do not display a diagnostic message or modify the : exit status to reflect an error. : :it ought to print nothing in such a case. Let me know if the small patch :shown below helps in correcting this. I can't check this cause I got bitten :by getflags() in(s)anity last night when I cvsup'ed. No, it should definitely print an error. If the file didn't exist it should stay silent but if the file exists and cannot be removed, that should generate an error. The -f option does not mean "silently fail", it simply means that no error message should be printed if the error is innocuous. i.e. you try to remove a file that is already removed. -Matt Matthew Dillon :The diff -u output is: : :%%% patch begins here %%% :--- /usr/src/bin/rm/rm.c Sat Jan 29 01:14:23 2000 :+++ rm.c Sun Jan 30 09:32:18 2000 :@@ -196,7 +196,9 @@ : } : continue; : case FTS_ERR: :- errx(1, "%s: %s", p->fts_path, strerror(p->fts_errno)); :+ if (!fflag) :+ errx(1, "%s: %s", p->fts_path, :+ strerror(p->fts_errno)); : case FTS_NS: : /* : * FTS_NS: assume that if can't stat the file, it :%%% patch ends here %%% : :-- :Giorgos Keramidas, < keramida @ ceid . upatras . gr > :"Don't let your schooling interfere with your education." [Mark Twain] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message