force persistent and deferred also for tools

This commit is contained in:
vanhauser-thc
2022-02-05 07:25:12 +01:00
parent 9eb66cccf4
commit 04d693721b
3 changed files with 6 additions and 3 deletions

View File

@ -63,7 +63,8 @@ u32 check_binary_signatures(u8 *fn) {
if (f_data == MAP_FAILED) { PFATAL("Unable to mmap file '%s'", fn); }
close(fd);
if (memmem(f_data, f_len, PERSIST_SIG, strlen(PERSIST_SIG) + 1)) {
if (memmem(f_data, f_len, PERSIST_SIG, strlen(PERSIST_SIG) + 1) ||
getenv(PERSIST_ENV_VAR)) {
if (!be_quiet) { OKF(cPIN "Persistent mode binary detected."); }
setenv(PERSIST_ENV_VAR, "1", 1);
@ -90,7 +91,8 @@ u32 check_binary_signatures(u8 *fn) {
}
if (memmem(f_data, f_len, DEFER_SIG, strlen(DEFER_SIG) + 1)) {
if (memmem(f_data, f_len, DEFER_SIG, strlen(DEFER_SIG) + 1) ||
getenv(DEFER_ENV_VAR)) {
if (!be_quiet) { OKF(cPIN "Deferred forkserver binary detected."); }
setenv(DEFER_ENV_VAR, "1", 1);