about summary refs log tree commit diff
diff options
context:
space:
mode:
author3JlOy_PYCCKUI <3jl0y_pycckui@riseup.net>2023-06-05 05:14:10 +0300
committer3JlOy_PYCCKUI <3jl0y_pycckui@riseup.net>2023-12-02 19:09:01 +0300
commit84c284c656c287e85cb2e653be7f206433a1a863 (patch)
treed59ac56f187be8ebf070034d191b41ceb75e0bfa
parent1535530692f36db3747ef6c7649551dece000ee7 (diff)
srm: 1.2.15 -> 1.2.15-unstable-2017-12-18
-rw-r--r--pkgs/tools/security/srm/default.nix17
-rw-r--r--pkgs/tools/security/srm/fix-output-in-verbose-mode.patch57
2 files changed, 67 insertions, 7 deletions
diff --git a/pkgs/tools/security/srm/default.nix b/pkgs/tools/security/srm/default.nix
index ba776b8af3e3f..7cde2be4fbc5f 100644
--- a/pkgs/tools/security/srm/default.nix
+++ b/pkgs/tools/security/srm/default.nix
@@ -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;
   };
-
 }
diff --git a/pkgs/tools/security/srm/fix-output-in-verbose-mode.patch b/pkgs/tools/security/srm/fix-output-in-verbose-mode.patch
new file mode 100644
index 0000000000000..966d7ba4612ea
--- /dev/null
+++ b/pkgs/tools/security/srm/fix-output-in-verbose-mode.patch
@@ -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)