Skip to content

reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities

feat(01-02): wire _check_disk_mid_run into start_func + end_func boundaries

six2dezf205abf4aa6a
diff --git a/modules/core.sh b/modules/core.sh
index 68a8b68..a651108 100644
--- a/modules/core.sh
+++ b/modules/core.sh
@@ -1417,6 +1417,9 @@ function sendToNotify {
}
function start_func() {
+ # Mid-run disk-full guard (D-07/D-09): abort BEFORE any state write so the
+ # Plan 01-01 EXIT trap clears .inprogress_* with no orphan for this function.
+ _check_disk_mid_run || _abort_disk_full
local current_date
current_date=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$current_date] Start function: ${1} " >>"${LOGFILE}"
@@ -1542,6 +1545,11 @@ function end_func() {
ui_log_jsonl "SUCCESS" "${fn}" "Function completed" "runtime=${runtime}" "duration_sec=${duration}"
fi
+ # Post-checkpoint disk guard (D-07/D-09): runs AFTER .<fn> and .status_<fn>
+ # are durably written so the completed function leaves a full success record;
+ # abort here protects the NEXT function from running with no headroom.
+ _check_disk_mid_run || _abort_disk_full
+
:
}
diff --git a/tests/unit/test_verbosity.bats b/tests/unit/test_verbosity.bats
index 616c176..6e3ebc1 100644
--- a/tests/unit/test_verbosity.bats
+++ b/tests/unit/test_verbosity.bats
@@ -36,6 +36,9 @@ setup() {
getElapsedTime() { runtime="0s"; }
record_func_timing() { :; }
log_json() { :; }
+ # Stubs for disk-full guard helpers (Plan 01-02) sourced from modules/utils.sh
+ _check_disk_mid_run() { return 0; }
+ _abort_disk_full() { return 0; }
# Source common.sh (skip re-source guard)
_COMMON_SH_LOADED=""