From 2c76094b83510e60de5493720c3e58be124c5b40 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 30 Jun 2007 00:49:17 +0200 Subject: [PATCH] libalpm/add.c : fix for FS #7484 Adds the ARCHIVE_EXTRACT_NO_OVERWRITE libarchive flags for extracting files and directories. This will prevent symlinks for being overwritten by directories. All other files that need to be extracted should already have been deleted previously by pacman. This flag is not used for extracting files in backup array to /tmp/alpm_XXXX, because this file is created by mkstemp first, and so needs to be overwritten by the file from the archive. Signed-off-by: Chantry Xavier --- lib/libalpm/add.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 1ebf455..5bc2604 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -700,7 +700,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) archive_entry_set_pathname(entry, filename); - int ret = archive_read_extract(archive, entry, archive_flags); + int ret = archive_read_extract(archive, entry, archive_flags | ARCHIVE_EXTRACT_NO_OVERWRITE); if(ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { _alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)"), entryname, archive_error_string(archive)); -- 1.5.2.2