• Colin Walters's avatar
    Make dbus-uuidgen atomic · 45d53565
    Colin Walters authored
    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.
dbus-file.h 2.22 KB