Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

17
sysutils/wipe/DESCR Normal file
View File

@@ -0,0 +1,17 @@
Wipe is a secure file wiping utility.
There are some low level issues that must be taken into consideration.
One of these is that there must be some sort of write barrier between
passes. Wipe uses fdatasync(2) (or fsync(2)) as a write barrier, or
if fsync(2) isn't available, the file is opened with the O_DSYNC or
O_SYNC flag. For wipe to be effective, each pass must be completely
written. To ensure this, the drive must support some form of a write
barrier, write cache flush, or write cache disabling. SCSI supports
ordered command tags, has a force media access bit for commands, and
write cache can be disable on mode page 8. IDE/ATA drives support
write cache flushes and write cache disabling.
Unfortunately, not all drives actually disable write cache when asked
to. Those drives are broken. Write caching should always be
disabled, unless your system is battery backed and always powers down
cleanly.

18
sysutils/wipe/Makefile Normal file
View File

@@ -0,0 +1,18 @@
# $NetBSD: Makefile,v 1.6 2012/10/23 19:51:34 asau Exp $
#
DISTNAME= wipe-2.2.0
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=wipe/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://wipe.sourceforge.net/
COMMENT= Secure data destruction
LICENSE= gnu-gpl-v2
PKG_INSTALLATION_TYPES= overwrite pkgviews
GNU_CONFIGURE= yes
.include "../../mk/bsd.pkg.mk"

10
sysutils/wipe/PLIST Normal file
View File

@@ -0,0 +1,10 @@
@comment $NetBSD: PLIST,v 1.2 2009/06/14 18:16:20 joerg Exp $
bin/wipe
man/man1/wipe.1
share/doc/wipe/CHANGES
share/doc/wipe/INSTALL
share/doc/wipe/LICENSE
share/doc/wipe/README
share/doc/wipe/TESTING
share/doc/wipe/TODO
share/doc/wipe/copyright

13
sysutils/wipe/distinfo Normal file
View File

@@ -0,0 +1,13 @@
$NetBSD: distinfo,v 1.7 2013/06/17 06:09:06 dholland Exp $
SHA1 (wipe-2.2.0.tar.bz2) = 4dd18f260ecd91b726336b2788fa33db04d6691a
RMD160 (wipe-2.2.0.tar.bz2) = 5d1861bd893e01e94205a7ac2efadb1c756da700
Size (wipe-2.2.0.tar.bz2) = 70134 bytes
SHA1 (patch-aa) = 4d84f400528b88f376a374f159b72da4237f3b33
SHA1 (patch-ab) = 3116ad02dd0a3514afec440e46ab679395e4bbaa
SHA1 (patch-ac) = df59d51a7ee781fd439db1bf2284fb34e26fb8fb
SHA1 (patch-ad) = 6288118d9b4a70844bbc94a8e9dc4748fc9459f8
SHA1 (patch-ae) = e1145c395a9b0999d7fbf8a4cb79f1dc89aa29e1
SHA1 (patch-af) = 23102dea6f821791d5b3bd2bb509c38ab6bf2a16
SHA1 (patch-ag) = fd61d6b065eb22cabb697f2df073a3b9efde26a9
SHA1 (patch-ah) = 362b9f59453baa4d8632d895a2f3a530ba9ca652

View File

@@ -0,0 +1,27 @@
$NetBSD: patch-aa,v 1.2 2010/01/27 20:37:48 joerg Exp $
--- Makefile.in.orig 2003-08-30 20:18:03.000000000 -0500
+++ Makefile.in
@@ -57,15 +57,15 @@ info: $(BIN_OUT)
@ldd $(BIN_OUT)
install: $(BIN_OUT)
- $(INSTALL_BIN) -d $(bindir)
- $(INSTALL_BIN) -s $(BIN_OUT) $(bindir)
- $(INSTALL) -d $(mandir)/man1
- $(INSTALL) -o root -m 0644 wipe.1 $(mandir)/man1/
+ $(BSD_INSTALL_PROGRAM_DIR) ${DESTDIR}$(bindir)
+ $(BSD_INSTALL_PROGRAM) $(BIN_OUT) ${DESTDIR}$(bindir)
+ $(BSD_INSTALL_MAN_DIR) ${DESTDIR}$(mandir)/man1
+ $(BSD_INSTALL_MAN) wipe.1 ${DESTDIR}$(mandir)/man1/
- rm -rf $(datadir)/doc/wipe*
+ rm -rf ${DESTDIR}$(datadir)/doc/wipe*
- $(INSTALL) -d $(datadir)/doc/wipe
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(datadir)/doc/wipe
for file in $(DOCS); do \
- $(INSTALL) -o root -m 0644 $$file $(datadir)/doc/wipe/; \
+ $(BSD_INSTALL_DATA) $$file ${DESTDIR}$(datadir)/doc/wipe/; \
done
install_home: $(BIN_OUT)

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ab,v 1.1 2005/11/10 16:31:25 joerg Exp $
--- main.c.orig 2005-11-10 16:11:18.000000000 +0000
+++ main.c
@@ -49,8 +49,6 @@
char *argvzero;
int exit_code;
-extern int errno;
-
struct opt_s options; /* cmd line options */
public int main(int argc, char **argv)

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-ac,v 1.1 2005/11/10 16:31:25 joerg Exp $
--- wipe.c.orig 2005-11-10 16:11:51.000000000 +0000
+++ wipe.c
@@ -55,7 +55,6 @@
#include "rand.h"
#include "wipe.h"
-extern int errno;
extern int exit_code;
extern char *argvzero;
extern struct opt_s options;

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ad,v 1.1 2005/11/10 16:31:25 joerg Exp $
--- rand.c.orig 2005-11-10 16:13:03.000000000 +0000
+++ rand.c
@@ -35,7 +35,7 @@
#include "rand.h"
extern char *argvzero;
-extern int errno, exit_code;
+extern int exit_code;
extern struct opt_s options;
int entropyfd;

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-ae,v 1.1 2005/11/10 16:31:25 joerg Exp $
--- dir.c.orig 2005-11-10 16:13:27.000000000 +0000
+++ dir.c
@@ -46,7 +46,6 @@
#include "io.h"
#include "dir.h"
-extern int errno;
extern int exit_code;
extern char *argvzero;
extern struct opt_s options;

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-af,v 1.1 2005/11/10 16:31:25 joerg Exp $
--- file.c.orig 2005-11-10 16:13:33.000000000 +0000
+++ file.c
@@ -43,7 +43,6 @@
#include "prompt.h"
#include "wipe.h"
-extern int errno;
extern int exit_code;
extern char *argvzero;

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-ag,v 1.1 2005/11/10 16:31:25 joerg Exp $
--- io.c.orig 2005-11-10 16:13:36.000000000 +0000
+++ io.c
@@ -42,7 +42,6 @@
#include "main.h"
#include "io.h"
-extern int errno;
extern int exit_code;
extern char *argvzero;
extern struct opt_s options;

View File

@@ -0,0 +1,117 @@
$NetBSD: patch-ah,v 1.3 2013/06/17 06:09:06 dholland Exp $
- Don't declare own errno.
- DragonFly BSD's partinfo is not the standard BSD partinfo.
- NetBSD no longer supports the partinfo ioctl. Use the
available alternatives, which is kind of messy.
--- blkdev.c.orig 2003-08-03 23:07:29.000000000 +0000
+++ blkdev.c
@@ -44,10 +44,20 @@
# endif
#endif
+#if defined(__DragonFly__)
+# include <sys/diskslice.h>
+# define BSD_BLKDEV
+#elif defined(__NetBSD__)
+# include <sys/disklabel.h>
+# include <sys/disk.h>
+# include <sys/param.h> /* for DEV_BSIZE, XXX */
+# define BSD_BLKDEV
+#else
#ifdef HAVE_SYS_DISKLABEL_H
# include <sys/disklabel.h>
# define BSD_BLKDEV
#endif
+#endif
#ifndef LINUX_BLKDEV
# ifndef BSD_BLKDEV
@@ -63,7 +73,6 @@
#include "wipe.h"
#include "blkdev.h"
-extern int errno;
extern int exit_code;
extern char *argvzero;
extern struct opt_s options;
@@ -128,7 +137,13 @@ public int destroy_blkdev(struct file_s
int code;
#ifdef BSD_BLKDEV
+#ifdef DIOCGPART
struct partinfo pinfo;
+#else
+ struct disklabel lab;
+ struct dkwedge_info dkw;
+ int use_dkw;
+#endif
#endif
#ifdef NO_BLKDEV
@@ -160,12 +175,26 @@ public int destroy_blkdev(struct file_s
}
#ifdef BSD_BLKDEV
+# ifdef DIOCGPART
if (ioctl(f->fd, DIOCGPART, &pinfo))
{
fprintf(stderr, "\r%s: ioctl failed, can't get disklabel for `%s': %s\n",
argvzero, f->name, strerror(errno));
exit_code = errno; return FAILED;
}
+# else
+ if (ioctl(f->fd, DIOCGDINFO, &lab) == 0) {
+ use_dkw = 0;
+ }
+ else if (ioctl(f->fd, DIOCGWEDGEINFO, &dkw) == 0) {
+ use_dkw = 1;
+ }
+ else {
+ fprintf(stderr, "\r%s: ioctl failed, can't get disklabel for `%s': %s\n",
+ argvzero, f->name, strerror(errno));
+ exit_code = errno; return FAILED;
+ }
+# endif
#endif
if (options.sectors == 0)
@@ -182,15 +211,35 @@ public int destroy_blkdev(struct file_s
options.sectors = tmp;
#endif
-#ifdef BSD_BLKDEV
+#if defined(BSD_BLKDEV)
+# if defined(__DragonFly__)
+ options.sectors = pinfo.media_blocks;
+# else
+# if defined(DIOCGPART)
options.sectors = pinfo.part->p_size;
+# else
+ options.sectors = use_dkw ?
+ dkw.dkw_size : lab.d_partitions[DISKPART(f->st.st_rdev)].p_size;
+# endif
+# endif
#endif
}
if (options.sector_size == 0)
{
-#ifdef BSD_BLKDEV
+#if defined(__DragonFly__)
+ options.sector_size = pinfo.media_blocks;
+#elif defined(BSD_BLKDEV)
+# if defined(DIOCGPART)
options.sector_size = pinfo.disklab->d_secsize;
+# else
+ /*
+ * XXX: we ought to use DIOCGDISKINFO to get the sector size,
+ * but that requires proplib and probably 500+ lines of code.
+ * So punt and use DEV_BSIZE...
+ */
+ options.sector_size = use_dkw ? DEV_BSIZE : lab.d_secsize;
+# endif
#else
options.sector_size = SECTOR_SIZE;
#endif