+ if (world_readable)
+ {
+ /* Ensure the file is world readable even in the presence of
+ * possibly restrictive umasks;
+ * see http://lists.freedesktop.org/archives/dbus/2010-September/013367.html
+ */
+ if (fchmod (fd, 0644) < 0)
+ {
+ dbus_set_error (error, _dbus_error_from_errno (errno),
+ "Could not chmod %s: %s", tmp_filename_c,
+ _dbus_strerror (errno));
+ goto out;
+ }
+ }