Skip to content

extractor: Ensure that absolute paths are relative to destination

Ondrej Holy requested to merge wip/oholy/absolute-paths into master

Currently, archive entries with absolute paths lose their paths when extracting, or even cause crashes. The code expects that the autoar_extractor_do_sanitize_pathname function will always return paths inside, or equal to the destination directory, but this is not true. The problem is that the g_file_get_child resp. g_file_resolve_relative_path functions expect relative paths, but are used with absolute paths also. Let's convert absolute paths to relative ones to ensure that they will be exctracted as relative to the destination dir. Also, update the corresponding test case to confirm this.

Fixes: #32 (closed)

Merge request reports