-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Summary
John the Ripper currently hardcodes ~/.john as the per-user “home” (JOHN_PRIVATE_HOME in params.h), with $JOHN as a partial override. This setup does not comply with the XDG Base Directory Specification and gives users little flexibility in where files are stored.
The problem is not whether to default to ~/.john or to XDG — it’s that the path is compiled in and not fully user-configurable.
Proposal
Introduce a new environment variable (e.g. JOHN_HOME) that defines the base directory for all user-specific files (config, pot, session, recovery, etc).
This would allow:
JOHN_HOME=$XDG_DATA_HOME/johnJOHN_HOME=$HOME/.local/state/johnJOHN_HOME=$HOME/.john(legacy)
In other words, users control the layout without recompiling or symlink hacks.
Additionally:
- Preserve the current behavior if
JOHN_HOMEis unset (fall back to~/.john).
Benefits
-
User Choice: Users who want strict XDG compliance can set it in their shell profile. Those who prefer the legacy layout don’t need to change anything.
-
Distribution-friendly: Packagers (Arch, Debian, etc.) can enable XDG layouts without patching
params.h. -
No breakage: Existing scripts and installs continue to work unchanged.
-
Simple to implement: Replace the constant
JOHN_PRIVATE_HOMEwith a getenv() check, e.g.:const char *john_home = getenv("JOHN_HOME"); if (!john_home) john_home = "~/.john";