Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

zip_set_default_password(3) [debian man page]

ZIP_SET_DEFAULT_PASSWORD(3)				     Library Functions Manual				       ZIP_SET_DEFAULT_PASSWORD(3)

NAME
zip_set_default_password - set default password for encrypted files in zip LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> int zip_set_default_password(struct zip *archive, const char *password); DESCRIPTION
The zip_set_default_password function sets the default password used when accessing encrypted files. If password is NULL, the default password is unset. If you prefer a different password for single files, use zip_fopen_encrypted(3) instead of zip_fopen(3). Usually, however, the same pass- word is used for every file in an zip archive. RETURN VALUES
Upon successful completion 0 is returned. Otherwise, -1 is returned and the error information in archive is set to indicate the error. ERRORS
zip_set_default_password fails if: [ZIP_ER_MEMORY] Required memory could not be allocated. SEE ALSO
libzip(3), zip_fopen(3), zip_fopen_encrypted(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH January 3, 2011 ZIP_SET_DEFAULT_PASSWORD(3)

Check Out this Related Man Page

ZIP_FOPEN(3)						     Library Functions Manual						      ZIP_FOPEN(3)

NAME
zip_fopen , - .Nm zip_fopen_index open file in zip archive for reading LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> struct zip_file * zip_fopen(struct zip *archive, const char *fname, int flags); struct zip_file * zip_fopen_index(struct zip *archive, zip_uint64_t index, int flags); DESCRIPTION
The zip_fopen function opens the file name fname in archive. The flags argument specifies how the name lookup should be done, according to the values are described in zip_name_locate(3). Also, the following values may be or'ed to it. ZIP_FL_COMPRESSED Read the compressed data. Otherwise the data is uncompressed by zip_fread. ZIP_FL_UNCHANGED Read the original data from the zip archive, ignoring any changes made to the file. The zip_fopen_index function opens the file at position index. If encrypted data is encountered, the functions call zip_fopen_encrypted(3) or zip_fopen_index_encrypted(3) respectively, using the default password set with zip_set_default_password(3). RETURN VALUES
Upon successful completion, a struct zip_file pointer is returned. Otherwise, NULL is returned and the error code in archive is set to indicate the error. ERRORS
[ZIP_ER_CHANGED] The file data has been changed. [ZIP_ER_COMPNOTSUPP] The compression method used is not supported. [ZIP_ER_ENCRNOTSUPP] The encryption method used is not supported. [ZIP_ER_MEMORY] Required memory could not be allocated. [ZIP_ER_READ] A file read error occurred. [ZIP_ER_SEEK] A file seek error occurred. [ZIP_ER_ZLIB] Initializing the zlib stream failed. The function zip_fopen may also fail and set for any of the errors specified for the routine zip_name_locate(3). The function zip_fopen_index may also fail with ZIP_ER_INVAL if index is invalid. SEE ALSO
libzip(3), zip_fclose(3), zip_fread(3), zip_get_num_entries(3), zip_name_locate(3), zip_set_default_password(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH February 14, 2011 ZIP_FOPEN(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Does unix has password protection for zip files?

How to set password in zip files under unix? There are password protection available in various os. Does unix has password protection for zip files? Is zip and gzip command has it? (6 Replies)
Discussion started by: p_prathaban
6 Replies

2. UNIX for Dummies Questions & Answers

pass the password to SU??

hi, i have a lot of su in my script. and it keeps asking for a password every single time. how can i pass the password to su command? any setup i need to do? i used a redirect, not working. su -username - c "command" < "password" thanks for any help! (5 Replies)
Discussion started by: bikoyski
5 Replies

3. UNIX for Dummies Questions & Answers

Zip file with password protection

I am trying to zip a file with password protection. I have read all or atleast most of the threads on the website, but couldn't come up with a solution. I am running ZIP version 2.3 on HP-UX but I dont see the -P (password) option. I read somewhere that free versions of zip don't come with... (5 Replies)
Discussion started by: pintu
5 Replies

4. Shell Programming and Scripting

zip all of files except last file

hi, I try to write a script to zip archivelog files in arch fold except not zip last archivelog file since it database may be still using the last file here is my script. when I run the script, I get error messages. could you please advise/correct my script in detail what it could be wrong, I am... (9 Replies)
Discussion started by: percvs88
9 Replies

5. Shell Programming and Scripting

zip and email files

Hi, New to Unix and trying to do something - I am trying to zip bunch of file and email - /sbin/sh If i use mail then I can not specify subject - uuencode file.zip file.zip | mail -s "testfile" mailadd@group.com Error is - mail: illegal option -- s If i use mailx then I can specify... (7 Replies)
Discussion started by: bhush782003
7 Replies

6. Shell Programming and Scripting

Script to rename zip-files with name of file

Hi, I'm desperately in search for a solution of the following problem: I have a directory full of zip-files. All these zip-files contain a single file with a name that should be used for the name of the zip-container. Anybody a good idea. I'm an absolute beginner in shell scripting - so please... (7 Replies)
Discussion started by: mark_a17
7 Replies

7. Shell Programming and Scripting

Search entire system for files containing certain word(s)

I am trying to create a script that will report (email and ftp results) on any file, system wide, that has the word password= in it. (and any variation of password=). Basicaly looking for any plain text passwds. I figured the easiest way would be like this...... for i in `cat find-pw.dat` do... (6 Replies)
Discussion started by: theninja
6 Replies

8. Shell Programming and Scripting

Help with zipping files

Hi, I have come across a requirement in which I need to zip files. This is fine but the requriement has one conditions like below: One .z file can not have more than 10,000 files Now in the directory I have several files liek below: aaa_file_10_00001.txt aaa_file_10_00002.txt... (6 Replies)
Discussion started by: angshuman
6 Replies

9. Shell Programming and Scripting

Specific file list to be zip

Hi, I need a specific list of files to be zip automatically. based on the criteria Criteria: 1. It should not be the current file and not less than 10 files e.g in a folder contails 100 files jan 50 -> contains ->45 zip files e.g. XXX.gz 5 normal log files e.g XXX.log ... (11 Replies)
Discussion started by: jagkoth
11 Replies

10. Shell Programming and Scripting

Group files and zip

Hi I have 4 files in a folder and I am supposed to group and zip them via a mapping file as such: Group. Filename 1. A.txt 1. B.txt 2. C.txt 2. D.txt Result should be 2 zip files - 1.zip and 2.zip created with the contents being the text file. How can... (7 Replies)
Discussion started by: nightrider
7 Replies

11. Shell Programming and Scripting

Help in searching a multiple text in zip file

Hi Gurus, i have 8 zipped files and each file is having more than 100,000 records or more. issue :- i want to search the missing text from each zipped files i have stuck here, the below command works fine if i give the value 10 for the deptno. if i have more than 1 records... (6 Replies)
Discussion started by: SeenuGuddu
6 Replies

12. Shell Programming and Scripting

create a zip file

Im fairly new to bash but I wanted to know about an idea I had to stream my file process these days. I modify .html, and .xml files and usually will take the files right click, create .zip, add files, rename, and cut the zip out of the folder and paste into another folder. I KNOW bash should be... (13 Replies)
Discussion started by: graphicsman
13 Replies

13. Shell Programming and Scripting

Finding a text file from a group of zip files without unzipping

HI , There are more than 100 zip files in a directory and i wanted to see if there is a max1157.txt file in any of the zip files without actually unzipping them. Could you please help. Thanks in Advance. Karthik. (6 Replies)
Discussion started by: karthikk0508
6 Replies

14. Shell Programming and Scripting

Zip Multiple files to One .zip file in AIX system

Hi I have a requirement in unix shell where I need to zip multiple files on server to one single .zip file. I dont see zip command in AIX and gzip command not doing completely what I want. One I do .zip file, I should be able to unzip in my local Computer. Here is example what I want... (9 Replies)
Discussion started by: RAMA PULI
9 Replies

15. UNIX for Dummies Questions & Answers

Zip a file with password

Hi, newbie to Linux, is there another way to zip a file with a password other than using 'zip' command? (7 Replies)
Discussion started by: mined
7 Replies