mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
Merge branch 'cloexec-other' into 'main'
Close-on-exec flag few missed places See merge request GNOME/glib!3292
This commit is contained in:
commit
0a715be599
@ -1040,7 +1040,7 @@ handle_overwrite_open (const char *filename,
|
|||||||
tmp_filename = g_build_filename (dirname, ".goutputstream-XXXXXX", NULL);
|
tmp_filename = g_build_filename (dirname, ".goutputstream-XXXXXX", NULL);
|
||||||
g_free (dirname);
|
g_free (dirname);
|
||||||
|
|
||||||
tmpfd = g_mkstemp_full (tmp_filename, (readable ? O_RDWR : O_WRONLY) | O_BINARY, mode);
|
tmpfd = g_mkstemp_full (tmp_filename, (readable ? O_RDWR : O_WRONLY) | O_BINARY | O_CLOEXEC, mode);
|
||||||
if (tmpfd == -1)
|
if (tmpfd == -1)
|
||||||
{
|
{
|
||||||
g_free (tmp_filename);
|
g_free (tmp_filename);
|
||||||
|
@ -585,7 +585,7 @@ _g_get_unix_mounts (void)
|
|||||||
|
|
||||||
read_file = get_mtab_read_file ();
|
read_file = get_mtab_read_file ();
|
||||||
|
|
||||||
file = setmntent (read_file, "r");
|
file = setmntent (read_file, "re");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -727,7 +727,7 @@ _g_get_unix_mounts (void)
|
|||||||
|
|
||||||
read_file = get_mtab_read_file ();
|
read_file = get_mtab_read_file ();
|
||||||
|
|
||||||
file = setmntent (read_file, "r");
|
file = setmntent (read_file, "re");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -1114,7 +1114,7 @@ _g_get_unix_mount_points (void)
|
|||||||
|
|
||||||
read_file = get_fstab_file ();
|
read_file = get_fstab_file ();
|
||||||
|
|
||||||
file = setmntent (read_file, "r");
|
file = setmntent (read_file, "re");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -1203,7 +1203,7 @@ _g_get_unix_mount_points (void)
|
|||||||
|
|
||||||
read_file = get_fstab_file ();
|
read_file = get_fstab_file ();
|
||||||
|
|
||||||
file = setmntent (read_file, "r");
|
file = setmntent (read_file, "re");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -1378,7 +1378,7 @@ _g_get_unix_mount_points (void)
|
|||||||
|
|
||||||
read_file = get_fstab_file ();
|
read_file = get_fstab_file ();
|
||||||
|
|
||||||
file = setmntent (read_file, "r");
|
file = setmntent (read_file, "re");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1351,7 +1351,7 @@ g_file_set_contents_full (const gchar *filename,
|
|||||||
tmp_filename = g_strdup_printf ("%s.XXXXXX", filename);
|
tmp_filename = g_strdup_printf ("%s.XXXXXX", filename);
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
fd = g_mkstemp_full (tmp_filename, O_RDWR | O_BINARY, mode);
|
fd = g_mkstemp_full (tmp_filename, O_RDWR | O_BINARY | O_CLOEXEC, mode);
|
||||||
|
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
@ -1704,7 +1704,7 @@ g_mkstemp_full (gchar *tmpl,
|
|||||||
gint
|
gint
|
||||||
g_mkstemp (gchar *tmpl)
|
g_mkstemp (gchar *tmpl)
|
||||||
{
|
{
|
||||||
return g_mkstemp_full (tmpl, O_RDWR | O_BINARY, 0600);
|
return g_mkstemp_full (tmpl, O_RDWR | O_BINARY | O_CLOEXEC, 0600);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
@ -1826,7 +1826,7 @@ g_file_open_tmp (const gchar *tmpl,
|
|||||||
|
|
||||||
result = g_get_tmp_name (tmpl, &fulltemplate,
|
result = g_get_tmp_name (tmpl, &fulltemplate,
|
||||||
wrap_g_open,
|
wrap_g_open,
|
||||||
O_CREAT | O_EXCL | O_RDWR | O_BINARY,
|
O_CREAT | O_EXCL | O_RDWR | O_BINARY | O_CLOEXEC,
|
||||||
0600,
|
0600,
|
||||||
error);
|
error);
|
||||||
if (result != -1)
|
if (result != -1)
|
||||||
|
@ -230,7 +230,7 @@ g_rand_new (void)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
dev_urandom = fopen("/dev/urandom", "rb");
|
dev_urandom = fopen ("/dev/urandom", "rbe");
|
||||||
}
|
}
|
||||||
while G_UNLIKELY (dev_urandom == NULL && errno == EINTR);
|
while G_UNLIKELY (dev_urandom == NULL && errno == EINTR);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user