pentoo-overlay/net-analyzer/dirb/files/fix-bug-with-rootdir-as-home.patch
Rick Farina (Zero_Chaos) 5fa6190dd0
net-analyzer/dirb: import debian patchset
Closes: https://bugs.gentoo.org/769860

Pretty much I imported the debian patchset from
https://salsa.debian.org/pkg-security-team/dirb/-/tree/debian/master/debian/patches
Testing shows it builds and runs, I added a helpful symlink to the
default wordlist location
2021-11-22 13:03:56 -05:00

28 lines
977 B
Diff

Description: Avoid infinite recursion when HOME=/
We do this by ensuring that HOME=/root when HOME=/.
Author: Raphaël Hertzog <buxy@kali.org>
Forwarded: not-needed
Bug-Kali: https://bugs.kali.org/view.php?id=2387
diff --git a/src/resume.c b/src/resume.c
index 553d461..b52df43 100644
--- a/src/resume.c
+++ b/src/resume.c
@@ -35,6 +35,8 @@ void dump(void) {
// Comprobamos si existe el directorio y sino intentamos crealo
home = getenv("HOME");
+ if (strcmp(home, "/") == 0)
+ home = "/root";
asprintf(&dumppath,"%s/%s", home, DUMP_DIR);
asprintf(&optionspath, "%s/%s", home, OPTIONS_DUMP);
asprintf(&wordlistpath, "%s/%s", home, WORDLIST_DUMP);
@@ -106,6 +108,8 @@ void resume(void) {
resuming=1;
home = getenv("HOME");
+ if (strcmp(home, "/") == 0)
+ home = "/root";
asprintf(&dumppath,"%s/%s",home,DUMP_DIR);
asprintf(&optionspath, "%s/%s",home,OPTIONS_DUMP);
asprintf(&wordlistpath, "%s/%s",home,WORDLIST_DUMP);