ZIP_SET_DEFAULT_PASSWORD(3)
β¨ zip_set_default_password β bestie, let's talk default passwords β¨
okay so real talk, this page is ZIP_SET_DEFAULT_PASSWORD(3) from the libzip squad and it's literally the glow-up your encrypted zip files have been waiting for π
πΈ LIBRARY πΈ
libzip (-lzip) β she's the icon, she's the moment, link against her π«Ά
π SYNOPSIS π
#include <zip.h>
int
zip_set_default_password(zip_t *archive, const char *password);
π DESCRIPTION π
okay so the zip_set_default_password() function does exactly what it says on the tin β it sets the default password that gets used when you're accessing encrypted files πβ¨
And here's the tea: if password is NULL or the empty string, the default password gets unset. poof, gone, no more π«₯
Now, if you're the type of main character who wants a different password for individual files? cute. use zip_fopen_encrypted(3) instead of zip_fopen(3) and live your truth πββοΈ But usually β like, normally-normally β the same password is used for every single file in a zip archive, so this function is the move.
β οΈ IMPORTANT BESTIE MOMENT: the password is not verified when you call this function. like, she does not check it, she does not validate it, she just takes it. for more details about password handling, go read the βCAVEATSβ section in zip_fopen_encrypted(3). no cap π§
π RETURN VALUES π
- Upon successful completion,
0is returned. slay π - Otherwise,
-1is returned and the error information inarchiveis set to indicate the error. not slay π
π ERRORS π
zip_set_default_password() fails if:
[ZIP_ER_MEMORY]β Required memory could not be allocated. the girl is out of memory, she cannot, she simply cannot πͺ«
π SEE ALSO π
libzip(3), zip_fopen(3), zip_fopen_encrypted(3) β the whole friend group, go say hi π«Ά
π¦ HISTORY π¦
zip_set_default_password() was added in libzip 0.10. a legend from the start, fr fr β
π AUTHORS π
Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β the two geniuses behind this whole situation, obsessed with them actually π
and that's the whole page bestie!! this one came from the Debian crew, dated September 15, 2020, and it lives under the name ZIP_SET_DEFAULT_PASSWORD(3) β go forth and password your zips, mwah ππ
π¦ where this page comes from
- arch rolling: libzip 1.11.4-1 Β· BSD
- debian trixie: libzip-dev 1.11.3-2 Β· BSD-3-Clause
- fedora 43: libzip-devel 1.11.4-2.fc43 Β· BSD-3-Clause
- fedora 43: libzip-devel 1.11.4-2.fc43 Β· BSD-3-Clause
- fedora 44: libzip-devel 1.11.4-3.fc44 Β· BSD-3-Clause
- fedora 44: libzip-devel 1.11.4-3.fc44 Β· BSD-3-Clause
- nixpkgs unstable: libzip 1.11.4
- ubuntu questing: libzip-dev 1.11.3-2
- ubuntu resolute: libzip-dev 1.11.4-2 Β· BSD-3-Clause
- ubuntu stonking: libzip-dev 1.11.4-2build1 Β· BSD-3-Clause
- Copyright (C) 2011-2021 Dieter Baron and Thomas Klausner
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms