[PATCH] Make dbus-uuidgen atomic

Colin Walters walters at verbum.org
Thu Sep 9 09:17:25 PDT 2010


Aaaand I'm back.

On Mon, Sep 6, 2010 at 3:58 AM, Jörg Barfurth <joerg.barfurth at oracle.com> wrote:

> This change seem to lose the cross-process locking provided by creat(..,
> O_EXCL). Isn't that what the '_exclusively' in the function name is supposed
> to express?

Hard to say...if supporting multiple concurrent invocations of
dbus-uuidgen was the goal, then the old code was buggy too; there was
nothing to prevent instance B from reading an empty file after
instance A called _dbus_create_file_exclusively (and then replacing it
with a different uuid, while instance A would go on.

We could try to use file locks or something but I can't think of a
reason why dbus-uuidgen should ever be run concurrently.  If anyone is
doing this somehow in your OS, please stop doing so.


More information about the dbus mailing list