Even if we import it from libarchive.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
}
static int pakfire_file_from_archive_entry(struct pakfire_file* file, struct archive_entry* entry) {
+ char path[PATH_MAX];
char* buffer = NULL;
const char* attr = NULL;
const void* value = NULL;
// Clone the given entry
file->entry = archive_entry_clone(entry);
if (!file->entry)
- return -ENOMEM;
+ return -errno;
+
+ // Make the path absolute
+ r = pakfire_path_absolute(path, archive_entry_pathname(file->entry));
+ if (r < 0)
+ goto ERROR;
+
+ // Store the absolute path
+ archive_entry_copy_pathname(file->entry, path);
// Reset iterating over extended attributes
archive_entry_xattr_reset(file->entry);