@@ -96,6 +96,33 @@ performance optimization in practice.
9696The options field consists of a bitwise OR of one or more of the
9797following values:
9898.Bl -tag -compact -width " indent"
99+ .It Cm ARCHIVE_EXTRACT_ACL
100+ Attempt to restore Access Control Lists.
101+ By default, extended ACLs are ignored.
102+ .It Cm ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
103+ Before removing a file system object prior to replacing it, clear
104+ platform-specific file flags which might prevent its removal.
105+ .It Cm ARCHIVE_EXTRACT_FFLAGS
106+ Attempt to restore file attributes (file flags).
107+ By default, file attributes are ignored.
108+ See
109+ .Xr chattr 1
110+ .Pq Linux
111+ or
112+ .Xr chflags 1
113+ .Pq FreeBSD, Mac OS X
114+ for more information on file attributes.
115+ .It Cm ARCHIVE_EXTRACT_MAC_METADATA
116+ Mac OS X specific. Restore metadata using
117+ .Xr copyfile 3 .
118+ By default,
119+ .Xr copyfile 3
120+ metadata is ignored.
121+ .It Cm ARCHIVE_EXTRACT_NO_OVERWRITE
122+ Existing files on disk will not be overwritten.
123+ By default, existing regular files are truncated and overwritten;
124+ existing directories will have their permissions updated;
125+ other pre-existing objects are unlinked and recreated from scratch.
99126.It Cm ARCHIVE_EXTRACT_OWNER
100127The user and group IDs should be set on the restored file.
101128By default, the user and group IDs are not restored.
@@ -111,61 +138,56 @@ is not specified, then SUID and SGID bits will only be restored
111138if the default user and group IDs of newly-created objects on disk
112139happen to match those specified in the archive entry.
113140By default, only basic permissions are restored, and umask is obeyed.
141+ .It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
142+ Refuse to extract an absolute path.
143+ The default is to not refuse such paths.
144+ .It Cm ARCHIVE_EXTRACT_SECURE_NODOTDOT
145+ Refuse to extract a path that contains a
146+ .Pa ..
147+ element anywhere within it.
148+ The default is to not refuse such paths.
149+ Note that paths ending in
150+ .Pa ..
151+ always cause an error, regardless of this flag.
152+ .It Cm ARCHIVE_EXTRACT_SECURE_SYMLINKS
153+ Refuse to extract any object whose final location would be altered
154+ by a symlink on disk.
155+ This is intended to help guard against a variety of mischief
156+ caused by archives that (deliberately or otherwise) extract
157+ files outside of the current directory.
158+ The default is not to perform this check.
159+ If
160+ .It Cm ARCHIVE_EXTRACT_SPARSE
161+ Scan data for blocks of NUL bytes and try to recreate them with holes.
162+ This results in sparse files, independent of whether the archive format
163+ supports or uses them.
164+ .Cm ARCHIVE_EXTRACT_UNLINK
165+ is specified together with this option, the library will
166+ remove any intermediate symlinks it finds and return an
167+ error only if such symlink could not be removed.
114168.It Cm ARCHIVE_EXTRACT_TIME
115169The timestamps (mtime, ctime, and atime) should be restored.
116170By default, they are ignored.
117171Note that restoring of atime is not currently supported.
118- .It Cm ARCHIVE_EXTRACT_NO_OVERWRITE
119- Existing files on disk will not be overwritten.
120- By default, existing regular files are truncated and overwritten;
121- existing directories will have their permissions updated;
122- other pre-existing objects are unlinked and recreated from scratch.
123172.It Cm ARCHIVE_EXTRACT_UNLINK
124173Existing files on disk will be unlinked before any attempt to
125174create them.
126175In some cases, this can prove to be a significant performance improvement.
127176By default, existing files are truncated and rewritten, but
128177the file is not recreated.
129178In particular, the default behavior does not break existing hard links.
130- .It Cm ARCHIVE_EXTRACT_ACL
131- Attempt to restore ACLs.
132- By default, extended ACLs are ignored.
133- .It Cm ARCHIVE_EXTRACT_FFLAGS
134- Attempt to restore extended file flags.
135- By default, file flags are ignored.
136179.It Cm ARCHIVE_EXTRACT_XATTR
137- Attempt to restore POSIX.1e extended attributes.
180+ Attempt to restore extended file attributes.
138181By default, they are ignored.
139- .It Cm ARCHIVE_EXTRACT_SECURE_SYMLINKS
140- Refuse to extract any object whose final location would be altered
141- by a symlink on disk.
142- This is intended to help guard against a variety of mischief
143- caused by archives that (deliberately or otherwise) extract
144- files outside of the current directory.
145- The default is not to perform this check.
146- If
147- .Cm ARCHIVE_EXTRACT_UNLINK
148- is specified together with this option, the library will
149- remove any intermediate symlinks it finds and return an
150- error only if such symlink could not be removed.
151- .It Cm ARCHIVE_EXTRACT_SECURE_NODOTDOT
152- Refuse to extract a path that contains a
153- .Pa ..
154- element anywhere within it.
155- The default is to not refuse such paths.
156- Note that paths ending in
157- .Pa ..
158- always cause an error, regardless of this flag.
159- .It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
160- Refuse to extract an absolute path.
161- The default is to not refuse such paths.
162- .It Cm ARCHIVE_EXTRACT_SPARSE
163- Scan data for blocks of NUL bytes and try to recreate them with holes.
164- This results in sparse files, independent of whether the archive format
165- supports or uses them.
166- .It Cm ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
167- Before removing a file system object prior to replacing it, clear
168- platform-specific file flags which might prevent its removal.
182+ See
183+ .Xr xattr 7
184+ .Pq Linux ,
185+ .Xr xattr 2
186+ .Pq Mac OS X ,
187+ or
188+ .Xr getextattr 8
189+ .Pq FreeBSD
190+ for more information on extended file attributes.
169191.El
170192.It Xo
171193.Fn archive_write_disk_set_group_lookup ,
0 commit comments