mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
keyfile settings: Use tighter permissions
When creating directories, create them with 700 permissions, instead of 777. Closes: #1658
This commit is contained in:
parent
1f793e9680
commit
5e4da714f0
@ -113,7 +113,8 @@ g_keyfile_settings_backend_keyfile_write (GKeyfileSettingsBackend *kfsb)
|
|||||||
|
|
||||||
contents = g_key_file_to_data (kfsb->keyfile, &length, NULL);
|
contents = g_key_file_to_data (kfsb->keyfile, &length, NULL);
|
||||||
g_file_replace_contents (kfsb->file, contents, length, NULL, FALSE,
|
g_file_replace_contents (kfsb->file, contents, length, NULL, FALSE,
|
||||||
G_FILE_CREATE_REPLACE_DESTINATION,
|
G_FILE_CREATE_REPLACE_DESTINATION |
|
||||||
|
G_FILE_CREATE_PRIVATE,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
compute_checksum (kfsb->digest, contents, length);
|
compute_checksum (kfsb->digest, contents, length);
|
||||||
@ -708,7 +709,7 @@ g_keyfile_settings_backend_constructed (GObject *object)
|
|||||||
kfsb->permission = g_simple_permission_new (TRUE);
|
kfsb->permission = g_simple_permission_new (TRUE);
|
||||||
|
|
||||||
kfsb->dir = g_file_get_parent (kfsb->file);
|
kfsb->dir = g_file_get_parent (kfsb->file);
|
||||||
g_file_make_directory_with_parents (kfsb->dir, NULL, NULL);
|
g_mkdir_with_parents (g_file_peek_path (kfsb->dir), 0700);
|
||||||
|
|
||||||
kfsb->file_monitor = g_file_monitor (kfsb->file, G_FILE_MONITOR_NONE, NULL, NULL);
|
kfsb->file_monitor = g_file_monitor (kfsb->file, G_FILE_MONITOR_NONE, NULL, NULL);
|
||||||
kfsb->dir_monitor = g_file_monitor (kfsb->dir, G_FILE_MONITOR_NONE, NULL, NULL);
|
kfsb->dir_monitor = g_file_monitor (kfsb->dir, G_FILE_MONITOR_NONE, NULL, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user