1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 12:29:35 +00:00

Merge pull request #45 from philsmd/pr-rename-session-dir

this patch makes it much clearer where sessions under ~/.hashcat are located
This commit is contained in:
Jens Steube 2016-01-03 18:47:23 +01:00
commit f9999848a1
3 changed files with 7 additions and 5 deletions

View File

@ -1925,7 +1925,7 @@ void truecrypt_crc32 (char *file, unsigned char keytab[64]);
char *get_exec_path ();
char *get_install_dir (const char *progname);
char *get_profile_dir (const char *homedir);
char *get_session_dir (const char *profile_dir, const char *session);
char *get_session_dir (const char *profile_dir);
uint get_vliw_by_compute_capability (const uint major, const uint minor);
uint get_vliw_by_device_name (const char *device_name);

View File

@ -5333,7 +5333,7 @@ int main (int argc, char **argv)
const char *homedir = pw->pw_dir;
profile_dir = get_profile_dir (homedir);
session_dir = get_session_dir (profile_dir, session);
session_dir = get_session_dir (profile_dir);
shared_dir = strdup (SHARED_FOLDER);
mkdir (profile_dir, 0700);

View File

@ -4132,11 +4132,13 @@ char *get_profile_dir (const char *homedir)
return profile_dir;
}
char *get_session_dir (const char *profile_dir, const char *session)
char *get_session_dir (const char *profile_dir)
{
char *session_dir = (char *) mymalloc (strlen (profile_dir) + 1 + strlen (session) + 1);
#define SESSIONS_FOLDER "sessions"
sprintf (session_dir, "%s/%s", profile_dir, session);
char *session_dir = (char *) mymalloc (strlen (profile_dir) + 1 + strlen (SESSIONS_FOLDER) + 1);
sprintf (session_dir, "%s/%s", profile_dir, SESSIONS_FOLDER);
return session_dir;
}