mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-11 00:01:16 +00:00
use XDG_DATA_HOME for profile_dir
This commit is contained in:
parent
918a621506
commit
8d78815767
2
BUILD.md
2
BUILD.md
@ -31,7 +31,7 @@ The install target is linux FHS compatible and can be used like this:
|
|||||||
$ make install
|
$ make install
|
||||||
```
|
```
|
||||||
|
|
||||||
If you install it, cached kernels, session files, restore- and pot-files etc. will go to $HOME/.hashcat/
|
If you install it, cached kernels, session files, restore- and pot-files etc. will go to either $HOME/.hashcat/, if that already exists, otherwise to $XDG_DATA_HOME/hashcat/ or ~/.local/share/hashcat/, if that environment variable is not set.
|
||||||
|
|
||||||
|
|
||||||
### Building hashcat for Windows (using Windows Subsystem for Linux) ###
|
### Building hashcat for Windows (using Windows Subsystem for Linux) ###
|
||||||
|
@ -93,6 +93,15 @@ static void get_install_dir (char *install_dir, const char *exec_path)
|
|||||||
static void get_profile_dir (char *profile_dir, const char *home_dir)
|
static void get_profile_dir (char *profile_dir, const char *home_dir)
|
||||||
{
|
{
|
||||||
snprintf (profile_dir, HCBUFSIZ_TINY, "%s/%s", home_dir, DOT_HASHCAT);
|
snprintf (profile_dir, HCBUFSIZ_TINY, "%s/%s", home_dir, DOT_HASHCAT);
|
||||||
|
struct stat st = {0};
|
||||||
|
if (stat(profile_dir, &st) == 0 && S_ISDIR(st.st_mode))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (getenv("XDG_DATA_HOME")) {
|
||||||
|
snprintf(profile_dir, HCBUFSIZ_TINY, "%s/hashcat", getenv("XDG_DATA_HOME"));
|
||||||
|
} else {
|
||||||
|
snprintf(profile_dir, HCBUFSIZ_TINY, "%s/.local/share/hashcat", home_dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_session_dir (char *session_dir, const char *profile_dir)
|
static void get_session_dir (char *session_dir, const char *profile_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user