Commit Graph

14449 Commits

Author SHA1 Message Date
Szymon Janc
46d9e2693d neard: Restrict method calls only to neard process
Disallow methods calls from processes other than registered to as
agent.
2013-02-15 16:28:48 +02:00
Szymon Janc
66d880d232 neard: Use service name and not boolean to track if registered to neard 2013-02-15 16:28:06 +02:00
Johan Hedberg
30e2aaa3f8 gobex: Fix GPL version reference
These files (like everything else in the tree) should be GPL 2 or later
instead of GPL 2 only.
2013-02-15 16:25:29 +02:00
Johan Hedberg
c2e5d1ff16 unit: Fix gobex GPL version reference
These files (like everything else in the tree) should be GPL 2 or later
instead of GPL 2 only.
2013-02-15 16:19:54 +02:00
Szymon Janc
fa1f04c2be adapter: Fix registering adapter with no address
adapter->bdaddr is set later in read_info_complete and current check
always returns false. Check against bdaddr received in command response
instead and fail if it is all zeros.
2013-02-15 14:21:58 +02:00
Luiz Augusto von Dentz
7a89fd1d9b A2DP: Fix invalid write
Invalid write of size 8
   at 0x41F297: setconf_cfm (a2dp.c:567)
   by 0x42526B: session_cb (avdtp.c:3176)
   by 0x39B0847A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x39B0847D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x39B0848181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x409C3E: main (main.c:583)
 Address 0x555fda8 is 40 bytes inside a block of size 88 free'd
   at 0x4A077A6: free (vg_replace_malloc.c:446)
   by 0x39B084D79E: g_free (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x41E217: setup_cb_free (a2dp.c:191)
   by 0x41E410: finalize_config (a2dp.c:234)
   by 0x41F296: setconf_cfm (a2dp.c:566)
   by 0x42526B: session_cb (avdtp.c:3176)
   by 0x39B0847A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x39B0847D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x39B0848181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x409C3E: main (main.c:583)
2013-02-15 12:57:28 +02:00
Luiz Augusto von Dentz
e13cd2f762 core: Fix calling profile .connect multiple times
Sometimes profiles may complete the connection in different order
than expected so the code has to check if it was actually the
current pending profile to proceed to the next.
2013-02-15 12:51:45 +02:00
Szymon Janc
6960cb73b2 hostname: Fallback to static hostname if pretty hostname is not set
If pretty hostname is not set fallback to static hostname (if it is
set). If static or pretty hostname is not set appropriate properties
are empty strings not NULLs. This behaviour is recomended by hostnamed.
2013-02-15 12:50:41 +02:00
Szymon Janc
f0c8fed306 hostname: Fix setting adapter name to empty string
If pretty hostname is not set empty string is received. Don't update
adapters' names is such case.
2013-02-15 12:48:35 +02:00
Szymon Janc
c13aee2b1f adapter: Always set new default adapter if current one is removed
In case hci_get_route() failed mark first adapter on list as default.
This make sure default adapter is always set and that
btd_adapter_get_default will not return NULL if at least one adapter
is registered.
2013-02-15 12:44:02 +02:00
Szymon Janc
e83bd0b824 adapter: Mark adapter as default before probing drivers
Drivers may depends on adapter being default or not. This fix hostname
plugin setting default adapter name to 'foo #1' instead of 'foo' if
pretty hostname was received before probing adapter drivers.
2013-02-15 12:43:36 +02:00
Szymon Janc
df0ad3ecb6 adapter: Add is_default field to struct btd_adapter
Instead of global default_adapter_id variable use is_default field
to indicate if adapter is default one.
2013-02-15 12:43:11 +02:00
Anderson Lizardo
1e66934e9d core: Remove unused code from device_browse_sdp()
The "search" parameter was always NULL, and therefore code depending on
it being non-NULL will never be reached.
2013-02-15 12:40:42 +02:00
Anderson Lizardo
6cf4291ff3 lib: Check if SDP buffer has enough data on partial responses
Before manipulating data from previous partial responses, make sure the
buffer has enough data.
2013-02-15 12:38:41 +02:00
Anderson Lizardo
1796f00e84 lib: Add range check for SDP_SVC_ATTR_RSP/SDP_SVC_SEARCH_ATTR_RSP
According to SDP spec, the byte count fields for these PDUs have a valid
range of 0x0002-0xFFFF.
2013-02-15 12:37:03 +02:00
Anderson Lizardo
870fe03a79 lib: Fix buffer overflow when processing SDP response
rsp_count is either read or calculated from untrusted input, and
therefore needs to be checked before being used as offset. The "plen"
variable is appropriate because it is calculated as the sum of fixed and
variable length fields, excluding the continuation state field, which
has at least 1 byte for its own length field.
2013-02-15 12:36:42 +02:00
Antonio Ospite
0d989313b3 core: Use device_set_trusted() in set_trust() 2013-02-15 11:26:17 +02:00
Antonio Ospite
b8a15d6ae4 core: Add a device_set_trusted() function
This will be useful for plugins that do their own device setup (e.g.
USB-based pairing).
2013-02-15 11:25:42 +02:00
Szymon Janc
4345fd9154 neard: Add support for setting power state in RequestOOB reply
This allows neard to properly set Bluetooth carrier power state in
handover message.
2013-02-15 10:42:21 +02:00
Szymon Janc
5711d95c6d adapter: Add btd_adapter_get_connectable function 2013-02-15 10:41:29 +02:00
Szymon Janc
127b948210 neard: Check if adapter is powered in PushOOB
For PushOOB adapter needs to be powered as bluetoothd daemon is
expected to perform action on success.
2013-02-15 10:41:22 +02:00
Szymon Janc
26653cd175 adapter: Add btd_adapter_get_powered function 2013-02-15 10:41:00 +02:00
Szymon Janc
d5672b8869 neard: Move pairable check from check_adapter
If device is already paired there is no need to fail with handover
if adapter is not pairable.
2013-02-15 10:40:23 +02:00
Szymon Janc
fe7f8fd83a neard: Add ability to parse 'State' field
This contains hint for power state of remote device Bluetooth adapter.
2013-02-15 10:38:49 +02:00
Szymon Janc
ac83286bb2 neard: Refactor message processing
This refactor code for message processing for future feature addition.
nokia.com:bt and EIR processing is now separated from performing
actions based on received data.
2013-02-15 10:37:55 +02:00
Szymon Janc
2cf03cc883 neard: Adjust errors to latest API changes
neard Handover API was stripped of not really usefull error codes.
2013-02-15 10:36:17 +02:00
Denis Kenzior
906ba9c555 gdbus: Add g_dbus_proxy_set_removed_watch 2013-02-15 01:03:47 +01:00
Luiz Augusto von Dentz
404d8b1429 tools: Fix hcidump parser of AVRCP GetItemAttributes command 2013-02-14 17:36:17 +02:00
Luiz Augusto von Dentz
849648b8b0 tools: Fix hcidump parser of AVRCP media attributes 2013-02-14 17:30:44 +02:00
Luiz Augusto von Dentz
d60a09d61c tools: Print UID of track changed event
Before 1.4 this was considered reserved but now it is being used for
UID of the current track.
2013-02-14 17:30:44 +02:00
Vinicius Costa Gomes
af28ffb29a gdbus: Fix missing PropertiesChanged signal
If D-Bus ObjectManager is not supported, InterfacesAdded signal
checking needs to be ignored otherwise PropertiesChanged signal
will never be sent.
2013-02-14 15:59:35 +02:00
Luiz Augusto von Dentz
c1ebdbef67 tools: Track transport state if player status is not supported
This makes PlayPause method to work properly even if remote device
supports only AVRCP 1.0.
2013-02-14 10:49:11 +02:00
Szymon Janc
18fed70a6c doc: Add missing device RSSI property
RSSI property was not documented in device API.
2013-02-14 09:16:48 +02:00
Szymon Janc
47fc3389d1 doc: Remove CancelConnect function from device API
This method is not implemented and Disconnect can be used instead.
2013-02-14 09:16:48 +02:00
Szymon Janc
8eafe2e8a9 doc: Fix device disconnect description
Document what Disconnect() function actually does.
2013-02-14 09:16:48 +02:00
Szymon Janc
35d4c4fb44 doc: Clarify device connect description
Describe behaviour when some profiles are already connected. Clarify
that it returns success if at least one profile was connected.
2013-02-14 09:16:47 +02:00
Mikel Astiz
df1c61b817 transport: Fix inconsistent transport state
If a2dp_resume() fails, the transport state should not be modified. It
would otherwise enter an incosistent state where the transport will be
impossible to resume, since acquire() will see the transport in
TRANSPORT_STATE_REQUESTING state and will thus return
btd_error_not_authorized().
2013-02-13 16:28:35 +02:00
Marcel Holtmann
516bae4d53 monitor: Add commands, events and features from CSA4 2013-02-12 21:23:32 +01:00
Johan Hedberg
ab2611a6e3 man: Remove misleading reference to main.conf man page 2013-02-11 21:28:54 +02:00
Marcel Holtmann
3767c5e9db gdbus: Don't call property changed callback during client init
When the client uses ObjectManager to init properties, do not call
property changed callbacks. They should only be called once the proxy
added has been successfully signaled since the proxy itself provides
a full copy of available properties.
2013-02-11 20:19:10 +01:00
Johan Hedberg
ab34d7b754 tools: Add mgmt-tester command line option to control power on wait 2013-02-11 14:00:43 +02:00
Luiz Augusto von Dentz
1090c954ec test: Add -p/--push option to map-client
This option can be used to push messages, it takes as a parameter a
file location which should contain the message in bmsg format.
2013-02-07 13:49:00 +02:00
Christian Fetzer
e859c03231 obexd: Add PushMessage
Push message has been implemented similar to send file (OPP),
the message to send (in bMessage format) is read from a file.
2013-02-07 13:49:00 +02:00
Johan Hedberg
e9c1672ada test: Fix missing call to parser.parse_args() in test-proximity 2013-02-04 14:29:15 +02:00
Szymon Janc
d1fbda1e15 shared: Fix use after free in read_watch_destroy
read_watch_destroy is called when received_data returns FALSE.
free mgmt in read_watch_destroy instead of received_data to avoid
use after free.

Invalid write of size 4
   at 0x8051604: read_watch_destroy (mgmt.c:271)
   by 0x48C7468E: g_source_callback_unref (gmain.c:1457)
   by 0x48C77287: g_main_context_dispatch (gmain.c:2723)
   by 0x48C774FF: g_main_context_iterate.isra.22 (gmain.c:3290)
   by 0x48C77962: g_main_loop_run (gmain.c:3484)
   by 0x805393E: tester_run (tester.c:784)
   by 0x804D1C7: main (mgmt-tester.c:2558)
 Address 0x4039b80 is 16 bytes inside a block of size 76 free'd
   at 0x4007F0F: free (vg_replace_malloc.c:446)
   by 0x48C7D44B: standard_free (gmem.c:98)
   by 0x48C7D607: g_free (gmem.c:252)
   by 0x8051BB6: received_data (mgmt.c:337)
   by 0x48CBA72E: g_io_unix_dispatch (giounix.c:167)
   by 0x48C7715A: g_main_context_dispatch (gmain.c:2715)
   by 0x48C774FF: g_main_context_iterate.isra.22 (gmain.c:3290)
   by 0x48C77962: g_main_loop_run (gmain.c:3484)
   by 0x805393E: tester_run (tester.c:784)
   by 0x804D1C7: main (mgmt-tester.c:2558)
2013-02-03 12:44:59 +01:00
Marcel Holtmann
f5c43df669 monitor: Decode supported commands result 2013-02-02 11:21:50 +01:00
Marcel Holtmann
37b90a9581 monitor: Fix wrong supported commands bit value 2013-02-02 11:21:50 +01:00
Johan Hedberg
b0dfcc41f7 tools: Fix mgmt-tester LE expected supported settings 2013-02-02 08:50:40 +00:00
Johan Hedberg
de3cadbf40 tools: Add basic mgmt_set_local_name EIR test case 2013-02-02 08:50:39 +00:00
Johan Hedberg
6f3c1e7a42 core: Use more compact definitions for zero-tail byte arrays 2013-02-02 08:50:39 +00:00