1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 08:38:09 +00:00
This commit is contained in:
jsteube 2017-02-14 15:19:39 +01:00
commit 0531d41c05
5 changed files with 19 additions and 7 deletions

View File

@ -75,6 +75,7 @@
- OpenCL Kernel: Renumbered hash-mode 7600 to 4521 - OpenCL Kernel: Renumbered hash-mode 7600 to 4521
- OpenCL Device: Do a check on available constant memory size and abort if it's less than 64kB - OpenCL Device: Do a check on available constant memory size and abort if it's less than 64kB
- File Reads: Improved error detection on file reads, especially when getting the file stats - File Reads: Improved error detection on file reads, especially when getting the file stats
- File Locking: Improved error detection on file locks
- Sessions: Move out handling of multiple instance from restore file into separate pidfile - Sessions: Move out handling of multiple instance from restore file into separate pidfile
- Threads: Restored strerror as %m is unsupported by the BSDs - Threads: Restored strerror as %m is unsupported by the BSDs
- Wordlists: Disable dictstat handling for hash-mode 3000 as it virtually creates words in the wordlist which is not the case for other modes - Wordlists: Disable dictstat handling for hash-mode 3000 as it virtually creates words in the wordlist which is not the case for other modes

View File

@ -14,6 +14,6 @@
#include <fcntl.h> #include <fcntl.h>
int lock_file (FILE *fp); int lock_file (FILE *fp);
void unlock_file (FILE *fp); int unlock_file (FILE *fp);
#endif // _LOCKING_H #endif // _LOCKING_H

View File

@ -27,7 +27,7 @@ int lock_file (FILE *fp)
return 0; return 0;
} }
void unlock_file (FILE *fp) int unlock_file (FILE *fp)
{ {
struct flock lock; struct flock lock;
@ -35,7 +35,12 @@ void unlock_file (FILE *fp)
lock.l_type = F_UNLCK; lock.l_type = F_UNLCK;
fcntl (fileno (fp), F_SETLK, &lock); if (fcntl (fileno (fp), F_SETLK, &lock))
{
return -1;
}
return 0;
} }
#else #else
@ -47,7 +52,7 @@ int lock_file (MAYBE_UNUSED FILE *fp)
return 0; return 0;
} }
void unlock_file (MAYBE_UNUSED FILE *fp) int unlock_file (MAYBE_UNUSED FILE *fp)
{ {
// we should put windows specific code here // we should put windows specific code here
} }

View File

@ -163,7 +163,10 @@ void loopback_write_append (hashcat_ctx_t *hashcat_ctx, const u8 *plain_ptr, con
fflush (fp); fflush (fp);
unlock_file (fp); if (unlock_file (fp))
{
event_log_error (hashcat_ctx, "%s: Failed to unlock file", loopback_ctx->filename);
}
loopback_ctx->unused = false; loopback_ctx->unused = false;
} }

View File

@ -271,7 +271,10 @@ void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, u8 *
fflush (potfile_ctx->fp); fflush (potfile_ctx->fp);
unlock_file (potfile_ctx->fp); if (unlock_file (potfile_ctx->fp))
{
event_log_error (hashcat_ctx, "%s: Failed to unlock file", potfile_ctx->filename);
}
} }
void potfile_update_hash (hashcat_ctx_t *hashcat_ctx, hash_t *found, char *line_pw_buf, int line_pw_len) void potfile_update_hash (hashcat_ctx_t *hashcat_ctx, hash_t *found, char *line_pw_buf, int line_pw_len)