mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-12 00:33:10 +00:00
Merge pull request #236001 from 3JlOy-PYCCKUi/srm
srm: 1.2.15 -> 1.2.15-unstable-2017-12-18
This commit is contained in:
commit
404931d2a6
@ -1,14 +1,18 @@
|
||||
{ lib, stdenv, fetchurl }:
|
||||
{ lib, stdenv, fetchsvn, autoreconfHook }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation {
|
||||
pname = "srm";
|
||||
version = "1.2.15";
|
||||
version = "1.2.15-unstable-2017-12-18";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/project/srm/${version}/srm-${version}.tar.gz";
|
||||
sha256 = "10sjarhprs6s4zandndg720528rcnd4xk8dl48pjj7li1q9c30vm";
|
||||
src = fetchsvn {
|
||||
url = "svn://svn.code.sf.net/p/srm/srm/trunk/";
|
||||
rev = "268";
|
||||
sha256 = "sha256-bY8p6IS5zeByoe/uTmvBAaBN4Wu7J19dVSpbtqx4OeQ=";
|
||||
};
|
||||
|
||||
patches = [ ./fix-output-in-verbose-mode.patch ];
|
||||
nativeBuildInputs = [ autoreconfHook ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Delete files securely";
|
||||
longDescription = ''
|
||||
@ -22,5 +26,4 @@ stdenv.mkDerivation rec {
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
|
||||
}
|
||||
|
57
pkgs/tools/security/srm/fix-output-in-verbose-mode.patch
Normal file
57
pkgs/tools/security/srm/fix-output-in-verbose-mode.patch
Normal file
@ -0,0 +1,57 @@
|
||||
diff --git a/src/sunlink.c b/src/sunlink.c
|
||||
index 7050713..ffcb8d3 100644
|
||||
--- a/src/sunlink.c
|
||||
+++ b/src/sunlink.c
|
||||
@@ -468,6 +468,8 @@ static int overwrite_selector(struct srm_target *srm)
|
||||
if(overwrite_byte(srm, 5, 0x00) < 0) return -1;
|
||||
if(overwrite_byte(srm, 6, 0xFF) < 0) return -1;
|
||||
if(overwrite_random(srm, 7, 1) < 0) return -1;
|
||||
+ if((srm->options&SRM_OPT_V) > 1)
|
||||
+ printf("\n");
|
||||
}
|
||||
else if(srm->options & SRM_MODE_DOE)
|
||||
{
|
||||
@@ -475,6 +477,8 @@ static int overwrite_selector(struct srm_target *srm)
|
||||
error("US DoE mode");
|
||||
if(overwrite_random(srm, 1, 2) < 0) return -1;
|
||||
if(overwrite_bytes(srm, 3, 'D', 'o', 'E') < 0) return -1;
|
||||
+ if((srm->options&SRM_OPT_V) > 1)
|
||||
+ printf("\n");
|
||||
}
|
||||
else if(srm->options & SRM_MODE_OPENBSD)
|
||||
{
|
||||
@@ -483,12 +487,16 @@ static int overwrite_selector(struct srm_target *srm)
|
||||
if(overwrite_byte(srm, 1, 0xFF) < 0) return -1;
|
||||
if(overwrite_byte(srm, 2, 0x00) < 0) return -1;
|
||||
if(overwrite_byte(srm, 3, 0xFF) < 0) return -1;
|
||||
+ if((srm->options&SRM_OPT_V) > 1)
|
||||
+ printf("\n");
|
||||
}
|
||||
else if(srm->options & SRM_MODE_SIMPLE)
|
||||
{
|
||||
if((srm->options&SRM_OPT_V) > 1)
|
||||
error("Simple mode");
|
||||
if(overwrite_byte(srm, 1, 0x00) < 0) return -1;
|
||||
+ if((srm->options&SRM_OPT_V) > 1)
|
||||
+ printf("\n");
|
||||
}
|
||||
else if(srm->options & SRM_MODE_RCMP)
|
||||
{
|
||||
@@ -497,6 +505,8 @@ static int overwrite_selector(struct srm_target *srm)
|
||||
if(overwrite_byte(srm, 1, 0x00) < 0) return -1;
|
||||
if(overwrite_byte(srm, 2, 0xFF) < 0) return -1;
|
||||
if(overwrite_string(srm, 3, "RCMP") < 0) return -1;
|
||||
+ if((srm->options&SRM_OPT_V) > 1)
|
||||
+ printf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -535,6 +545,8 @@ static int overwrite_selector(struct srm_target *srm)
|
||||
if(overwrite_random(srm, 32, 4) < 0) return -1;
|
||||
/* if you want to backup your partition or shrink your vmware image having the file zero-ed gives best compression results. */
|
||||
if(overwrite_byte(srm, 36, 0x00) < 0) return -1;
|
||||
+ if((srm->options&SRM_OPT_V) > 1)
|
||||
+ printf("\n");
|
||||
}
|
||||
#if 0
|
||||
if((srm->options & SRM_OPT_V) > 1)
|
Loading…
Reference in New Issue
Block a user