Fix issue of moving files by ar or br

Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
This commit is contained in:
yixiangzhike 2022-08-24 18:14:39 +08:00
parent e35f231bf0
commit 3df1927e9d
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From e155af3cf1ed9a215459ee161f7632b8b8b62e52 Mon Sep 17 00:00:00 2001
From: yixiangzhike <yixiangzhike007@163.com>
Date: Wed, 17 Aug 2022 16:44:03 +0800
Subject: [PATCH] fix issue of moving files by ar or br
When eu-ar uses the combination of br or ar parameters to move the exist files,
it forgets to add the files to the new linked list. As a result, the files are lost.
---
src/ar.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ar.c b/src/ar.c
index 42126aa..56fb9ed 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -1342,7 +1342,8 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
struct armem *last_added = after_memberelem;
for (int cnt = 0; cnt < argc; ++cnt)
- if (oper != oper_replace || found[cnt]->old_off == -1)
+ if (((oper == oper_replace) && (ipos != ipos_none) && (found[cnt]->old_off != -1)) || \
+ oper != oper_replace || found[cnt]->old_off == -1)
{
if (last_added == NULL)
{
--
2.27.0

View File

@ -1,7 +1,7 @@
# -*- rpm-spec from http://elfutils.org/ -*-
Name: elfutils
Version: 0.185
Release: 8
Release: 9
Summary: A collection of utilities and DSOs to handle ELF files and DWARF data
URL: http://elfutils.org/
License: GPLv3+ and (GPLv2+ or LGPLv3+)
@ -10,6 +10,7 @@ Source: ftp://sourceware.org/pub/elfutils/%{version}/elfutils-%{version}.tar.bz2
Patch0: eu-elfclassify-no-stdin-should-use-classify_flag_no_stdin.patch
Patch1: Fix-segfault-in-eu-ar-m.patch
Patch2: Fix-error-of-parsing-object-file-perms.patch
Patch3: Fix-issue-of-moving-files-by-ar-or-br.patch
Provides: elfutils-libelf elfutils-default-yama-scope default-yama-scope elfutils-libs
Obsoletes: elfutils-libelf elfutils-default-yama-scope elfutils-libs
@ -240,6 +241,9 @@ exit 0
%systemd_postun_with_restart debuginfod.service
%changelog
* Wed Aug 24 2022 yixiangzhike <yixiangzhike007@163.com> - 0.185-9
- Fix issue of moving files by ar or br
* Tue Aug 16 2022 yixiangzhike <yixiangzhike007@163.com> - 0.185-8
- Fix error of parsing object file perms