mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-08 22:16:10 -04:00
fdio: Fix default mode in glnx_file_replace_contents_with_perms_at()
mkostemp() defaults to 0600. Use 0644 instead unless a mode is explicitly provided. https://bugzilla.gnome.org/747813
This commit is contained in:
1 parent
20fc302df5
commit
02af92ffef
1 file changed
+6
-6
+6
-6
@@ -708,13 +708,13 @@ glnx_file_replace_contents_with_perms_at (int dfd,
|
||||
}
|
||||
}
|
||||
|
||||
if (mode != (mode_t) -1)
|
||||
if (mode == (mode_t) -1)
|
||||
mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
|
||||
|
||||
if (fchmod (fd, mode) != 0)
|
||||
{
|
||||
if (fchmod (fd, mode) != 0)
|
||||
{
|
||||
glnx_set_error_from_errno (error);
|
||||
goto out;
|
||||
}
|
||||
glnx_set_error_from_errno (error);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (renameat (dfd, tmppath, dfd, subpath) != 0)
|
||||
|
||||
Reference in new issue
Block a user