This change is required for passing below PTS testcases:
1. PBAP/PSE/PBD/BV-02-C
2. PBAP/PSE/PBD/BV-03-C
3. PBAP/PSE/PBD/BI-01-C
4. PBAP/PSE/PBD/BV-13-C
5. PBAP/PSE/PBD/BV-14-C
6. PBAP/PSE/PBD/BV-17-C
PTS sends all the GET phonebook requests without extra params.
Therefore, the PBAP server is rejecting the requests with a
'Bad Request' response.
So append 'maxlistcount' as default param in GET request to
avoid testcase failure.
This fix is required for below PTS testcase:
1. PBAP/PCE/SSM/BV-10-C
Description - Verify that the PCE does not share its
PbapSupportedFeatures bits with a legacy server.
Incase of legacy server, check for 'supported features bit'
uint_32_t value instead of directly checking the pointer
holding the attribute.
As pointer 'data' won't be null as PbapSupportedFeatures
attribute is present in SDP record but it's value is zero.
This fix is required for passing below PTS testcases:
1. PBAP/PSE/PBD/BV-05-C
2. PBAP/PSE/PBD/BV-17-C
3. PBAP/PSE/PBB/BV-11-C
Even if the new missed calls value is zero, send it in GET response.
As per the PBAP spec, it is mandatory to include Newmissedcalls
tag in response incase of object name is 'mch.vcf' or 'cch.vcf'.
It will be better to include it in all GET response.
Currently obexd uses session bus.
Distros where session bus is not supported and still obex profiles
are required in that case use system bus instead of session bus
which can be configured at run time.
An Command line option has been added to achieve it.
{ "system-bus", 's', 0, G_OPTION_ARG_NONE, &option_system_bus,
"Use System bus "}
we can use option obexd -s to use system bus.
Instead of emitting the property "Size" from obex_put_stream_start(),
Call the function manager_emit_transfer_property() from plugins/*.c
wherever plugin has transfer object present.
Remove the code from obex.c which is generic for all profiles.
This change resolves the type mismatch issue when calling the
manager_emit_transfer_property from obex.c. We are passing
'os->service_data' of plugin session type but the
manager_emit_transfer_property() expects the 'obex_transfer'
type, therefore size is not set properly and might cause
crash/disconnection.
Retrieves the image corresponding to the handle and the description,
as one of the descriptions retrieved by Properties, and store it in
a local file.
If the "transform" property description exists it should be set
to one of the value listed by Properties for this description.
The cover art image handle is available in the metadata of the track
when the OBEX BIP session is connected to the PSM port provided
in AVRCP SDP record and available as org.bluez.MediaPlayer property.
This service allows to get the thumbnail.
Error: RESOURCE_LEAK (CWE-772): [#def37] [important]
obexd/plugins/pcsuite.c:370:2: alloc_fn: Storage is returned from allocation function "g_path_get_basename".
obexd/plugins/pcsuite.c:370:2: var_assign: Assigning: "obj->cmd" = storage returned from "g_path_get_basename(name)".
obexd/plugins/pcsuite.c:379:3: leaked_storage: Freeing "obj" without freeing its pointer field "cmd" leaks the storage that "cmd" points to.
377|
378| if (send_backup_dbus_message("open", obj, size) == FALSE) {
379|-> g_free(obj);
380| obj = NULL;
381| }
recipient_addressing was never freed.
Error: RESOURCE_LEAK (CWE-772): [#def36] [important]
obexd/plugins/messages-dummy.c:379:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:379:4: var_assign: Assigning: "entry->recipient_addressing" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:404:2: leaked_storage: Freeing "entry" without freeing its pointer field "recipient_addressing" leaks the storage that "recipient_addressing" points to.
402| g_free(entry->attachment_size);
403| g_free(entry->handle);
404|-> g_free(entry);
405| }
406|
Fix possible resource leak if a attribute is repeated, overriding the
original value.
Error: RESOURCE_LEAK (CWE-772): [#def28] [important]
obexd/plugins/messages-dummy.c:362:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:362:4: var_assign: Assigning: "entry->handle" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:362:4: overwrite_var: Overwriting "entry->handle" in "entry->handle = g_strdup_inline(values[i])" leaks the storage that "entry->handle" points to.
360| for (i = 0 ; names[i]; ++i) {
361| if (g_strcmp0(names[i], "handle") == 0) {
362|-> entry->handle = g_strdup(values[i]);
363| mld->size++;
364| continue;
Error: RESOURCE_LEAK (CWE-772): [#def29] [important]
obexd/plugins/messages-dummy.c:367:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:367:4: var_assign: Assigning: "entry->attachment_size" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:367:4: overwrite_var: Overwriting "entry->attachment_size" in "entry->attachment_size = g_strdup_inline(values[i])" leaks the storage that "entry->attachment_size" points to.
365| }
366| if (g_strcmp0(names[i], "attachment_size") == 0) {
367|-> entry->attachment_size = g_strdup(values[i]);
368| continue;
369| }
Error: RESOURCE_LEAK (CWE-772): [#def30] [important]
obexd/plugins/messages-dummy.c:371:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:371:4: var_assign: Assigning: "entry->datetime" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:371:4: overwrite_var: Overwriting "entry->datetime" in "entry->datetime = g_strdup_inline(values[i])" leaks the storage that "entry->datetime" points to.
369| }
370| if (g_strcmp0(names[i], "datetime") == 0) {
371|-> entry->datetime = g_strdup(values[i]);
372| continue;
373| }
Error: RESOURCE_LEAK (CWE-772): [#def31] [important]
obexd/plugins/messages-dummy.c:375:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:375:4: var_assign: Assigning: "entry->subject" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:375:4: overwrite_var: Overwriting "entry->subject" in "entry->subject = g_strdup_inline(values[i])" leaks the storage that "entry->subject" points to.
373| }
374| if (g_strcmp0(names[i], "subject") == 0) {
375|-> entry->subject = g_strdup(values[i]);
376| continue;
377| }
Error: RESOURCE_LEAK (CWE-772): [#def32] [important]
obexd/plugins/messages-dummy.c:379:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:379:4: var_assign: Assigning: "entry->recipient_addressing" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:379:4: overwrite_var: Overwriting "entry->recipient_addressing" in "entry->recipient_addressing = g_strdup_inline(values[i])" leaks the storage that "entry->recipient_addressing" points to.
377| }
378| if (g_strcmp0(names[i], "recipient_addressing") == 0) {
379|-> entry->recipient_addressing = g_strdup(values[i]);
380| continue;
381| }
Error: RESOURCE_LEAK (CWE-772): [#def33] [important]
obexd/plugins/messages-dummy.c:383:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:383:4: var_assign: Assigning: "entry->sender_addressing" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:383:4: overwrite_var: Overwriting "entry->sender_addressing" in "entry->sender_addressing = g_strdup_inline(values[i])" leaks the storage that "entry->sender_addressing" points to.
381| }
382| if (g_strcmp0(names[i], "sender_addressing") == 0) {
383|-> entry->sender_addressing = g_strdup(values[i]);
384| continue;
385| }
Error: RESOURCE_LEAK (CWE-772): [#def34] [important]
obexd/plugins/messages-dummy.c:387:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:387:4: var_assign: Assigning: "entry->type" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:387:4: overwrite_var: Overwriting "entry->type" in "entry->type = g_strdup_inline(values[i])" leaks the storage that "entry->type" points to.
385| }
386| if (g_strcmp0(names[i], "type") == 0) {
387|-> entry->type = g_strdup(values[i]);
388| continue;
389| }
Error: RESOURCE_LEAK (CWE-772): [#def35] [important]
obexd/plugins/messages-dummy.c:391:4: alloc_fn: Storage is returned from allocation function "g_strdup_inline".
obexd/plugins/messages-dummy.c:391:4: var_assign: Assigning: "entry->reception_status" = storage returned from "g_strdup_inline(values[i])".
obexd/plugins/messages-dummy.c:391:4: overwrite_var: Overwriting "entry->reception_status" in "entry->reception_status = g_strdup_inline(values[i])" leaks the storage that "entry->reception_status" points to.
389| }
390| if (g_strcmp0(names[i], "reception_status") == 0)
391|-> entry->reception_status = g_strdup(values[i]);
392| }
393|
To not leak "buf", we need object->buffer to take ownership of it using
g_string_new_take() (but it's only available in 2.78 and newer), or we
need to actually free "buf".
Error: RESOURCE_LEAK (CWE-772): [#def66] [important]
obexd/plugins/filesystem.c:411:3: alloc_arg: "g_file_get_contents" allocates memory that is stored into "buf".
obexd/plugins/filesystem.c:418:3: noescape: Resource "buf" is not freed or pointed-to in "g_string_new".
obexd/plugins/filesystem.c:440:2: leaked_storage: Variable "buf" going out of scope leaks the storage it points to.
438| *err = 0;
439|
440|-> return object;
441|
442| fail:
This is the comment for g_dbus_emit_property_changed()
/*
* Note that when multiple properties for a given object path are changed
* in the same mainloop iteration, they will be grouped with the last
* property changed. If this behaviour is undesired, use
* g_dbus_emit_property_changed_full() with the
* G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH flag, causing the signal to ignore
* any grouping.
*/
When receiving a "small file" through Bluetooth, When using Blueman to
transfer files to the configured directory, "small files" in the cache
will not be moved to the configured directory. Debugging found that the
three properties "Size" "Transferred" and "complete" were reported at once
through the g_dbus_emit_property_changed function, but the "Size" property
did not have a value, it appears that there are the following errors
"UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 0:
invalid start byte" in Blueman log.
So let the "Size" property use g_dbus_emit_property_changed_full to
single emit, if use g_dbus_emit_property_changed(grouped)to emit,
there is a possibility that "Size" property value has been freed
The following is the issue log
dbus-monitor log:
signal time=1710900297.140618 sender=:1.50 -> destination=(null)
serial=59 path=/org/bluez/obex/server/session4/transfer3;
interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.obex.Transfer1"
array [
dict entry(
string "Status"
variant string "complete"
)
dict entry(
string "Transferred"
variant uint64 0
)
]
array [
string "Size"
]
method call time=1710900297.141361 sender=:1.39 -> destination=:1.50
serial=417 path=/org/bluez/obex/server/session4/transfer3;
interface=org.freedesktop.DBus.Properties; member=Get
string "org.bluez.obex.Transfer1"
string "Size"
error time=1710900297.141596 sender=:1.50 -> destination=:1.39
error_name=org.freedesktop.DBus.Error.InvalidArgs reply_serial=417
string "No such property 'Size'"
blueman log
blueman.desktop[2368]: blueman-applet 09.42.04 DEBUG
Transfer:25 do_g_properties_changed: /org/bluez/obex/server/session2/
transfer1 Transferred 0
blueman.desktop[2368]: blueman-applet 09.42.04 DEBUG
Base:74 do_g_properties_changed: /org/bluez/obex/server/session2
{'Source': 'xxx', 'Destination': 'xxx', 'Root': 'xxx/.cache/obexd'}
blueman.desktop[2368]: blueman-applet 09.42.04 ERROR
TransferService:97 _authorize_push: Failed to get StatusIcon
blueman.desktop[2368]: blueman-applet 09.42.15 INFO
Notification:239 do_g_signal: accept
blueman.desktop[2368]: blueman-applet 09.42.15 INFO
TransferService:57 on_action : Action accept
blueman.desktop[2368]: blueman-applet 09.42.15 INFO
Notification:239 do_g_signal: 3
blueman.desktop[2368]: blueman-applet 09.42.15 DEBUG
Notification:247 do_g_signal: The notification was closed by a call
to CloseNotification.
blueman.desktop[2368]:UnicodeDecodeError: 'utf-8' codec can't decode byte
0xb5 in position 0: invalid start byte
blueman.desktop[2368]: blueman-applet 09.42.15 INFO
Manager:73 _on_object_removed: /org/bluez/obex/server/session2/transfer1
blueman.desktop[2368]: blueman-applet 09.42.15 INFO
Manager:80 _on_object_removed: /org/bluez/obex/server/session2
After fix, The following log
dbus-monitor log:
signal time=1711000976.672383 sender=:1.724 -> destination=(null)
serial=18 path=/org/bluez/obex/server/session1/transfer0;
interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.obex.Transfer1"
array [
dict entry(
string "Size"
variant uint64 50
)
]
array [
]
signal time=1711000976.672483 sender=:1.724 -> destination=(null)
serial=19 path=/org/bluez/obex/server/session1/transfer0;
interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.obex.Transfer1"
array [
dict entry(
string "Status"
variant string "complete"
)
dict entry(
string "Transferred"
variant uint64 0
)
]
array [
]
blueman log
blueman.desktop[2368]: blueman-applet 14.13.29 DEBUG
Transfer:25 do_g_properties_changed: /org/bluez/obex/server/session2/
transfer1 Transferred 0
blueman.desktop[2368]: blueman-applet 14.13.29 DEBUG
Base:74 do_g_properties_changed: /org/bluez/obex/server/session2
{'Source': 'xxx', 'Destination': 'xxx', 'Root': 'xxx'}
blueman.desktop[2368]: blueman-applet 14.13.29 ERROR
TransferService:97 _authorize_push: Failed to get StatusIcon
blueman.desktop[2368]: blueman-applet 14.13.36 INFO
Notification:239 do_g_signal: accept
blueman.desktop[2368]: blueman-applet 14.13.36 INFO
TransferService:57 on_action : Action accept
blueman.desktop[2368]: blueman-applet 14.13.36 INFO
Notification:239 do_g_signal: 3
blueman.desktop[2368]: blueman-applet 14.13.36 DEBUG
Notification:247 do_g_signal: The notification was closed by a call to
CloseNotification.
blueman.desktop[2368]: blueman-applet 14.13.36 DEBUG
Transfer:25 do_g_properties_changed: /org/bluez/obex/server/session2/
transfer1 Size 50
blueman.desktop[2368]: blueman-applet 14.13.36 DEBUG
Transfer:25 do_g_properties_changed: /org/bluez/obex/server/session2/
transfer1 Status complete
blueman.desktop[2368]: blueman-applet 14.13.36 INFO
Manager:86 _on_transfer_completed: /org/bluez/obex/server/session2/
transfer1 True
blueman.desktop[2368]: blueman-applet 14.13.36 INFO
TransferService:275 _on_transfer_completed: Destination file exists,
renaming to: xxx.txt
blueman.desktop[2368]: blueman-applet 14.13.36 ERROR
TransferService:256 _notify_kwargs: No statusicon found
blueman.desktop[2368]: blueman-applet 14.13.36 INFO
TransferService:241 _add_open : adding action
blueman.desktop[2368]: blueman-applet 14.13.36 DEBUG
Transfer:25 do_g_properties_changed: /org/bluez/obex/server/session2/
transfer1 Transferred 0
blueman.desktop[2368]: blueman-applet 14.13.36 INFO
Manager:73 _on_object_removed: /org/bluez/obex/server/session2/transfer1
blueman.desktop[2368]: blueman-applet 14.13.36 INFO
Manager:80 _on_object_removed: /org/bluez/obex/server/session2
Signed-off-by: Youwan Wang <youwan@nfschina.com>
With earlier commit, we've used exec_dir to reference the path of obexd
and bluetoothd within the service files.
At the same time, in my testing I was providing the complete path on the
configure command line. As result, things just worked.
In the default case, the variable contains relative references to ${}
variables, which as result end up literal in the services. Ultimately
the service files were broken.
Document are reuse the existing pattern of manually expanding the
variables.
Fixes: https://github.com/bluez/bluez/issues/736
Not all sessions run systemd --user and in some cases one may be missing
systemd all together.
Provide the correct path instead of /bin/false, allowing dbus to start
the service in such cases.
DBUS implementations can ignore the Exec line all together when run in
systemd aware mode - at least the OG dbus does that. So ultimately this
change is a no-op for the systemd --user case.
On my system, this is literally the only non-system service which uses
/bin/false.
As a whole all plugins should be built-in, otherwise they would be using
internal, undocumented, unversioned, unstable API.
Flesh out the external plugin support into a few blocks and simplify the
normal path. Guard the external plugin support behind a runtime check,
which will be dead-code eliminated in the default case.
Hide the internal API (omit export-dynamic) when built without external
plugins.
Considering we do basic substitution, we don't need to manually sed,
track dependencies, dist nor clean. Just add the files to
AC_CONFIG_FILES() call it a day - it does everything for us.
All the drivers use the default function, where the register function
modifies what should be a constant vtable.
Instead let's remove the indirection, export and use the function as
applicable.
Since we have set and reset, export both functions and cleanup the
users.
Primary/Secundary Counters are supposed to be 16 bytes values, if the
server has implemented them incorrectly it may lead to the following
crash:
=================================================================
==31860==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x607000001878 at pc 0x7f95a1575638 bp 0x7fff58c6bb80 sp 0x7fff58c6b328
READ of size 48 at 0x607000001878 thread T0
#0 0x7f95a1575637 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860
#1 0x7f95a1575ba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:892
#2 0x7f95a1575ba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:887
#3 0x564df69c77a0 in read_version obexd/client/pbap.c:288
#4 0x564df69c77a0 in read_return_apparam obexd/client/pbap.c:352
#5 0x564df69c77a0 in phonebook_size_callback obexd/client/pbap.c:374
#6 0x564df69bea3c in session_terminate_transfer obexd/client/session.c:921
#7 0x564df69d56b0 in get_xfer_progress_first obexd/client/transfer.c:729
#8 0x564df698b9ee in handle_response gobex/gobex.c:1140
#9 0x564df698cdea in incoming_data gobex/gobex.c:1385
#10 0x7f95a12fdc43 in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55c43)
#11 0x7f95a13526c7 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0xaa6c7)
#12 0x7f95a12fd2b2 in g_main_loop_run (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x552b2)
#13 0x564df6977d41 in main obexd/src/main.c:307
#14 0x7f95a10a7d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#15 0x7f95a10a7e3f in __libc_start_main_impl ../csu/libc-start.c:392
#16 0x564df6978704 in _start (/usr/local/libexec/bluetooth/obexd+0x8b704)
0x607000001878 is located 0 bytes to the right of 72-byte region [0x607000001830,0x607000001878)
allocated by thread T0 here:
#0 0x7f95a1595a37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
#1 0x564df69c8b6a in pbap_probe obexd/client/pbap.c:1259
The obex agent will return only one error message at the same time.So
we should use if-elseif instead of multi-if to check error message which
maybe DEBUG_ERROR_NO_REPLY or OBEX_ERROR_REJECT in agent_reply().
The obex agent usually returns the full path by getting the default
folder and filename from the Filename property of the transfer object
which is not convenient.
The patch helps that the obex agent can return the folder name suffixed
with '/' or new full path or even null which will use the default name
if new_name is NULL and the default folder if the new_folder is NULL in
opp_chkput().
It will accept file when obex agent replied any message
event though the message is org.bluez.obex.Error.Rejected.
The patch helps to reject a Bluetooth object push request if
user replied "org.bluez.obex.Error.Rejected" message according
to the doc/obex-agent-api.txt.
xfer_complete (obex=0x557d242c8cf0, err=0x557d242ca470,
user_data=0x557d242ca300) at obexd/client/transfer.c:659
659 obexd/client/transfer.c:
(gdb) n
661 in obexd/client/transfer.c
(gdb) n
663 in obexd/client/transfer.c
(gdb) p callback->func
$1 = (transfer_callback_t) 0x0
(gdb) n
668 in obexd/client/transfer.c
(gdb) n
671 in obexd/client/transfer.c
(gdb) n
672 in obexd/client/transfer.c
(gdb) n
676 in obexd/client/transfer.c
(gdb) n
677 in obexd/client/transfer.c
(gdb) n
0x0000000000000000 in ?? ()
(gdb) s
Cannot find bounds of current function
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
Reported by coverity tool as follows:
bluez-5.64/obexd/client/pbap.c:929: leaked_storage: Variable "apparam"
going out of scope leaks the storage it points to.
This replaces the uses of g_memdup with util_memdup since the former has
been deprecated:
warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead
[-Wdeprecated-declarations]
g_memdup2 requires bumping glib version which would likely have its
own problems thus why util_memdup was introduced.
Some PTS clients do not send all the mandatory apparams
when retrieving the phonebook. Clients such as car multimedia systems
cannot be fixed, therefore working around this issue by inserting
default apparams which makes these clients work as well.
Modernize PBAP phonebook-ebook plugin for newer libebook version
of the Evolution Data Server.
The ebook plugin was introduced during GSoC 2011 [1] and allows
BlueZ to share contacts stored in the Evolution Data Server to
connected clients such as car multimedia systems.
With the rise of Mobile Linux thanks to the PinePhone and Librem 5,
this plugin was modernized to compile with newer libebook versions
because the API was changed [2].
[1] http://www.bluez.org/gsoc-eds-backend-of-phonebook-access-profilepbap/
[2] https://wiki.gnome.org/Apps/Evolution/ESourceMigrationGuide
This patch fixes a couple memory leaks.
In filesystem, g_file_get_contents allocates fresh memory to buf.
It needs to be freed after conversion to a GString object.
Destination was missed on an error path as is mld.
obexd/src/main.c: In function 'main':
obexd/src/main.c:237:13: warning: Deprecated pre-processor symbol
237 | if (g_thread_supported() == FALSE)
| ^~~~~~~~~~~~~~~~~~~~~~~
obexd/src/main.c:238:3: warning: 'g_thread_init' is deprecated
[-Wdeprecated-declarations]
238 | g_thread_init(NULL);
| ^~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib.h:111,
from obexd/src/main.c:31:
/usr/include/glib-2.0/glib/deprecated/gthread.h:261:10: note: declared here
261 | void g_thread_init (gpointer vtable);
| ^~~~~~~~~~~~~
When files are to be placed not in libexecdir but a subdirectory of
it, automake has a variable name reserved for exactly that purpose
(and a default value, which Makefile.am will override), called
pkglibexecdir. Let's use it.
On failure to open plugin directory, memory allocated to 'patterns'
and 'excludes' is not being freed, and the following memory leak is
logged:
Direct leak of 28 byte(s) in 1 object(s) allocated from:
#0 0xb6aa1c49 in malloc (/usr/lib/liblsan.so+0x9c49)
#1 0xb6976e89 in g_malloc (/lib/libglib-2.0.so.0+0x3ae89)
#2 0xb69886f1 in g_strsplit_set (/lib/libglib-2.0.so.0+0x4c6f1)
#3 0xb6f82f3b in plugin_init (/usr/libexec/bluetooth/obexd+0x20f3b)
#4 0xb6f70dc9 in main (/usr/libexec/bluetooth/obexd+0xedc9)
Due to using g_dbus_emit_property_changed() and g_dbus_get_properties(),
obex_dbus_signal_property_changed() is unused since commit 96063756
("obex-client: Rename org.bluez.obex.Transfer to Transfer1"), and
OBC_PROPERTIES_ARRAY_SIGNATURE macro is unused since commit 3eadc034
("obex-client: Make use of g_dbus_get_properties to get transfer properties").
Prints out "<unknown>" string if there is no response name as below:
obexd[8117]: obexd/src/obex.c:cmd_connect()
obexd[8117]: CONNECT(0x0), (null)(0xffffffff)