summaryrefslogtreecommitdiff
path: root/obexd/plugins
Commit message (Collapse)AuthorAgeFilesLines
* obexd: Fix unchecked return valueTedd Ho-Jeong An2021-10-181-1/+3
| | | | | This patch fixes the unchecked return value(CWE-252) issues reported by the Coverity.
* obexd: phonebook: Set default apparams for PTS clientsHannu Mallat2021-07-231-0/+15
| | | | | | | 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.
* obexd: phonebook-ebook: modernizeDylan Van Assche2021-07-231-348/+320
| | | | | | | | | | | | | | | 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
* Fix memory leaks in obexSteve Grubb2021-05-192-2/+7
| | | | | | | | | 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.
* obex: Fix warnings cause by using of deprecated APIsLuiz Augusto von Dentz2021-04-021-1/+0
| | | | | | | | | | | | | | | | 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); | ^~~~~~~~~~~~~
* obexd: Cleanup deprecated symbolic file permissionsBrian Gix2021-02-232-11/+11
|
* obexd: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-2120-280/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-065-1/+5
|
* obexd: Use g_dbus_dict_append_entry()ERAMOTO Masaya2018-03-011-37/+3
|
* obexd: Fix fd which is left even after closing sessionERAMOTO Masaya2017-11-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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)
* obexd: Add missing fall through declarationMarcel Holtmann2017-07-111-0/+1
|
* obexd: Fix memory leak in phonebook-dummySyam Sidhardhan2017-07-071-0/+3
| | | | | g_build_filename() returns a newly-allocated string that must be freed with g_free().
* obexd/map: msg dummy implement message listingSathish Narasimman2017-06-191-1/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* obexd/map: Do not send parent folder in dummySathish Narasimman2017-06-191-10/+0
| | | | | | | 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.
* obexd/pbap: Fix hanging when maxlistcount = 0Luiz Augusto von Dentz2017-04-231-1/+4
| | | | | | 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.
* obexd/pbap: clear cache if name header is presentBiman Paul2016-09-051-2/+7
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix obex protocol for powerpcFabien Proriol2016-07-291-2/+2
| | | | omtu and imtu is define as uint16_t in l2cap_get function (use with va_arg).
* obexd: Return dummy_data instead of int in phonebook-dummyMarek Kasik2016-07-041-7/+8
| | | | | | | | | | | | | | | 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.
* obexd: Allow CreateFolder to create a directoryMarek Kasik2016-07-041-0/+2
| | | | | | | | | | When the remote device sends the 'CreateFolder' command, obexd first tries to verify the path in ftp_setpath(). Because we are creating a new directory, the verify_path() is expected to fail (it does not exist yet; ENOENT). Trap that special case and cause the function to fail directly to the create directory path.
* obexd: pbap: add headers correctly for size querySimon Fels2015-10-201-2/+3
| | | | | | | | | | | | | When client queries for the size of a phonebook we fall into a indefinite loop as g_obex_apparam_encode always returns the same number of items added to the buffer regardless how often it is called. In former times where this code wasn't using GObexApparams a array was reduced each time the headers where added and so we could easily find out when we've added all headers. However today we need to solve this a bit differently by also setting the firstpacket flag when we receive the phonebook size result from the phonebook implementation which then lets us correctly go through without falling into a indefinite loop.
* obexd/opp: Fix OPP GET request pathGowtham Anandha Babu2015-06-231-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The default path is /etc/bluetooth/vcard.vcf which obexd is not able to access. obexd[11654]: obexd/src/obex.c:cmd_get() session 0x64edff0 obexd[11654]: GET(0x3), (null)(0xffffffff) obexd[11654]: obexd/src/obex.c:parse_type() TYPE: text/x-vcard obexd[11654]: open(/etc/bluetooth/vcard.vcf): Operation not permitted (1) obexd[11654]: GET(0x3), NOT_FOUND(0x44) After making this path as obex root folder, it is able to succeed. obexd[12246]: obexd/src/obex.c:cmd_get() session 0x64ed830 obexd[12246]: GET(0x3), (null)(0xffffffff) obexd[12246]: obexd/src/obex.c:parse_type() TYPE: text/x-vcard obexd[12246]: obexd/src/obex.c:driver_get_headers() name=(null) type=text/x-vcard object=0x8 obexd[12246]: GET(0x3), CONTINUE(0x10) obexd[12246]: obexd/src/obex.c:send_data() name=(null) type=text/x-vcard file=0x8 size=3061 obexd[12246]: obexd/src/obex.c:driver_read() 73 read obexd[12246]: obexd/src/obex.c:send_data() name=(null) type=text/x-vcard file=0x8 size=3066 obexd[12246]: obexd/src/obex.c:driver_read() 0 read obexd[12246]: obexd/src/obex.c:transfer_complete()
* obexd: Remove unused parameter from manager_request_authorizationSzymon Janc2015-04-081-3/+1
| | | | | This fix compilation error with musl due to missing (now not needed) stdint.h include.
* obexd/pbap: Fix NULL check to avoid potential crashBharat Panda2015-03-201-5/+5
| | | | NULL pointer check for name is done before using the same.
* obexd: Fix cross includes from client and pluginsMarcel Holtmann2015-03-0113-69/+68
|
* obexd: Fix includes for gobex.h headerMarcel Holtmann2015-03-012-4/+4
|
* obexd: Fix includes for gdbus.h headerMarcel Holtmann2015-03-013-4/+7
|
* obexd: Use local libbluetooth includesMarcel Holtmann2015-02-282-4/+5
|
* obexd: Add explicit include for lib/bluetooth.hMarcel Holtmann2015-02-181-1/+2
|
* obexd: List all enum values in switchSzymon Janc2014-12-081-0/+2
| | | | As described in coding style M10.
* pbap: Fix When MaxListCount header missingAnurag Biradar2014-12-011-0/+6
| | | | | As per spec(5.3.4.4) when MaxListCount headser is missing then PSE should assume MaxListCount value as MAX (65535)
* obexd/ftp: Handle transfer reset for FTPBharat Panda2014-11-041-1/+9
| | | | | Changes made to emit transfer completed to .Transfer1 interface on ftp reset.
* obexd/ftp: Add support for tracking transfersBharat Panda2014-10-311-0/+20
| | | | This enables transfer management for FTP connections.
* obexd/mas: Handle register notification openBharat Panda2014-10-291-1/+29
| | | | Changes made to handle method open for mime_notification_registration
* obexd/mas: Add Support for MSETime filterBharat Panda2014-10-221-0/+38
| | | | | Changes made to add support for MSE local time and timezone offset parameter along with GetMessageListing response.
* obexd/client/pbap: Add support for spd,favGowtham Anandha Babu2014-10-161-0/+4
| | | | Add support for the speed-dial and favorite folders.
* obexd: Fix compilation error with muslSzymon Janc2014-09-241-1/+1
| | | | | | | | | | | | CC obexd/plugins/obexd-filesystem.o In file included from obexd/plugins/filesystem.c:40:0: /usr/include/wait.h:1:2: error: #warning redirecting incorrect #include <wait.h> to <sys/wait.h> [-Werror=cpp] #warning redirecting incorrect #include <wait.h> to <sys/wait.h> ^ cc1: all warnings being treated as errors Makefile:6447: recipe for target 'obexd/plugins/obexd-filesystem.o' failed make[1]: *** [obexd/plugins/obexd-filesystem.o] Error 1
* obexd/mas: Fix crash when outparams is NULLLuiz Augusto von Dentz2014-09-031-0/+3
| | | | | outparams can be NULL meaning no application parameters should be added to the response.
* obexd/mas: Fix parsing of application parametersLuiz Augusto von Dentz2014-09-031-6/+18
| | | | | Some commands don't have any mandatory application parameter which means inparams can be NULL which should not be treated as a bad request.
* pbap: Fix PhonebookSize endiannessHannu Mallat2014-02-051-2/+2
| | | | | As g_obex_apparam_set_uint16() converts data to big-endian format internally, do not call htons() prior to it.
* obexd: Make btio/btio.h include localMarcel Holtmann2014-01-252-2/+3
|
* obexd/irmc: Fix folder for LUID requestsHarald Schmitt2014-01-201-1/+1
| | | | | | The old macro PB_LUID_FOLDER had the folder luid on the second level: /telecom/luid. But the luid folder occurs per IrMC spec on level three e.g. /telecom/pb/luid.
* obexd/bluetooth: Make dict_append_entry function staticSzymon Janc2013-10-041-1/+1
| | | | | | | | This fix following build error: CC obexd/plugins/obexd-bluetooth.o obexd/plugins/bluetooth.c:242:6: error: no previous declaration for ‘dict_append_entry’ [-Werror=missing-declarations]
* obexd/bluetooth: Remove unused local variablesSzymon Janc2013-10-041-4/+0
| | | | | | | | | | | | | | | | | | | | | This ix following build errors: CC obexd/plugins/obexd-bluetooth.o obexd/plugins/bluetooth.c: In function ‘register_profile_reply’: obexd/plugins/bluetooth.c:202:10: error: unused variable ‘err’ [-Werror=unused-variable] obexd/plugins/bluetooth.c: In function ‘name_acquired’: obexd/plugins/bluetooth.c:367:15: error: unused variable ‘uuid’ [-Werror=unused-variable] obexd/plugins/bluetooth.c: In function ‘name_released’: obexd/plugins/bluetooth.c:389:15: error: unused variable ‘uuid’ [-Werror=unused-variable] obexd/plugins/bluetooth.c: In function ‘bluetooth_start’: obexd/plugins/bluetooth.c:400:10: error: unused variable ‘ios’ [-Werror=unused-variable]
* obexd/bluetooth: Fix memory leakLuiz Augusto von Dentz2013-09-161-0/+1
| | | | | | | | | | | | g_io_channel_unix_new creates a reference which is then passed to obex_session_start which creates its on reference via g_io_channel_ref leading to the following leak: at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x3B03C4D89E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x3B03C88224: g_io_channel_unix_new (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x418967: profile_new_connection (bluetooth.c:148) by 0x43D763: process_message.isra.5 (object.c:259)
* obexd/bluetooth: Fix error on register_profileLuiz Augusto von Dentz2013-09-101-10/+9
| | | | | | | | | The error happens whenever RegisterProfile fails the interface is not unregistered causing any subsequent call to register_profile function to fail: obexd[944]: D-Bus failed to register /org/bluez/obex/00005005_0000_1000_8000_0002ee000001 obexd[944]: bluetooth: Failed to register profile (null)
* obexd: Make use of g_dbus_send_message*Luiz Augusto von Dentz2013-09-093-7/+6
| | | | | This replaces dbus_connection_send* with g_dbus_send_message* which do not alter message order.
* obexd: Fix not checking for valid fd on NewConnectionLuiz Augusto von Dentz2013-06-121-0/+13
| | | | | | | | | The fd needs to be checked as it may not be valid which cause the following warnings: ==8162== Warning: invalid file descriptor 1031 in syscall fcntl(DUPFD_CLOEXEC)() (obexd:8162): GLib-WARNING **: giounix.c:412Error while getting flags for FD: Bad file descriptor (9)
* bluetooth: add getsockname() entry in the bluetooth driverGustavo Padovan2013-05-291-0/+19
|
* opp: Register Session interface for OPP transfersGustavo Padovan2013-05-281-0/+3
| | | | The Session interface wasn't registered when a new transfer arrives.
* obexd: Get rid of gintLucas De Marchi2013-05-011-1/+1
| | | | | Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.