Bugtraq mailing list archives

Re: Shred v1.0 Fix


From: Jeff Harlan <Jeff.Harlan () MAIL SPRINT COM>
Date: Wed, 11 Oct 2000 12:02:48 -0700

Here's a great example of asking for advice and
not waiting for it.  Many thanks to Wietse.  The
attached code no longer requires the dummy call
to overwrite() as in my first attempt.  This new
version calls fflush() then fsync() before the
call to fclose().

Jeff

Jeff Harlan wrote:

Greetings,

Since the Shred package is no longer supported
I threw this patch together.  Thanks for input
from Wietse Venema and GünthER H. Leber.

This version of shred.c works with my RedHat 6.0
machine, but that's the only warranty I'm offering.

Changes are noted in the comments.  To use replace
shred.c in the original Shred 1.0 distribution with
the attached shred.c and type make.

Here's output from testing the new shred program:

[root shred]# ls -il shred.me
1464474 -rw-rw-r--   1 root     root           16 Oct 11 10:44 shred.me
[root shred]# icat /dev/hda5 1464474
shred this file
[root shred]# ./shred shred.me

Are you sure you want to delete shred.me? y

1000 bytes have been overwritten.
The file shred.me has been destroyed!

[root shred]# icat /dev/hda5 1464474 | od -x
0000000 1b6d 3d32 6637 5e27 4934 4352 2819 342c
0000020 7076 7603 573a 7a23 6502 0035 182c 190f
0000040 4133 6a56 7d27 5b48 1a47 601e 4a42 3915
0000060 183a 742f 526f 716f 2437 6371 003c 707c
0000100 5341 685a 2350 1743 613d 0078 0d2b 6539
0000120 6825 145a 493a 7205 766d 2955 5277 3819
... (more pseudorandom data)

Jeff

jeff.harlan () mail sprint com

  ----------------------------------------------------------------------------------------------------
              Name: shred.c
   shred.c    Type: unspecified type (application/octet-stream)
          Encoding: base64

Attachment: shred.c
Description:


Current thread: