mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-23 12:12:21 -05:00
Had to allow absolute extraction paths, but that's OK as we're always going to set the destination path. Also had to allow extraction through symlinks because MacOS seems to use them for its temp dirs.
10 lines
406 B
Ruby
10 lines
406 B
Ruby
module Archive
|
|
# Create a preset "secure extraction" flag combination for libarchive to make sure we avoid security problems
|
|
# See https://github.com/libarchive/libarchive/blob/6ee1eebefdf41f36ef1a548c9a7000d132c453f3/libarchive/archive.h#L662
|
|
EXTRACT_SECURE = [
|
|
Archive::EXTRACT_NO_OVERWRITE,
|
|
Archive::EXTRACT_NO_OVERWRITE_NEWER,
|
|
Archive::EXTRACT_SECURE_NODOTDOT
|
|
].reduce(:|).to_i
|
|
end
|