From owner-freebsd-security Tue Jul 13 15:51:40 1999 Delivered-To: freebsd-security@freebsd.org Received: from xylan.com (postal.xylan.com [208.8.0.248]) by hub.freebsd.org (Postfix) with ESMTP id BE89915088 for ; Tue, 13 Jul 1999 15:51:10 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com by xylan.com (8.8.7/SMI-SVR4 (xylan-mgw 2.2 [OUT])) id PAA10214; Tue, 13 Jul 1999 15:48:35 -0700 (PDT) Received: from omni.xylan.com by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id PAA07743; Tue, 13 Jul 1999 15:48:30 -0700 Received: from softweyr.com (dyn2.utah.xylan.com) by omni.xylan.com (4.1/SMI-4.1 (xylan engr [SPOOL])) id AA25228; Tue, 13 Jul 99 15:48:33 PDT Message-Id: <378BC241.B73DB51@softweyr.com> Date: Tue, 13 Jul 1999 16:48:33 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en Mime-Version: 1.0 To: Greg Black 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> <19990713121453.5557.qmail@alice.gba.oz.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Greg Black wrote: > > 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. Excellent suggestions. Roger Wilco. When I get it done, I'll stick it on my ftp server and post a message here, rather than emailing the source all over the planet. ;^0 -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://softweyr.com/ wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message