From owner-freebsd-security Tue Jul 13 5:15:28 1999 Delivered-To: freebsd-security@freebsd.org Received: from alice.gba.oz.au (gba-254.tmx.com.au [203.9.155.254]) by hub.freebsd.org (Postfix) with SMTP id 2DB8914D5A for ; Tue, 13 Jul 1999 05:15:22 -0700 (PDT) (envelope-from gjb-freebsd@gba.oz.au) Received: (qmail 5558 invoked by uid 1001); 13 Jul 1999 22:14:53 +1000 Message-ID: <19990713121453.5557.qmail@alice.gba.oz.au> X-Posted-By: GBA-Post 1.03 20-Sep-1998 X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 Date: Tue, 13 Jul 1999 22:14:52 +1000 From: Greg Black To: Wes Peters Cc: FreeBSD Security Subject: Re: Secure Deletion References: <199906250212.WAA07810@cc942873-a.ewndsr1.nj.home.com> <3773F67A.CC9B6215@softweyr.com> <19990629131529.A61249@bitbox.follo.net> <378A58EA.ACF1412F@softweyr.com> In-reply-to: <378A58EA.ACF1412F@softweyr.com> of Mon, 12 Jul 1999 15:06:50 CST Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Wes Peters writes: > Here's the source for the new, improved > version if anyone wants to test it themselves. > > Unless anyone has strenuous objections, I'll make this into a port and > commit it (as soon as I learn how to make a port). There are two things that would be good to change: Throughout, -1 is used as an error return value and that is eventually used as the program's exit value if any error occurs. Those -1 values should be changed to +1, at least for the final exit value. This is required for many reasons which I won't rehash here. If the open() fails, it might be due to read-only permissions. It would be good to attempt a chmod() to make it writeable and retry the open() before bailing out, perhaps controlled by a -f flag as used by programs like rm(1). It's possible to check the reason for the open() failure and to look at the mode of the file to verify its permissions before attempting the chmod(), although that seems superfluous here. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message