1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-30 10:28:41 +00:00

Merge pull request #4300 from Oblivionsage/fix-xz-seek-todo

Fix XZ file seek operation in hc_fseek()
This commit is contained in:
hashcat-bot 2025-07-10 18:46:37 +02:00 committed by GitHub
commit 3981f284af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -579,7 +579,18 @@ int hc_fseek (HCFILE *fp, off_t offset, int whence)
}
else if (fp->xfp)
{
/* TODO */
/* XZ files are compressed streams, seeking is limited */
if (offset == 0 && whence == SEEK_SET)
{
/* Rewind to beginning */
hc_rewind(fp);
r = 0;
}
else
{
/* Arbitrary seeking not supported for compressed XZ files */
r = -1;
}
}
return r;