mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 10:10:07 +01:00
all: pass O_CLOEXEC flag to g_mkstemp()
This commit is contained in:
parent
bbc88cd07f
commit
20a7e489ee
2 changed files with 3 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue