Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writing zip file fails #435

Closed
ChrisAm1224 opened this issue May 19, 2024 · 2 comments
Closed

writing zip file fails #435

ChrisAm1224 opened this issue May 19, 2024 · 2 comments
Labels
bug libzip doesn't behave as expected.

Comments

@ChrisAm1224
Copy link

ChrisAm1224 commented May 19, 2024

I've just pulled the main branch and my zip writing is failing. I've tracked it down to commit ac29119 ("Don’t convert time stamps from DOS to Unix and back."). This new code in lib/zip_close.c passes st.mtime to _zip_u2d_time even when the flag ZIP_STAT_MTIME is not set:

        time_t mtime;
        if (st.valid & ZIP_STAT_MTIME) {
            mtime = st.mtime;
        }
        else {
            time(&mtime);
        }
        if (_zip_u2d_time(st.mtime, &de->last_mod, &za->error) < 0) {
            return -1;
        }

I think it should pass mtime, not st.mtime.

@ChrisAm1224 ChrisAm1224 added the bug libzip doesn't behave as expected. label May 19, 2024
0-wiz-0 added a commit that referenced this issue May 19, 2024
From ChrisAm1224 in #435.
@0-wiz-0
Copy link
Member

0-wiz-0 commented May 19, 2024

Thank you, fixed!

@0-wiz-0 0-wiz-0 closed this as completed May 19, 2024
@ChrisAm1224
Copy link
Author

Thanks for the quick fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug libzip doesn't behave as expected.
Projects
None yet
Development

No branches or pull requests

2 participants