diff options
author | Colin Walters <walters@verbum.org> | 2010-09-03 10:18:25 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-09-03 14:29:53 -0400 |
commit | 45d53565bc13678d6aa5edec1d4efb5bf8a64e0b (patch) | |
tree | 2d7793d95690894d29d52f7ece35ec8600d39727 /dbus/dbus-keyring.c | |
parent | ff2325c92c411e6718ae38d6976f54580ed57e86 (diff) | |
download | dbus-45d53565bc13678d6aa5edec1d4efb5bf8a64e0b.tar.gz |
Make dbus-uuidgen atomic
A Red Hat QA engineer hit in practice a race condition in dbus-uuidgen
where it could leave an empty file.
dbus-uuidgen (_dbus_create_uuid_file_exclusively) formerly created an
empty file in the path to the uuid, then filled it in. At some point,
the internal libdbus _dbus_string_save_to_file became atomic on Unix
at least (doing the save to temp file, fsync(), rename() dance).
So _dbus_create_uuid_file_exclusively doesn't need to create the file
beforehand anymore. However, it *does* need the file to be
world-readable, unlike all other consumers of
_dbus_string_save_to_file. So add a "world_readable" argument.
Diffstat (limited to 'dbus/dbus-keyring.c')
-rw-r--r-- | dbus/dbus-keyring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dbus/dbus-keyring.c b/dbus/dbus-keyring.c index 031521c2..bef64523 100644 --- a/dbus/dbus-keyring.c +++ b/dbus/dbus-keyring.c @@ -605,7 +605,7 @@ _dbus_keyring_reload (DBusKeyring *keyring, } if (!_dbus_string_save_to_file (&contents, &keyring->filename, - error)) + FALSE, error)) goto out; } |