|
|
a3a8ff |
From 3519f493ce51bac53d178f7ff9e5b84ca98a158a Mon Sep 17 00:00:00 2001
|
|
|
a3a8ff |
From: Tomas Mlcoch <tmlcoch@redhat.com>
|
|
|
a3a8ff |
Date: Fri, 19 Aug 2016 14:59:26 +0200
|
|
|
a3a8ff |
Subject: [PATCH 1/2] cr_lock_repo: Fix segfault caused by freed
|
|
|
a3a8ff |
tmp_repodata_dir variable
|
|
|
a3a8ff |
|
|
|
a3a8ff |
---
|
|
|
a3a8ff |
src/createrepo_shared.c | 5 ++---
|
|
|
a3a8ff |
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
a3a8ff |
|
|
|
a3a8ff |
diff --git a/src/createrepo_shared.c b/src/createrepo_shared.c
|
|
|
a3a8ff |
index 5872029..d4df86c 100644
|
|
|
a3a8ff |
--- a/src/createrepo_shared.c
|
|
|
a3a8ff |
+++ b/src/createrepo_shared.c
|
|
|
a3a8ff |
@@ -258,12 +258,11 @@ cr_lock_repo(const gchar *repo_dir,
|
|
|
a3a8ff |
g_debug("(--ignore-lock enabled) For data generation is used: %s",
|
|
|
a3a8ff |
tmp_repodata_dir);
|
|
|
a3a8ff |
}
|
|
|
a3a8ff |
- }
|
|
|
a3a8ff |
|
|
|
a3a8ff |
- if (tmp_repodata_dir)
|
|
|
a3a8ff |
*tmp_repodata_dir_p = g_strdup(tmp_repodata_dir);
|
|
|
a3a8ff |
- else
|
|
|
a3a8ff |
+ } else {
|
|
|
a3a8ff |
*tmp_repodata_dir_p = g_strdup(lock_dir);
|
|
|
a3a8ff |
+ }
|
|
|
a3a8ff |
|
|
|
a3a8ff |
return TRUE;
|
|
|
a3a8ff |
}
|
|
|
a3a8ff |
--
|
|
|
a3a8ff |
2.9.3
|
|
|
a3a8ff |
|
|
|
a3a8ff |
|
|
|
a3a8ff |
From 07f5cce3eff5c62f0c16143c7eaab64eb0e3ebf8 Mon Sep 17 00:00:00 2001
|
|
|
a3a8ff |
From: Tomas Mlcoch <tmlcoch@redhat.com>
|
|
|
a3a8ff |
Date: Thu, 8 Sep 2016 09:45:38 +0200
|
|
|
a3a8ff |
Subject: [PATCH 2/2] cr_lock_repo: Fix double free (RhBz: 1355720)
|
|
|
a3a8ff |
|
|
|
a3a8ff |
---
|
|
|
a3a8ff |
src/createrepo_shared.c | 8 ++++----
|
|
|
a3a8ff |
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
a3a8ff |
|
|
|
a3a8ff |
diff --git a/src/createrepo_shared.c b/src/createrepo_shared.c
|
|
|
a3a8ff |
index d4df86c..8a26787 100644
|
|
|
a3a8ff |
--- a/src/createrepo_shared.c
|
|
|
a3a8ff |
+++ b/src/createrepo_shared.c
|
|
|
a3a8ff |
@@ -188,7 +188,6 @@ cr_lock_repo(const gchar *repo_dir,
|
|
|
a3a8ff |
assert(!err || *err == NULL);
|
|
|
a3a8ff |
|
|
|
a3a8ff |
_cleanup_free_ gchar *lock_dir = NULL;
|
|
|
a3a8ff |
- _cleanup_free_ gchar *tmp_repodata_dir = NULL;
|
|
|
a3a8ff |
_cleanup_error_free_ GError *tmp_err = NULL;
|
|
|
a3a8ff |
|
|
|
a3a8ff |
lock_dir = g_build_filename(repo_dir, ".repodata/", NULL);
|
|
|
a3a8ff |
@@ -242,10 +241,11 @@ cr_lock_repo(const gchar *repo_dir,
|
|
|
a3a8ff |
}
|
|
|
a3a8ff |
|
|
|
a3a8ff |
// To data generation use a different one
|
|
|
a3a8ff |
+ _cleanup_free_ gchar *tmp_repodata_dir = NULL;
|
|
|
a3a8ff |
_cleanup_free_ gchar *tmp = NULL;
|
|
|
a3a8ff |
- tmp_repodata_dir = g_build_filename(repo_dir, ".repodata.", NULL);
|
|
|
a3a8ff |
- tmp = cr_append_pid_and_datetime(tmp_repodata_dir, "/");
|
|
|
a3a8ff |
- tmp_repodata_dir = tmp;
|
|
|
a3a8ff |
+
|
|
|
a3a8ff |
+ tmp = g_build_filename(repo_dir, ".repodata.", NULL);
|
|
|
a3a8ff |
+ tmp_repodata_dir = cr_append_pid_and_datetime(tmp, "/");
|
|
|
a3a8ff |
|
|
|
a3a8ff |
if (g_mkdir(tmp_repodata_dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)) {
|
|
|
a3a8ff |
g_critical("(--ignore-lock enabled) Cannot create %s: %s",
|
|
|
a3a8ff |
--
|
|
|
a3a8ff |
2.9.3
|
|
|
a3a8ff |
|