1ZIP_SET_DEFAULT_PASSW... BSD Library Functions Manual ZIP_SET_DEFAULT_PASSW...
2

NAME

4     zip_set_default_password — set default password for encrypted files in
5     zip
6

LIBRARY

8     libzip (-lzip)
9

SYNOPSIS

11     #include <zip.h>
12
13     int
14     zip_set_default_password(zip_t *archive, const char *password);
15

DESCRIPTION

17     The zip_set_default_password() function sets the default password used
18     when accessing encrypted files.  If password is NULL or the empty string,
19     the default password is unset.
20
21     If you prefer a different password for single files, use
22     zip_fopen_encrypted(3) instead of zip_fopen(3).  Usually, however, the
23     same password is used for every file in an zip archive.
24
25     The password is not verified when calling this function.  See the CAVEATS
26     section in zip_fopen_encrypted(3) for more details about password han‐
27     dling.
28

RETURN VALUES

30     Upon successful completion 0 is returned.  Otherwise, -1 is returned and
31     the error information in archive is set to indicate the error.
32

ERRORS

34     zip_set_default_password() fails if:
35
36     [ZIP_ER_MEMORY]    Required memory could not be allocated.
37

SEE ALSO

39     libzip(3), zip_fopen(3), zip_fopen_encrypted(3)
40

HISTORY

42     zip_set_default_password() was added in libzip 0.10.
43

AUTHORS

45     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
46
47BSD                           September 15, 2020                           BSD
Impressum