Merge branch 'dbus-1.2'
[platform/upstream/dbus.git] / bus / bus.c
index 3e37e90..3777796 100644 (file)
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -58,6 +58,7 @@ struct BusContext
   unsigned int fork : 1;
   unsigned int syslog : 1;
   unsigned int keep_umask : 1;
+  unsigned int allow_anonymous : 1;
 };
 
 static dbus_int32_t server_data_slot = -1;
@@ -191,7 +192,16 @@ new_connection_callback (DBusServer     *server,
 
   dbus_connection_set_max_message_size (new_connection,
                                         context->limits.max_message_size);
+
+  dbus_connection_set_max_received_unix_fds (new_connection,
+                                         context->limits.max_incoming_unix_fds);
+
+  dbus_connection_set_max_message_unix_fds (new_connection,
+                                        context->limits.max_message_unix_fds);
   
+  dbus_connection_set_allow_anonymous (new_connection,
+                                       context->allow_anonymous);
+
   /* on OOM, we won't have ref'd the connection so it will die. */
 }
 
@@ -403,6 +413,7 @@ process_config_first_time_only (BusContext      *context,
   context->fork = bus_config_parser_get_fork (parser);
   context->syslog = bus_config_parser_get_syslog (parser);
   context->keep_umask = bus_config_parser_get_keep_umask (parser);
+  context->allow_anonymous = bus_config_parser_get_allow_anonymous (parser);
 
   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
   retval = TRUE;
@@ -1532,8 +1543,8 @@ bus_context_check_security_policy (BusContext     *context,
 
   /* See if limits on size have been exceeded */
   if (proposed_recipient &&
-      dbus_connection_get_outgoing_size (proposed_recipient) >
-      context->limits.max_outgoing_bytes)
+      ((dbus_connection_get_outgoing_size (proposed_recipient) > context->limits.max_outgoing_bytes) ||
+       (dbus_connection_get_outgoing_unix_fds (proposed_recipient) > context->limits.max_outgoing_unix_fds)))
     {
       dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
                       "The destination service \"%s\" has a full message queue",