+ /* note that type may be NULL */
+ context->type = _dbus_strdup (bus_config_parser_get_type (parser));
+ if (bus_config_parser_get_type (parser) != NULL && context->type == NULL)
+ goto oom;
+
+ user = bus_config_parser_get_user (parser);
+ if (user != NULL)
+ {
+ context->user = _dbus_strdup (user);
+ if (context->user == NULL)
+ goto oom;
+ }
+
+ /* Set up the prefix for syslog messages */
+ if (!_dbus_string_init (&log_prefix))
+ goto oom;
+ if (context->type && !strcmp (context->type, "system"))
+ {
+ if (!_dbus_string_append (&log_prefix, "[system] "))
+ goto oom;
+ }
+ else if (context->type && !strcmp (context->type, "session"))
+ {
+ DBusCredentials *credentials;
+
+ credentials = _dbus_credentials_new_from_current_process ();
+ if (!credentials)
+ goto oom;
+ if (!_dbus_string_append (&log_prefix, "[session "))
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
+ if (!_dbus_credentials_to_string_append (credentials, &log_prefix))
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
+ if (!_dbus_string_append (&log_prefix, "] "))
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
+ _dbus_credentials_unref (credentials);
+ }
+ if (!_dbus_string_steal_data (&log_prefix, &context->log_prefix))
+ goto oom;
+ _dbus_string_free (&log_prefix);
+