all: pass O_CLOEXEC flag to g_mkstemp()
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <netinet/ether.h>
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "nm-client-utils.h"
|
||||
#include "nm-vpn-helpers.h"
|
||||
@@ -8864,7 +8865,7 @@ do_connection_export (NmCli *nmc, int argc, char **argv)
|
||||
else {
|
||||
nm_auto_close int fd = -1;
|
||||
|
||||
fd = g_mkstemp (tmpfile);
|
||||
fd = g_mkstemp_full (tmpfile, O_RDWR | O_CLOEXEC, 0600);
|
||||
if (fd == -1) {
|
||||
g_string_printf (nmc->return_text, _("Error: failed to create temporary file %s."), tmpfile);
|
||||
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
|
||||
|
@@ -351,7 +351,7 @@ nm_utils_file_set_contents (const char *filename,
|
||||
length = strlen (contents);
|
||||
|
||||
tmp_name = g_strdup_printf ("%s.XXXXXX", filename);
|
||||
fd = g_mkstemp_full (tmp_name, O_RDWR, mode);
|
||||
fd = g_mkstemp_full (tmp_name, O_RDWR | O_CLOEXEC, mode);
|
||||
if (fd < 0) {
|
||||
errsv = errno;
|
||||
g_set_error (error,
|
||||
|
Reference in New Issue
Block a user