Commit Graph

1411 Commits

Author SHA1 Message Date
Giovanni Campagna
b16b19885c Allow using obexd without systemd in the user session
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.
2024-02-13 08:38:49 -05:00
Emil Velikov
004b5b28a0 obexd: factor out external plugin support
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.
2024-01-29 13:50:51 -05:00
Emil Velikov
116524c01d build: manage .service.in files via configure.ac
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.
2024-01-25 13:46:11 -05:00
Emil Velikov
e0c64a2031 obexd: const annotate obex_plugin_desc entrypoint 2024-01-19 15:51:12 -05:00
Emil Velikov
ac1d2369b2 obexd: const annotate misc immutable data 2024-01-19 15:51:11 -05:00
Emil Velikov
c968fe691d obexd: const obex_transport_driver instances and API 2024-01-19 15:51:09 -05:00
Emil Velikov
ae8f9c9560 obexd: const obex_service_driver instances and API 2024-01-19 15:49:03 -05:00
Emil Velikov
0c3c674033 obexd: const obex_mime_type_driver instances and API 2024-01-19 15:49:01 -05:00
Emil Velikov
8e88f8ceca obexd: remove obex_mime_type_driver::set_io_watch
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.
2024-01-19 15:46:15 -05:00
Luiz Augusto von Dentz
5ab5352531 pbap: Fix not checking Primary/Secundary Counter length
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
2023-09-20 14:06:12 -07:00
Guiting Shen
9a0acc7984 obexd: agent: Use if-elseif instead of multi-if to check error message
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().
2023-04-21 14:06:13 -07:00
Guiting Shen
d361604594 obexd: AuthorizePush: Support to return folder name for file storage
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().
2023-04-20 16:15:16 -07:00
Aaron_shen
338ba4352b obexd: reject to accept file when replying reject message
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.
2023-03-21 08:52:11 -07:00
Youwan Wang
575778a45f obexd: Fix the code style 2022-07-05 10:09:57 -07:00
wangyouwan
c6d3bcf3d0 obexd: Fix callback->func =! NULL in the xfer_complete() func
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.
2022-06-13 11:03:48 -07:00
Gopal Tiwari
06d3c7429a pbap: Fix memory leak
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.
2022-05-31 13:08:57 -07:00
Luiz Augusto von Dentz
cfab569484 build: Replace use of g_memdup with util_memdup
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.
2022-01-06 12:58:39 -08:00
Tedd Ho-Jeong An
96ffb02e2b obexd: Fix unchecked return value
This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.
2021-10-18 15:31:55 -07:00
Hannu Mallat
bb27e5e1be obexd: phonebook: Set default apparams for PTS clients
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.
2021-07-23 14:47:37 -07:00
Dylan Van Assche
bdeaad3fa0 obexd: phonebook-ebook: modernize
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
2021-07-23 14:47:37 -07:00
Steve Grubb
8b51fbcba9 Fix memory leaks in obex
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.
2021-05-19 10:51:47 -07:00
Luiz Augusto von Dentz
fc0875a4a0 obex: Fix warnings cause by using of deprecated APIs
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);
      |          ^~~~~~~~~~~~~
2021-04-02 10:50:53 -07:00
Brian Gix
c8a47b6d67 obexd: Cleanup deprecated symbolic file permissions 2021-02-23 16:59:46 -08:00
Tedd Ho-Jeong An
ee6d9e71c6 obexd: Add SPDX License Identifier
This patch adds SPDX License Identifier and removes the license text.

-------------------------------------
       License            COUNT
-------------------------------------
 GPL-2.0-or-later     :     65

License: GPL-2.0-or-later
   obexd/src/mimetype.c
   obexd/src/transport.h
   obexd/src/server.c
   obexd/src/obex.c
   obexd/src/log.h
   obexd/src/service.h
   obexd/src/plugin.h
   obexd/src/plugin.c
   obexd/src/main.c
   obexd/src/mimetype.h
   obexd/src/transport.c
   obexd/src/obexd.h
   obexd/src/obex.h
   obexd/src/obex-priv.h
   obexd/src/log.c
   obexd/src/map_ap.h
   obexd/src/manager.c
   obexd/src/service.c
   obexd/src/server.h
   obexd/src/manager.h
   obexd/plugins/opp.c
   obexd/plugins/vcard.h
   obexd/plugins/pbap.c
   obexd/plugins/vcard.c
   obexd/plugins/messages.h
   obexd/plugins/phonebook.h
   obexd/plugins/pcsuite.c
   obexd/plugins/messages-tracker.c
   obexd/plugins/phonebook-tracker.c
   obexd/plugins/irmc.c
   obexd/plugins/ftp.c
   obexd/plugins/ftp.h
   obexd/plugins/filesystem.c
   obexd/plugins/messages-dummy.c
   obexd/plugins/phonebook-ebook.c
   obexd/plugins/syncevolution.c
   obexd/plugins/bluetooth.c
   obexd/plugins/phonebook-dummy.c
   obexd/plugins/filesystem.h
   obexd/plugins/mas.c
   obexd/client/transport.h
   obexd/client/opp.c
   obexd/client/pbap.c
   obexd/client/transfer.h
   obexd/client/opp.h
   obexd/client/driver.c
   obexd/client/map-event.h
   obexd/client/bluetooth.h
   obexd/client/sync.h
   obexd/client/transport.c
   obexd/client/pbap.h
   obexd/client/driver.h
   obexd/client/transfer.c
   obexd/client/ftp.c
   obexd/client/map.h
   obexd/client/ftp.h
   obexd/client/bluetooth.c
   obexd/client/manager.c
   obexd/client/session.h
   obexd/client/session.c
   obexd/client/map.c
   obexd/client/sync.c
   obexd/client/map-event.c
   obexd/client/mns.c
   obexd/client/manager.h
2020-09-21 16:19:35 -07:00
Matt Ranostay
5babd423e5 obex: report notification status on incoming message
To match doc/obex.txt on incoming message notification the respective
Status field should be set.
2020-02-11 12:53:10 -08:00
Marcel Holtmann
261948090e build: Move declaration of _GNU_SOURCE back into individual source files 2018-12-06 21:28:18 +01:00
Jan Engelhardt
78bce48009 build: rename libexecdir to pkglibexecdir
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.
2018-11-21 13:22:33 +02:00
Marcel Holtmann
39eae9988a obex: Fix compiler warning from casting functions 2018-05-24 15:46:16 +02:00
Sahil Pai
87f4b56b01 obexd: Fix memory leak when loading plugins
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)
2018-05-07 11:26:33 +03:00
ERAMOTO Masaya
53f064d5c4 obexd: Remove unused source/header files for dbus
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").
2018-03-01 10:49:05 +02:00
ERAMOTO Masaya
2bb5392474 obexd: Use g_dbus_dict_append_entry() 2018-03-01 10:49:05 +02:00
ERAMOTO Masaya
c361096818 obexd: Fix null response name
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)
2018-02-14 12:50:31 +02:00
ERAMOTO Masaya
bb16051518 obexd: Emit Size property of transfer after open()
Emits the Size property of transfer after calling ->open() because it
may update the size information.
2018-02-12 13:36:09 +02:00
ERAMOTO Masaya
3e9617fcd8 obexd: Use emitting function wrapped for transfer
Also replaces emit_transfer_progress() with the new wrapper function
because the total/transferred arguments have not been used since commit
a5c2b6e8 ("obexd: Align client and server spec of org.bluez.obex.Transfer1")
and g_dbus_emit_property_changed_full() checks if the path argument is
NULL.
2018-02-12 13:35:33 +02:00
Luiz Augusto von Dentz
7c85e85a65 obexd: Fix property Size of server transfer
OBJECT_SIZE_DELETE is shall not be consider a valid size.
2018-01-24 11:06:16 -02:00
ERAMOTO Masaya
4017e79914 obexd: Clean up unneeded list in src/obex.c
Cleans up the sessions list which has been unneeded by commit 8572afb4
("obexd: Make use of transport drivers and some cleanups").
2018-01-23 15:41:01 -02:00
ERAMOTO Masaya
d84bd7754b obexd: Fix crash when canceling without agent
When obexd is started with the option auto-accept or the agent is killed
after starting to transfer a file, obexd crashes due to cancellation of
the transfer from a client as below:

  Process terminating with default action of signal 11 (SIGSEGV)
   Access not within mapped region at address 0x0
     at 0x158A40: transfer_cancel (manager.c:272)
     by 0x18A5D2: process_message.isra.4 (object.c:259)
     by 0x18AE44: generic_message (object.c:1079)
     by 0x5290FD2: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.13)
     by 0x5282623: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.13)
     by 0x184DBF: message_dispatch (mainloop.c:72)
     by 0x5505E24: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5400.1)
     by 0x55061EF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5400.1)
     by 0x5506501: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5400.1)
     by 0x137902: main (main.c:322)
2017-11-28 16:25:18 +02:00
ERAMOTO Masaya
251a2b3ca4 obexd: Fix fd which is left even after closing session
A fd is duplicated if dbus type is unix fd, and then it is not closed
even after the file is finished transporting. In the end obexd can not
transport due to the limitation of open-able fd as below.

  Warning: invalid file descriptor 1031 in syscall fcntl(DUPFD_CLOEXEC)()

  FILE DESCRIPTORS: 1021 open at exit.
  Open pf-31 socket 1023:
     at 0x5061F1F: fcntl_common (fcntl.c:46)
     by 0x5061F1F: fcntl (fcntl.c:79)
     by 0x52A1C3D: _dbus_dup (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.13)
     by 0x528C7B8: dbus_message_iter_get_basic (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.13)
     by 0x149E04: profile_new_connection (bluetooth.c:136)
     by 0x18AAF2: process_message.isra.3 (object.c:259)
     by 0x18B364: generic_message (object.c:1079)
     by 0x5290FD2: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.13)
     by 0x5282623: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.13)
     by 0x1852FF: message_dispatch (mainloop.c:72)
     by 0x5505E24: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5400.1)
     by 0x55061EF: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5400.1)
     by 0x5506501: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5400.1)
2017-11-21 17:15:24 +02:00
Bastien Nocera
616a57f5d6 obexd: Fix compilation error on newer glibc
Since this glibc commit:
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=37f802f86400684c8d13403958b2c598721d6360

glibc doesn't include declare ssize_t when fcntl.h is included (fcntl.h
included <bits/uio.h> which includes <sys/types.h>).

This fixes the following compile-time error:

In file included from obexd/plugins/mas.c:41:0:
./obexd/src/obex.h:37:1: error: unknown type name ‘ssize_t’; did you mean ‘size_t’?
 ssize_t obex_get_size(struct obex_session *os);
 ^~~~~~~
2017-11-03 13:00:57 +02:00
Luiz Augusto von Dentz
b5fbb08a56 obex: Fix always searching UUID using 128 bit format
When discovering the SDP records the code should attempt to use
16 bit format whenever possible.
2017-10-06 09:43:34 +03:00
Marcel Holtmann
1862586e8c obexd: Add missing fall through declaration 2017-07-11 11:30:55 -07:00
Syam Sidhardhan
fd3868ebc7 obexd: Fix memory leak in phonebook-dummy
g_build_filename() returns a newly-allocated string
that must be freed with g_free().
2017-07-07 10:01:42 +03:00
Matias Karhumaa
3467bb836d obexd: Fix null pointer dereference.
By sending OPP Put request before CONNECT we were able to cause
SIGSEGV in obexd. Crash was caused by null pointer dereference.
Crash was found using Synopsys Defensics Obex Server test suite.

This was fixed by calling os->service->connect if CONNECT was not
done before.
2017-06-22 14:21:17 +03:00
Sathish Narasimman
9d4658a2e3 obexd/map: msg dummy implement message listing
For messages dummy, message listing functionality in implemented in
this patch. The inputs for message listing is derived from the
mlisting.xml file that is to be present in each folder(inbox, sent,
drafts)

> ACL Data RX: Handle 256 flags 0x02 dlen 78
      Channel: 64 len 74 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x83 cr 1 dlci 0x20
         Control: 0xff poll/final 1
         Length: 69
         FCS: 0xc4
         Credits: 1
        83 00 45 cb 00 00 00 02 01 00 0d 00 73 00 65 00  ..E.........s.e.
        6e 00 74 00 00 42 00 18 78 2d 62 74 2f 4d 41 50  n.t..B..x-bt/MAP
        2d 6d 73 67 2d 6c 69 73 74 69 6e 67 00 4c 00 18  -msg-listing.L..
        01 02 00 0b 02 02 00 00 13 01 ff 06 01 00 07 00  ................
        08 00 09 01 00 c4                                ......
< ACL Data TX: Handle 256 flags 0x00 dlen 1017
      Channel: 65 len 1013 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x81 cr 0 dlci 0x20
         Control: 0xef poll/final 0
         Length: 28675
         FCS: 0x02
        90 08 63 4c 00 21 12 02 00 0b 19 15 32 30 31 37  ..cL.!......2017
        30 36 31 32 54 31 32 32 35 31 33 2d 20 35 33 30  0612T122513- 530
        00 0d 01 00 48 08 3f 3c 4d 41 50 2d 6d 73 67 2d  ....H.?<MAP-msg-
        6c 69 73 74 69 6e 67 20 76 65 72 73 69 6f 6e 3d  listing version=
        22 31 2e 30 22 3e 3c 6d 73 67 20 68 61 6e 64 6c  "1.0"><msg handl
        65 3d 22 30 34 30 30 30 30 30 30 30 30 30 30 30  e="0400000000000
        30 31 32 22 20 73 75 62 6a 65 63 74 3d 22 4e 6f  012" subject="No
        22 20 64 61 74 65 74 69 6d 65 3d 22 32 30 31 37  " datetime="2017
        30 35 32 34 54 31 37 30 31 35 37 22 20 73 65 6e  0524T170157" sen
        64 65 72 5f 61 64 64 72 65 73 73 69 6e 67 3d 22  der_addressing="
        22 20 72 65 63 69 70 69 65 6e 74 5f 61 64 64 72  " recipient_addr
        65 73 73 69 6e 67 3d 22 35 34 33 32 31 22 20 74  essing="54321" t
        79 70 65 3d 22 53 4d 53 5f 47 53 4d 22 20 72 65  ype="SMS_GSM" re
        63 65 70 74 69 6f 6e 5f 73 74 61 74 75 73 3d 22  ception_status="
        63 6f 6d 70 6c 65 74 65 22 20 61 74 74 61 63 68  complete" attach
        6d 65 6e 74 5f 73 69 7a 65 3d 22 30 22 2f 3e 0a  ment_size="0"/>.

	... and more
2017-06-19 11:28:13 +03:00
Sathish Narasimman
a987ea04cf obexd/map: Do not send parent folder in dummy
In messages-dummy it is not necessary to add parent folder in the
response to folder-lisintg. when tested with some carkit the present
method is not working when navigating to different folders. so removing
it.
2017-06-19 11:28:13 +03:00
Luiz Augusto von Dentz
f3cc176594 obexd/pbap: Fix hanging when maxlistcount = 0
vobject_list_get_next_header shall only attempt to call
g_obex_apparam_encode otherwise it will just keep adding the same tag
in a loop.
2017-04-23 23:12:34 +03:00
Biman Paul
2322e2cc9c obexd/pbap: clear cache if name header is present
Remote device is not able to fetch call logs from different folder.
It always returns the call logs requested in first request.

Considering a situation to fetch from och and then from cch,
there are two ways to request x-bt/vcard-listing:
Case I:
1. SetPhoneBook to /telecom/och (absolute path)
2. PullvCardListing with name header '' (empty)
Remote devices using this method always calls SetPhoneBook with absolute path
to set the path and we clear the cache when new path is set.
Case II:
1. SetPhoneBook to /telecom (relative path)
2. PullvCardListing with name header 'och'
Remote devices using this method calls SetPhoneBook with '/telecom' only once
and cache is not cleared when second PullvCardListing is made with name header.
This results in cached incorrect list sent to remote device.

Clear cache if name header is present would prevent sending of
cache list as it is not present. Instead it would request to
create new cache based on new name header.
2016-09-05 12:22:46 +03:00
Fabien Proriol
8af7aac2b9 Fix obex protocol for powerpc
omtu and imtu is define as uint16_t in l2cap_get function (use with va_arg).
2016-07-29 13:58:00 +03:00
Don Zickus
03f0497691 obexd: Add a detailed failure message for exchanging business cards
When sending the ExchangeBusinessCards() command, the command returns
a failure.  It isn't clear what that failure is.  Upon looking through
the code, it is obvious the function is not implemented.

This patch just adds an extra detail message 'Not Implemented' to make
the failure a little more clear about what the problem is.
2016-07-04 14:33:53 +03:00
Marek Kasik
6c75f43e50 obexd: Return dummy_data instead of int in phonebook-dummy
There are two functions in phonebook-dummy that were returning
'int's instead of 'struct dummy_data'

phonebook_create_cache
phonebook_get_entry

As a result, when an obex-client sends the GetSize command, the obexd
on the server segfaults.

Fix this by storing the id and returning the dummy_data struct.

The GetSize test now passes correctly.
2016-07-04 14:33:16 +03:00