1 Star 0 Fork 8

liuyumeng/gnome-autoar

forked from src-openEuler/gnome-autoar 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-0001-CVE-2021-28650.patch 2.33 KB
一键复制 编辑 原始数据 按行查看 历史
linker 提交于 2021-04-14 16:18 . fix CVE-2021-28650, remove CVE-2020-36241
From 88e21e8aa2841216fa1d7fba617a8692912af51e Mon Sep 17 00:00:00 2001
From: Ondrej Holy <[email protected]>
Date: Thu, 25 Feb 2021 14:10:26 +0100
Subject: [PATCH] extractor: Detect conflict also for directories
Current logic doesn't detect conflics when extracting directory. This
is ok, but only for the case when the conflic is caused by directory.
Otherwise, the conflic should be detected and AutoarExtractor should
try to delete the file before creating new directory.
Conflict:NA
Reference:https://gitlab.gnome.org/GNOME/gnome-autoar/-/merge_requests/15/diffs?commit_id=88e21e8aa2841216fa1d7fba617a8692912af51e
---
gnome-autoar/autoar-extractor.c | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c
index f1f49cf..376c864 100644
--- a/gnome-autoar/autoar-extractor.c
+++ b/gnome-autoar/autoar-extractor.c
@@ -897,7 +897,6 @@ autoar_extractor_check_file_conflict (GFile *file,
mode_t extracted_filetype)
{
GFileType file_type;
- gboolean conflict = FALSE;
file_type = g_file_query_file_type (file,
G_FILE_QUERY_INFO_NONE,
@@ -907,26 +906,13 @@ autoar_extractor_check_file_conflict (GFile *file,
return FALSE;
}
- switch (extracted_filetype) {
- case AE_IFDIR:
- break;
- case AE_IFREG:
- case AE_IFLNK:
-#if defined HAVE_MKFIFO || defined HAVE_MKNOD
- case AE_IFIFO:
-#endif
-#ifdef HAVE_MKNOD
- case AE_IFSOCK:
- case AE_IFBLK:
- case AE_IFCHR:
-#endif
- conflict = TRUE;
- break;
- default:
- break;
+ /* It is not problem if the directory already exists */
+ if (file_type == G_FILE_TYPE_DIRECTORY &&
+ extracted_filetype == AE_IFDIR) {
+ return FALSE;
}
- return conflict;
+ return TRUE;
}
static void
@@ -1850,6 +1836,9 @@ autoar_extractor_step_extract (AutoarExtractor *self) {
case AUTOAR_CONFLICT_OVERWRITE:
break;
case AUTOAR_CONFLICT_CHANGE_DESTINATION:
+ /* FIXME: If the destination is changed for directory, it should be
+ * changed also for its children...
+ */
g_assert_nonnull (new_extracted_filename);
g_clear_object (&extracted_filename);
extracted_filename = new_extracted_filename;
--
2.19.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuyumeng1/gnome-autoar.git
[email protected]:liuyumeng1/gnome-autoar.git
liuyumeng1
gnome-autoar
gnome-autoar
master

搜索帮助