Revert "srm: add 3-pass DoD 5220.22-M."

This reverts commit de2bfa3b0b.

This was a local patch I had and accidentally committed it, so revert
it. Bump the revision as the bad commit bumped it so new builds will
be made.
This commit is contained in:
Blair Zajac
2025-09-26 00:41:15 -07:00
parent 0bdb8562dd
commit f9ee8f3341
2 changed files with 1 additions and 72 deletions
+1 -3
View File
@@ -2,7 +2,7 @@ PortSystem 1.0
name srm
version 1.2.15
revision 1
revision 2
description srm is a secure replacement for rm(1).
long_description \
srm is a secure replacement for rm(1). Unlike the standard rm, it \
@@ -24,8 +24,6 @@ master_sites sourceforge
checksums rmd160 61b674b21acf48ec837fcaf59836abdda62bc496 \
sha256 7583c1120e911e292f22b4a1d949b32c23518038afd966d527dae87c61565283
patchfiles add-3-pass-dod-5220.22-m.diff
test.run yes
post-destroot {
@@ -1,69 +0,0 @@
diff -ru ../srm-1.2.15.orig/src/main.c ./src/main.c
--- ../srm-1.2.15.orig/src/main.c 2015-02-26 08:12:02.000000000 -0800
+++ ./src/main.c 2025-06-18 20:29:15.003309604 -0700
@@ -36,6 +36,7 @@
{ "doe", no_argument, NULL, 'E'},
{ "gutmann", no_argument, NULL, 'G'},
{ "rcmp", no_argument, NULL, 'C'},
+ { "blair", no_argument, NULL, 'B'},
{ "verbose", no_argument, NULL, 'v' },
{ "help", no_argument, &show_help, 'h' },
{ "version", no_argument, &show_version, 'V' },
@@ -52,7 +53,7 @@
else
program_name = argv[0];
- while ((opt = getopt_long(argc, argv, "CdDEfGhirRPsvVx", longopts, NULL)) != -1)
+ while ((opt = getopt_long(argc, argv, "BCdDEfGhirRPsvVx", longopts, NULL)) != -1)
{
switch (opt)
{
@@ -75,6 +76,7 @@
case 'E': options &= ~SRM_MODE_MASK; options |= SRM_MODE_DOE; break;
case 'G': options &= ~SRM_MODE_MASK; options |= SRM_MODE_35; break;
case 'C': options &= ~SRM_MODE_MASK; options |= SRM_MODE_RCMP; break;
+ case 'B': options &= ~SRM_MODE_MASK; options |= SRM_MODE_BLAIR; break;
case 'V': show_version=1; break;
case 'v':
if((options & SRM_OPT_V) < SRM_OPT_V)
@@ -101,6 +103,7 @@
" -P, --openbsd overwrite with three passes like OpenBSD rm\n"
" -D, --dod overwrite with 7 US DoD compliant passes\n"
" -E, --doe overwrite with 3 US DoE compliant passes\n"
+ " -B, --blair overwrite with 3-pass DoD 5220.22-M\n"
" -G, --gutmann overwrite with 35-pass Gutmann method\n"
" -C, --rcmp overwrite with Royal Canadian Mounted Police passes\n"
" -r, -R, --recursive remove the contents of directories\n"
diff -ru ../srm-1.2.15.orig/src/srm.h ./src/srm.h
--- ../srm-1.2.15.orig/src/srm.h 2015-02-26 08:12:02.000000000 -0800
+++ ./src/srm.h 2025-06-18 18:33:12.720900992 -0700
@@ -26,9 +26,10 @@
#define SRM_MODE_35 (1 << 20)
/** RCMP overwrite mode */
#define SRM_MODE_RCMP (1 << 21)
+#define SRM_MODE_BLAIR (1 << 22)
/** bitmask of overwrite modes */
-#define SRM_MODE_MASK (SRM_MODE_SIMPLE|SRM_MODE_OPENBSD|SRM_MODE_DOD|SRM_MODE_DOE|SRM_MODE_35|SRM_MODE_RCMP)
+#define SRM_MODE_MASK (SRM_MODE_SIMPLE|SRM_MODE_OPENBSD|SRM_MODE_DOD|SRM_MODE_DOE|SRM_MODE_35|SRM_MODE_RCMP|SRM_MODE_BLAIR)
#ifdef __cplusplus
extern "C" {
diff -ru ../srm-1.2.15.orig/src/sunlink.c ./src/sunlink.c
--- ../srm-1.2.15.orig/src/sunlink.c 2015-02-26 08:12:02.000000000 -0800
+++ ./src/sunlink.c 2025-06-18 20:29:58.363383580 -0700
@@ -498,6 +498,14 @@
if(overwrite_byte(srm, 2, 0xFF) < 0) return -1;
if(overwrite_string(srm, 3, "RCMP") < 0) return -1;
}
+ else if(srm->options & SRM_MODE_BLAIR)
+ {
+ if((srm->options&SRM_OPT_V) > 1)
+ error("Blair's DoD 3-pass 5220.22-M mode");
+ if(overwrite_byte(srm, 1, 0x00) < 0) return -1;
+ if(overwrite_byte(srm, 2, 0xFF) < 0) return -1;
+ if(overwrite_random(srm, 3, 1) < 0) return -1;
+ }
else
{
if(! (srm->options & SRM_MODE_35))