mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-15 20:25:12 +01:00
glocalfileoutputstream: Only pass file mode, not type, to chmod()
chmod() technically only accepts file modes, not the file type and mode as returned by stat(). Filter by `S_IFMT` to avoid sending the file type (regular file, directory, symbolic link, etc.). In practice, chmod() ignores anything except the file mode, but we might as well comply with the specification. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
674ba78f12
commit
5dd5269126
@ -979,7 +979,7 @@ handle_overwrite_open (const char *filename,
|
||||
fchown (tmpfd, original_stat.st_uid, original_stat.st_gid) == -1 ||
|
||||
#endif
|
||||
#ifdef HAVE_FCHMOD
|
||||
fchmod (tmpfd, original_stat.st_mode) == -1 ||
|
||||
fchmod (tmpfd, original_stat.st_mode & ~S_IFMT) == -1 ||
|
||||
#endif
|
||||
0
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user