mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-25 15:10:58 +00:00
Fix potfile not closed if opened
This commit is contained in:
parent
ce0b4f571a
commit
9c7b9253e7
@ -185,10 +185,13 @@ void potfile_destroy (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
int potfile_read_open (hashcat_ctx_t *hashcat_ctx)
|
int potfile_read_open (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
|
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||||
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
|
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
|
||||||
|
|
||||||
if (potfile_ctx->enabled == false) return 0;
|
if (potfile_ctx->enabled == false) return 0;
|
||||||
|
|
||||||
|
if (hashconfig->potfile_disable == true) return 0;
|
||||||
|
|
||||||
if (hc_fopen (&potfile_ctx->fp, potfile_ctx->filename, "rb") == false)
|
if (hc_fopen (&potfile_ctx->fp, potfile_ctx->filename, "rb") == false)
|
||||||
{
|
{
|
||||||
event_log_error (hashcat_ctx, "%s: %s", potfile_ctx->filename, strerror (errno));
|
event_log_error (hashcat_ctx, "%s: %s", potfile_ctx->filename, strerror (errno));
|
||||||
@ -201,7 +204,7 @@ int potfile_read_open (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
void potfile_read_close (hashcat_ctx_t *hashcat_ctx)
|
void potfile_read_close (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||||
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
|
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
|
||||||
|
|
||||||
if (potfile_ctx->enabled == false) return;
|
if (potfile_ctx->enabled == false) return;
|
||||||
@ -215,10 +218,13 @@ void potfile_read_close (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
int potfile_write_open (hashcat_ctx_t *hashcat_ctx)
|
int potfile_write_open (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
|
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||||
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
|
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
|
||||||
|
|
||||||
if (potfile_ctx->enabled == false) return 0;
|
if (potfile_ctx->enabled == false) return 0;
|
||||||
|
|
||||||
|
if (hashconfig->potfile_disable == true) return 0;
|
||||||
|
|
||||||
if (hc_fopen (&potfile_ctx->fp, potfile_ctx->filename, "ab") == false)
|
if (hc_fopen (&potfile_ctx->fp, potfile_ctx->filename, "ab") == false)
|
||||||
{
|
{
|
||||||
event_log_error (hashcat_ctx, "%s: %s", potfile_ctx->filename, strerror (errno));
|
event_log_error (hashcat_ctx, "%s: %s", potfile_ctx->filename, strerror (errno));
|
||||||
@ -231,7 +237,7 @@ int potfile_write_open (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
void potfile_write_close (hashcat_ctx_t *hashcat_ctx)
|
void potfile_write_close (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||||
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
|
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
|
||||||
|
|
||||||
if (potfile_ctx->enabled == false) return;
|
if (potfile_ctx->enabled == false) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user