--- ./libdnf/hy-iutil.cpp_orig	2020-02-13 04:14:52 +0000
+++ ./libdnf/hy-iutil.cpp	2020-02-18 07:28:58 +0000
@@ -72,6 +72,8 @@
 #define CHKSUM_IDENT "H000"
 #define CACHEDIR_PERMISSIONS 0700
 
+extern char * mkdtemp(char *);
+
 static mode_t
 get_umask(void)
 {
@@ -302,7 +304,7 @@
         *(strrchr(p, '/')) = '\0';
         ret = mkcachedir(p);
         if (g_str_has_suffix(path, "XXXXXX")) {
-            char *retptr = mktemp(path);
+            char *retptr = mkdtemp(path);
             if (retptr == NULL)
                 ret |= 1;
         } else
--- ./libdnf/repo/Repo.cpp_orig	2020-02-13 04:21:22 +0000
+++ ./libdnf/repo/Repo.cpp	2020-02-18 07:29:22 +0000
@@ -74,6 +74,8 @@
 
 #include <glib.h>
 
+extern char * mkdtemp(char *);
+
 //
 // COUNTME CONSTANTS
 //
@@ -710,7 +712,7 @@
 
     // set GPG home dir
     char tmpdir[] = "/tmp/tmpdir.XXXXXX";
-    mktemp(tmpdir);
+    mkdtemp(tmpdir);
     Finalizer tmpDirRemover([&tmpdir](){
         dnf_remove_recursive(tmpdir, NULL);
     });
@@ -1147,7 +1149,7 @@
 {
     auto logger(Log::getLogger());
     char tmpdir[] = "/tmp/tmpdir.XXXXXX";
-    mktemp(tmpdir);
+    mkdtemp(tmpdir);
     Finalizer tmpDirRemover([&tmpdir](){
         dnf_remove_recursive(tmpdir, NULL);
     });
@@ -1217,7 +1219,7 @@
     auto logger(Log::getLogger());
     LrYumRepo *yum_repo;
     char tmpdir[] = "/tmp/tmpdir.XXXXXX";
-    mktemp(tmpdir);
+    mkdtemp(tmpdir);
     Finalizer tmpDirRemover([&tmpdir](){
         dnf_remove_recursive(tmpdir, NULL);
     });
@@ -1256,7 +1258,7 @@
                                              destdir, errTxt));
     }
     auto tmpdir = destdir + "/tmpdir.XXXXXX";
-    if (!mktemp(&tmpdir.front())) {
+    if (!mkdtemp(&tmpdir.front())) {
         const char * errTxt = strerror(errno);
         throw std::runtime_error(tfm::format(_("Cannot create repo temporary directory \"%s\": %s"),
                                              tmpdir.c_str(), errTxt));
