bluez-pin doesn't work with current dbus

Bug #33357 reported by Andre D
This bug report is a duplicate of:  Bug #33338: bluez-utils can't start in dbus mode. Edit Remove
6
Affects Status Importance Assigned to Milestone
bluez-pin (Ubuntu)
Incomplete
Medium
Charles Majola

Bug Description

ubuntu dapper,
bluez-pin: 0.25-1ubuntu2
bluez-utils: 2.24-0ubuntu4
libdbus-glib-1-2: 0.60-6ubuntu3

bluez-pin --dbus doesn't work:
because of incorrect message parsing wrt dbus, bluez-pin doesn't work (assertions in libdbus-glib hit). The following patch fixes this:

--- orig/bluez-pin-0.25/pin-dbus.c 2006-03-02 04:25:10.039853136 +0100
+++ bluez-pin-0.25/pin-dbus.c 2006-03-02 04:27:19.188219600 +0100
@@ -88,24 +88,30 @@

   dbus_message_iter_get_basic (&iter, &out);

- if (! dbus_message_iter_next (&iter))
+ if (! dbus_message_iter_next (&iter)
+ || dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_ARRAY)
     {
       reply = dbus_message_new_error (message, WRONG_ARGS_ERROR,
                                      "Byte array expected but missing");
       goto error;
     }

- type = dbus_message_iter_get_arg_type (&iter);
- dbus_message_iter_get_fixed_array (&iter, &bytes, &nbytes);
-
- if (type != DBUS_TYPE_ARRAY
- || nbytes != sizeof (bdaddr))
+ dbus_message_iter_recurse (&iter, &iter);
+ if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_BYTE)
   {
     reply = dbus_message_new_error (message, WRONG_ARGS_ERROR,
                                    "Byte array expected, other type given");
     goto error;
   }

+ dbus_message_iter_get_fixed_array (&iter, &bytes, &nbytes);
+ if (nbytes != sizeof (bdaddr))
+ {
+ reply = dbus_message_new_error (message, WRONG_ARGS_ERROR,
+ "Invalid array given");
+ goto error;
+ }
+
   memcpy (&bdaddr, bytes, sizeof (bdaddr));

   reply = dbus_message_new_method_return (message);

i.e. a call to dbus_message_iter_recurse() is missing

Andre D (ad-andred)
description: updated
summary: + ubuntu dapper,
+ bluez-pin: 0.25-1ubuntu2
+ bluez-utils: 2.24-0ubuntu4
+ libdbus-glib-1-2: 0.60-6ubuntu3
Matt Zimmerman (mdz)
Changed in bluez-pin:
assignee: nobody → chmj
Revision history for this message
Andres Mujica (andres.mujica) wrote :

Hi can you help me with some steps to reproduce tis bug?

please tell me the error message.

i've got issues with bluez-pin and i want to know if it's the same issue

Changed in bluez-pin:
status: Unconfirmed → Needs Info
Revision history for this message
Andre D (ad-andred) wrote :

I guess this can be closed. A similar patch has been applied upstream.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.