Skip to content

Commit

Permalink
Include patch by Karako Miklos to skip a number of patches. Also did a
Browse files Browse the repository at this point in the history
clean up of headers (remove obsolete addresses and CVS tags).
  • Loading branch information
Berke Durak committed Nov 7, 2010
1 parent e96279f commit 7e5030f
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 48 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 1,2 @@
*.o
version.h
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 104,8 @@ Sat Jun 12 19:21:01 CEST 2004
Wed Sep 20 17:32:02 CEST 2006
version 0.21 - Included Debian patch for severe bug that affected the
computation of the size of large partitions.

Sun Nov 07 09:30:10 EST 2010
version 0.22 - Include patch by Karako Miklos to skip a number of patches.
Also did a clean up of headers (remove obsolete addresses
and CVS tags).
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
# Makefile for wipe, version 0.21, by Berke Durak
# $Id: Makefile,v 1.2 2004/06/12 17:49:47 berke Exp $
# echo berke1ouvaton2org|tr 12 @.
# Makefile for wipe by Berke Durak
#
# echo berke1lambda-diode2com|tr 12 @.
#
# define HAVE_OSYNC if an O_SYNC bit can be specified for the open () call
# (see open(2))
Expand Down Expand Up @@ -153,9 153,16 @@ generic :
wipe : $(OBJECTS)
$(CC) $(CCO) $(OBJECTS) -o wipe

wipe.o : wipe.c random.h misc.h
wipe.o : wipe.c random.h misc.h version.h
$(CC) $(CCO) $(CCOC) wipe.c -o wipe.o

version.h: always
if which git >/dev/null 2>&1 ; then \
git rev-list --max-count=1 HEAD | sed -e 's/^/#define WIPE_GIT "/' -e 's/$$/"/' >version.h ; \
else \
echo '#define WIPE_GIT "(unknown, compiled without git)"' >version.h ; \
fi

random.o : random.c misc.h md5.h
$(CC) $(CCO) $(CCOC) random.c -o random.o

Expand All @@ -165,7 172,6 @@ rc6.o : rc6.c rc6.h
arcfour.o : arcfour.c arcfour.h
$(CC) $(CCO) $(CCOC) arcfour.c -o arcfour.o


md5.o : md5.c md5.h
$(CC) $(CCO) $(CCOC) md5.c -o md5.o

Expand All @@ -176,7 182,9 @@ wipe.tr-asc.1 : wipe.tr.1
./trtur <wipe.tr.1 >wipe.tr-asc.1

clean :
rm -f wipe $(OBJECTS) wipe.tr-asc.1 *~ DEADJOE core
rm -f wipe $(OBJECTS) wipe.tr-asc.1 version.h

install:
install -m755 -o root -g root wipe $(DESTDIR)/usr/bin

.PHONY: always clean install
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
wipe 0.22 by Berke Durak Mon Feb 16 2009
wipe 0.23 by Berke Durak Sun Nov 07 2009

WHAT IS WIPE ?

Expand Down
5 changes: 1 addition & 4 deletions arcfour.c
Original file line number Diff line number Diff line change
@@ -1,9 1,6 @@
/* wipe
* $Id: arcfour.c,v 1.1.1.1 2002/11/25 23:59:49 berke Exp $
*
* by Berke Durak
* Author may be contacted at 'echo berke1ouvaton2org|tr 12 @.'
*
* URL for wipe: http://abaababa.ouvaton.org/wipe/
*
* Arcfour implementation, beta.
*
Expand Down
5 changes: 1 addition & 4 deletions arcfour.h
Original file line number Diff line number Diff line change
@@ -1,9 1,6 @@
/* wipe
* $Id: arcfour.h,v 1.1.1.1 2002/11/25 23:59:49 berke Exp $
* by Berke Durak
* Author may be contacted at 'echo berke1ouvaton2org|tr 12 @.'
*
* URL for wipe: http://abaababa.ouvaton.org/wipe/
* by Berke Durak
*
* Arcfour implementation, beta.
*
Expand Down
5 changes: 1 addition & 4 deletions misc.c
Original file line number Diff line number Diff line change
@@ -1,9 1,6 @@
/* wipe
* $Id: misc.c,v 1.1.1.1 2002/11/25 23:59:49 berke Exp $
* by Berke Durak
* Author may be contacted at 'echo berke1ouvaton2org|tr 12 @.'
*
* URL for wipe: http://abaababa.ouvaton.org/wipe/
* by Berke Durak
*
* General-purpose miscellaneous routines: debugging, etc.
*
Expand Down
5 changes: 1 addition & 4 deletions misc.h
Original file line number Diff line number Diff line change
@@ -1,9 1,6 @@
/* wipe
* $Id: misc.h,v 1.1.1.1 2002/11/25 23:59:49 berke Exp $
*
* by Berke Durak
* Author may be contacted at 'echo berke1ouvaton2org|tr 12 @.'
*
* URL for wipe: http://abaababa.ouvaton.org/wipe/
*
* General-purpose miscellaneous routines: debugging, etc.
*
Expand Down
3 changes: 1 addition & 2 deletions random.c
Original file line number Diff line number Diff line change
@@ -1,7 1,6 @@
/* wipe
* $Id: random.c,v 1.1.1.1 2002/11/25 23:59:49 berke Exp $
*
* by Berke Durak
* Author may be contacted at 'echo berke1ouvaton2org|tr 12 @.'
*
* Cryptographically-strong (as well as weak) random data generation
*
Expand Down
3 changes: 1 addition & 2 deletions random.h
Original file line number Diff line number Diff line change
@@ -1,7 1,6 @@
/* wipe
* $Id: random.h,v 1.1.1.1 2002/11/25 23:59:49 berke Exp $
*
* by Berke Durak
* Author may be contacted at 'echo berke1ouvaton2org|tr 12 @.'
*
* Header file for cryptographically-strong (as well as weak)
* random data generation routines
Expand Down
6 changes: 3 additions & 3 deletions wipe.1
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
.TH WIPE 1 "Wed Sep 20 17:32:02 CEST 2006" "Linu" "User Commands"
.TH WIPE 1 "Sun Nov 7 09:41:23 EST 2010" "Linux" "User Commands"
.SH NAME
wipe \- securely erase files from magnetic media
.SH SYNOPSIS
Expand All @@ -8,10 8,10 @@ wipe [options] path1 path2 ... pathn

.SH "CURRENT\-VERSION"
This manual page describes version
.B 0.21
.B 0.22
of
.B wipe
, released September 2006.
, released November 2010.


.SH DESCRIPTION
Expand Down
61 changes: 43 additions & 18 deletions wipe.c
Original file line number Diff line number Diff line change
@@ -1,9 1,20 @@
/* wipe
* $Id: wipe.c,v 1.2 2004/06/12 17:49:47 berke Exp $
*
* by Berke Durak
* Author may be contacted at 'echo berke1ouvaton2org|tr 12 @.'
*
* URL for wipe: http://abaababa.ouvaton.org/wipe/
* With many thanks to the following contributors:
* Jason Axley
* Alexey Marinichev
* Chris L. Mason
* Karako Miklos
* Jim Paris
* Thomas Schoepf
*
* Author may be contacted at 'echo berke1lambda-diode|com 12 @.'
*
* URL for wipe: http://lambda-diode.com/software/wipe
* Git repository: http://github.com/berke/wipe
* git clone https://github.com/berke/wipe.git
*
* Securely erase files from magnetic media
* Based on data from article "Secure Deletion of Data from Magnetic
Expand All @@ -13,8 24,8 @@

/*** defines */

#define WIPE_VERSION "0.21"
#define WIPE_DATE "2006-09-20"
#define WIPE_VERSION "0.22"
#define WIPE_DATE "2010-11-07"
#define WIPE_CVS "$Id: wipe.c,v 1.2 2004/06/12 17:49:47 berke Exp $"

/* exit codes */
Expand Down Expand Up @@ -77,9 88,9 @@
#include <sys/types.h>
#include <sys/ioctl.h>


#include "random.h"
#include "misc.h"
#include "version.h"

/* includes ***/

Expand Down Expand Up @@ -141,6 152,7 @@ int o_recurse = 0;
int o_dereference_symlinks = 0;
int o_quick = 0;
int o_quick_passes = QUICKPASSES;
int o_quick_passes_set = 0;
int o_verbose = 0;
int o_silent = 0;
char *o_devrandom = DEVRANDOM;
Expand All @@ -158,6 170,7 @@ int o_lg2_buffer_size = BUFLG2;
int o_buffer_size = 1<<BUFLG2;
int o_wipe_length_set = 0;
int o_wipe_exact_size = 0;
int o_skip_passes = 0;

/* End of Options ***/

Expand Down Expand Up @@ -906,9 919,13 @@ static int dothejob (char *fn)
debugf ("buffers_to_wipe = %d, o_buffer_size = %d, wi.n_passes = %d",
buffers_to_wipe, o_buffer_size, wi.n_passes);

if (o_skip_passes > 0) {
printf ("\rSkip first %d pass(es)\n", o_skip_passes);
}

/* do the passes */
eta_begin();
for (i = 0; i<wi.n_passes; i ) {
for (i = o_skip_passes; i<wi.n_passes; i ) {
ssize_t wr;

if (!o_silent) {
Expand Down Expand Up @@ -1199,21 1216,20 @@ void banner ()
{
fprintf (stderr, "This is wipe version " WIPE_VERSION ".\n"
"\n"
"Author: Berke Durak.\n"
"Author's e-mail address: echo berke1ouvaton2org|tr 12 @.\n"
"Web site: http://abaababa.ouvaton.org/wipe/\n"
"\n"
"Release date: " WIPE_DATE "\n"
"Compiled: " __DATE__ "\n"
"CVS stuff: " WIPE_CVS "\n"
"Author: Berke Durak.\n"
"Author's e-mail address: echo berke1lambda-diode2com|tr 12 @.\n"
"Web site: http://lambda-diode.com/software/wipe/\n"
"Release date: " WIPE_DATE "\n"
"Compiled: " __DATE__ "\n"
"Git version: " WIPE_GIT "\n"
"\n"
"Based on data from \"Secure Deletion of Data from Magnetic and Solid-State\n"
"Memory\" by Peter Gutmann <[email protected]>.\n");
}

/* banner ***/

#define OPTSTR "DfhvrqspciR:S:M:kFZl:o:b:Q:T:P:e"
#define OPTSTR "X:DfhvrqspciR:S:M:kFZl:o:b:Q:T:P:e"

/*** reject and usage */

Expand Down Expand Up @@ -1272,7 1288,8 @@ void usage (void)
"\t\t-T <tries> Set maximum number of tries for free\n"
"\t\t\tfilename search; default is 10\n"
"\t\t-v Show version information\n"
"\t\t-Z Do not attempt to wipe file size\n",
"\t\t-Z Do not attempt to wipe file size\n"
"\t\t-X <number> Skip this number of passes (useful for continuing a wiping operation)\n",
progname
);

Expand Down Expand Up @@ -1351,6 1368,11 @@ int main (int argc, char **argv)
if (c<0) break;

switch (c) {
case 'X': o_skip_passes = atoi(optarg);
if (o_skip_passes <= 0) {
reject ("number of skipped passes must be strictly positive");
}
break;
case 'c': o_dochmod = 1; break;
case 'D': o_dereference_symlinks = 1; break;
case 'e': o_wipe_exact_size = 1; break;
Expand Down Expand Up @@ -1395,8 1417,7 @@ int main (int argc, char **argv)
}
break;
case 'Q': o_quick_passes = atoi (optarg);
if (o_quick_passes <= 0)
reject ("number of quick passes must be strictly positive");
o_quick_passes_set = 1;
break;
case 'S':
if (optarg[1])
Expand Down Expand Up @@ -1439,6 1460,10 @@ int main (int argc, char **argv)
}
}

if (o_quick_passes_set && !o_quick) {
reject ("option -Q useless without -q");
}

if (optind >= argc) reject ("wrong number of arguments");

if (o_recurse && o_dereference_symlinks) reject ("options -D and -r are mutually exclusive");
Expand Down

0 comments on commit 7e5030f

Please sign in to comment.