Queueing the error won't remove the original packet created by transfer
from the queue so upon resume gobex will attempt to send it again.
To fix this we no longer create a error packet instead the session is
market as aborted and the error stored so when gobex finally resumes the
error is forward properly.
The authorization request of a queued transfer could fail, and this
needs to be reported to the transfer initiator. Otherwise it would
likely result in D-Bus timeouts.
Problem: Even if transfer is aborted file will be saved with partial
content.
Fix: In os_reset_session() os->cmd is checked for PUT before calling
driver->remove(), but os->cmd is never assigned.This fix sets os->cmd
wit respective opcode
There is no much of point to have a user_data if it is always the same
type, besides this code is very inefficient and cause a lookup in the list
of pending calls everytime a reply is received.
This fix solves the following issues in multiple file push.
Agent authorize is happening only for first file.
Transfer_completed signal is getting called only after last push
Incorrect value is sent for "total" and "transfered" signal from
second file onwards.
Issue: As reported by static code analyzer (Coverity), if buffer is NULL
and aparams is not NULL, then buffer gets dereferenced in string_read
function.
Fix: Application parameter is allocated only if maxlistcount is zero
during phonebooksize request and buffer is allocated in case of pull
phonebook request, hence modify logic to avoid application parameter
check, as it is tightly coupled with maxlistcount.
When calling driver_get_headers it may not be ready but after the backend
respond the result can still be 0 which indicades no headers need to
added and we can start sending the body.
UpdateInbox function allows remote device to initiate an update of
the MSE inbox, i.e. the MSE shall contact the network to retrieve
new messages if available. If MSE does not support the network
update it shall answer with a 'Not implemented' error response.
This introduces skeleton of functions for supporting processing of
Message Access Profile specific OBEX application parameters. The code is
usable in both MSE (server) and MCE (client), thus the patch enables
linking the code to obexd and obex-client.
Timestamp returned from Tracker can optionally contain fractional
seconds. Original code treated any character after seconds as flag for
UTC timestamp. This patch changes it so now only the beginning of string
is scanned and the end of string is checked for UTC flag ('Z') presence.
This missing include directive makes the syncevolution plugin fail to
compile. In Fedora 16 with gcc version 4.6.1 20110908, the output is:
make --no-print-directory all-am
CC plugins/syncevolution.o
In file included from plugins/syncevolution.c:40:0:
./src/mimetype.h:33:46: error: unknown type name ‘mode_t’
plugins/syncevolution.c:277:54: error: unknown type name ‘mode_t’
plugins/syncevolution.c:438:2: error: unknown field ‘open’ specified in initializer
plugins/syncevolution.c:438:10: error: ‘synce_open’ undeclared here (not in a function)
make[1]: *** [plugins/syncevolution.o] Error 1
Some contacts in Tracker can have no name fields set nor nickname. This
patch enhances the way the contact name is obtained:
1) If there is no nco:nickname set for contact, use nco:imNickname from
its related IM data.
2) As the N field is mandatory in both vCard 2.1 and 3.0 and it's the
most useful field for PBAP clients, if its components are not present
in Tracker, use nco:fullname (thus promote FN to N) or if nco:fullname
is also not present, then use previously obtained nickname for N field.
Previously URL vCard's field (imported with default OTHER subtype) was
missing after pulling entire phonebook or single vCard (for phonebook
and each call history as well).
This patch fixes that issue by adjusting queries to URL field.
This fixes regression introduced by
63becff48820dc50a30ae495e286e858a886d9dd, causing obex-client to crash
in cases of e.g. remote site rejecting pushed file.
The req->function set by user of agent API may request agent object
deletion. This in turn checks if agent->pending is set and if it is,
it tries to cancel the pending call and frees pending call data. As at
this point we are already handling call response and we are going to
free this pending call data, agent->pending can be set to NULL prior to
calling req->function, thus preventing premature freeing of later
dereferenced req.
According to PBAP specification (ANNEX A), all application-parameters
are optional in case of pulling single vCard entry, so header for
application-parameters can be omitted, and it would be valid as well.
Previously pulling single vCard was always failing with "Bad Request"
status in such a circumstance.
This patch fixes that issue and pulling single vCard is done successfully
with "OK" status. Output vCard would contain all fields under 2.1 format
(as for default settings).
Previously limit length for vCard's (vCard 2.1 with Quoted Printable
encoding) property line was always set as 75 (QP_LINE_LEN), after
processing each single subfield (for instance under ADR property).
Thus it was not possible to reach limit equal to 0 (then breaking line
is required) for all property subfields.
This patch fixes that issue and length of first line, containing property
parameters, is limited as well.
This patch provides additional condition for selection of Quoted Printable
encoding (for vCard's 2.1 fields). It will be satisfied if there is any
byte which value is out of range standard ASCII set. Such byte may be
a part of sequence (composed of more than single byte) for non-standard
characters specified by UTF-8 and if detected, CHARSET parameter for
property is set as "UTF-8".
This fix is required since without such improvement some carkits may
display non-standard characters incorrectly (for instance they may be
omitted completely).
If tag value is empty there is possibility to quickly create
empty tag without entering to rest of the logic.
Checking for empty parameter at the begining is included
basicaly in every print tag function in code - here somehow
was missing.
Commit 934b3b2f5f8432b67822be9f83a141fe3783cbd7 introduced a regression
in OPP, by making it not send TransferCompleted signal. This happened
because OPP was calling manager_emit_transfer_completed() on .reset(),
and manager_emit_transfer_completed() in turn checks if the os->object
is not NULL. This fixes this by moving clearing os->object after doing
service driver .reset().
OBEX_EV_REQ is the last thing that we are going to receive on PUT and
this is always going to be delivered. As the service driver will start
receiving data at or before its .put(), we can simply call flush() after
that. This also makes flush() usable in PUTs without length header.
This replaces:
service->get/put, mime->open, ..., service->reset, mime->close
logic, with a more appropriate:
service->get/put, mime->open, ..., mime->close, service->reset
Previously, it was trynig to create string (by snprintf function
and stored in "buf" buffer) containing "%s" formatting piece for
"vcard_printf" function.
In this case "\%" is not valid escape sequence (it is "%%" for percent
character) - backslash is ignored, so sequence "\%s" is treated as "%s"
and replaced by string for "number" field when snprintf function is
executed. Hence "vcard_printf" function has nothing to do with "number"
field, since "buf" does not contain any "%s" formatting sequence.
This patch make simplification for printing phone number field by
avoiding storing formatting pieces (for instance "%%s"). Now string
for phone number field is stored directly in "field" buffer
(common with Quoted Printable encoding) and simply passed to
"vcard_printf" function.
This patch removes "magic number" indicating buffer's size
in "vcard_printf_number" function and replace it by value defined under
LEN_MAX. Now it would be consistent with the rest of code, since all
functions from vcard_prinf_* family use LEN_MAX to indicate size
of buffer which may store some vCard's field content.
According to vCard 2.1 specification, this patch provides Quoted Printable
encoding (described in RFC1521 document), which is specific for vCard 2.1
formatting and should be preferable for instance, if vcard's property
field contains multiple lines (vCard's 2.1 spec. says: Multiple lines
of formatted text are separated with a Quoted Printable CRLF sequence
of "=0D" followed by "=0A" followed by a Quoted Printable softline
break sequence of "=").
In general all characters can be replaced with "=<Hex>" where "<Hex>"
is the 2-character hexadecimal representation of the character's decimal
value. Characters with decimal values of 33 through 60 inclusive, and 62
through 126, inclusive, may be represented as the ASCII characters.
Quoted Printable lines of text must also be limited to less than 76
characters. For longer lines soft line breaks must be used - an equal sign
as the last character on a encoded line indicates such soft line break
in the encoded text.
In this case, Quoted Printable is selected, if vCard's 2.1 field contains
newline character or some specific ASCII character from set:
'!', '"', '#', '$', '@', '[', '\', ']', '^', '`', '{', '|', '}', '~'.
(it is not mandatory but each character from this set will be encoded
as Quoted Printable spec. suggests).
Equal sign character in vCard's field is always encoded (it is mandatory
and Quoted Printable encoding is taken into account if this character present
in vCard's field) since it is special character used for encoding characters
and indicating soft line breaks.
Horizontal tab and space characters are always encoded. It's mandatory only
if they are not followed by any other character. Always encoding makes
simplification, since we don't need to care about position of these characters.
According to vCard 2.1 specification semicolon character, present in vCard's
field, must be escaped with backslash character. Since backslash is always
encoded it gives sequence "=5C;" (instead of "\;").
This patch provides possibility to escape only semicolon character
in vCard's fields, as vCard 2.1 specification requires
(for comparision vCard 3.0 requires escaping for set of characters:
'\n', '\r', ';', ',', '\').
This patch extends some functions ("get_escaped_fields" and some from
"vcard_printf_*" family) parameter list for format value, since it would
be needed to select escaping and encoding method, depending on vCard's
type (vCard 2.1 or vCard 3.0).
Invalid read of size 8
at 0x413DA1: get_file_callback (ftp.c:184)
by 0x40A74E: transfer_complete (gobex-transfer.c:73)
by 0x40AB91: transfer_response (gobex-transfer.c:172)
by 0x40847A: handle_response (gobex.c:629)
by 0x408C06: incoming_data (gobex.c:811)
by 0x3E01043DBC: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.2910.0)
by 0x3E010445A7: ??? (in /lib64/libglib-2.0.so.0.2910.0)
by 0x3E01044AF4: g_main_loop_run (in /lib64/libglib-2.0.so.0.2910.0)
by 0x404CD4: main (main.c:102)
Address 0x8 is not stack'd, malloc'd or (recently) free'd
Previously semicolon was used as delimiter when address vCard fields
are concatenated (at the moment of fetching from database via query).
It was introducing confusion at the moment of splitting address string
into seperate fields, since these fields may contain semicolons as well.
In this case it leads to treating some semicolons - characters in address
fields - as real delimiters (no escaped but it should) and other
semicolons - real delimiters - as characters in address field
(escaped but it shouldn't).
This patch fixes problem described above, since semicolon delimiter
is replaced by character called Unit Separator (equal to '\37') which
shouldn't be present in address fields.
This patch introduces phonebook_addr struct for more intuitive
handling address fields from backend. Now address fields are managed
by linked list (wrapped by structure) and it is used for printing vCard
address fields, instead of buffers set (combined with g_strsplit
and snprintf functions).
This replaces parsing missed calls listing that was used to get the number of
missed calls that have been unread with a simple SPARQL query.
Previous code was trying to deal with misbehaviour of commhistoryd but still
was failing in some cases. commhistoryd is now fixed.
This adds drivers for MIME types needed in Message Access Profile. The
target-default driver is also kept to prevent MIME driver selection
mechanism to get to default driver from filesystem.c which would result
in allowing putting files in arbitrary locations when connected to MAP
target.
The any_open() bindings in MIME drivers are going to be successfully
replaced by appropriate calls for specific functionality.
Another change regarding performance of call history queries. This makes
them non-sensitive (in terms of speed) to the corner case situations when
there are hundreds of contacts all having the same phone number.
Calling OBEX_ResumeRequest() from handle_async_io() may result in direct
calling obex_event_cb() (this happens when obex_write_stream() will
deliver not enough bytes to fully fill OpenOBEX TX packet). In this case
set_io_watch will fail if handle_async_io() is called from
obex_object_set_io_flags(), because the watch is already installed.
Originally when code returns from OBEX_ResumeRequest(), handle_async_io()
returns FALSE which makes obex_object_set_io_flags() remove this watch.
This patch adds variable for tracking whether subsequent calls suspended
get request, causing obex_object_set_io_flags() remove the watch only
when the request is not suspended.
Additionaly member 'streaming' of obex_session has been renamed to
'stream_open'.
This simplify target matching to a single place making it easier to add
new targets/profiles.
Matching is done by either friendly name e.g. opp, ftp... or Bluetooth
UUID.
Drivers are probed when a session is established and removed when the
session is destroyed.
It seems that e_book_cancel (in libebook) is broken -- it should return
TRUE when request is canceled and FALSE otherwise, but after
"successfully" canceling async request, supplied callback is still
called without any error.
Previously client was suddenly disconnecting to cancel
outgoing OPP transfer. Now ABORT command will be sent
before disconnecting with server in that scenario.
This change is required to pass TC_CLIENT_OPH_BV_27_I PTS
test case (not mandatory for qualification).
Until now contacts with emails, without type specified, were not included
in vCards. Also default type for vCard 3.0 is set to "OTHER" - not
empty field as it is in vCard 2.1.
This patch changes the way the symbolic links are treated by FTP, making
code a bit simpler and FTP more intuitive.
Previously symlinks were supposed to be disallowed unless the -l option
was used, and with that option, only symlinks present directly inside
root folder were followed. This did not work for file links, as fstat()
check on open()-ed won't result in S_IFLNK set, so symbolic links to
files were followed regardless to options.
Now links inside root folder are always allowed. Without -l (--symlinks)
option, following them is only allowed when the resulting real path is
still inside the given root directory. When -l is given, all symlinks
are followed.
Session data should not be acessible directly otherwise it cause too
much dependency by profile specific code which is quite inefficient in
the long term.
Until now adversary could exploit OBEX Name header and perform any kind
of operations (listing, getting, putting) outside of given root by
putting path with ".." components inside this header.
IrOBEX specification chap. 2.2.3 states that the Type header is an ASCII
null-terminated string whose values are case insensitive (as it is also
defined by RFC 1521).
Previously 'owner' vCard was visible in vCard listing of 'pb' but not in
result of pull 'pb' phonebook. Due to that, vCard listing and pull
operations were returning different number of results (also return
values of PhonebookSize request were inconsistent)
phonebook_req_finalize is called before actual transport taking place,
so buffers kept in user_data may cause invalid reads in valgrind and
prevent transport being completed.
Until now ebooks were opened only on phonebook_init, but particular ebook
may be offline or not authenticated or user may be offline at the time.
Better idea is try to open ebooks before each operation, especially
as time overhead is minimal.
Previously when pulling single vCard there was no difference between
pulling contact or call, now there are separate queries and additional
previously missing data are being sent.
This reverts commit 02d8dea9490b8852b837e143a09891817a4965f9.
The constraints for pulling single vCard are to loose and causes other
numbers to be merged into same vCard. Also there is more elegant way of
applying the new changes.
This removes possibility of setting header type in mime driver read()
function as the functionality of adding different header types is now
supported by get_next_header().
Connection of RFCOMM and SDP are extracted from session_create function
into session_connect. Such allows making asynchronous calls before
creating connections.
This removes stream argument from service driver get() function. Now the
streaming is started automatically when first portion of data is
received.
Additionally the possibility to not send body header at all is added. This
can be achieved by returning -ENOSTR from mime plugin read() function.
PBAP specification v1.1, chap. 5.1.4.1 and 5.4.4.1 states that
non-mandatory attributes shall be sent only when their value is not NULL.
In case of vCards this can be simply understood as non-empty, therefore
the patch makes phonebook_add_contact add only mandatory attributes for
specified vCard version as well as those for which values are of non-zero
length.
Until now only default ebook was used, this patch change this behaviour
so each function is run on all available (active) ebooks and merging
results from each of them.
Request shall be finalized in cache_ready_notify callback function.
Otherwise, reference to the request is kept until vobject is closed.
It is correct in current implementation since there are no nested
backend requests when pulling vcard listing.
However, this contradicts to current design (see phonebook_size_result,
query_result, cache_entry_done) and may cause problems if such
implementation would be needed.
Previously when pulling single vCard there was no difference between
pulling contact or call, now there are separate queries and additional
previously missing data are being sent.
Data contacts are freed ones in finalize function which is called in
query_result callback function. Calling free_data_contacts(data) twice
for last phone book part causes invalid memory read when dereferencing
data->contacts.
This change is needed to be consistent with scenario about pulling empty
phonebook. Previously NOT_FOUND error was returned for vcardlisting when
there were no entries in selected phonebook.
PBAP spec says, that error NOT_FOUND should be returned when phonebook
object could not be found - very strict clients may think that phonebook
does not exist (and in scenario described above phonebook exists but its
content is empty).
Previously, when doing pull of empty phonebook, NOT FOUND error was
returned. Now returning empty body - this change is needed to pass PTS
testcase TC_PSE_PDF_BV_05_I (this testcase is optional).
PBAP spec says, that error NOT_FOUND should be returned when phonebook
object could not be found - very strict clients may think that phonebook
does not exist (and in scenario described above phonebook exists but its
content is empty).
This removes outdated (no longer used) code from obex_write_stream:
1) Support for sending data injected directly to obj->buf. This was used
for implementing folder listing in commit:
c42eff92a9c2c177f788dd1ec429250e64f69a78.
2) os->finished flag originally used for supporting asynchronous code in
PBAP, introduced in commit:
1a5025349df3dc6134db62afdcd048c00f876b27
This reverts parts of commit e0b3283e20ba885018010a6a8ae49b7c313958e8.
API changes introduced before were meant to guarantee required PBAP
functionality of sending application parameters header in first packet
of multi-packet response.
However OBEX_FL_FIT_ONE_PACKET does not serve this purpose - it is for
making sure that all headers will fit fully into one packet (thus
FIT_ONE_PACKET), returning error from OBEX_ObjectAddHeader() when this
is not the case.
Starting the body header streaming adds body header immediately to the
outgoing queue, waiting for more data. Any attempts to
OBEX_ObjectAddHeader() different than those with hi == OBEX_HDR_DATA and
OBEX_FL_STREAM_DATA present in flags, will add new header after
currently streamed body and it will be processed after ending streaming
with OBEX_FL_STREAM_DATAEND. Also in this case data is memcpy'd, so no
reason for any additional write_offset counting.
Change introduced by commit b0619290e4128bb583268bfbfbb66de9a30ecf7c
prevented calling count query multiple times when getting the phone book
in parts. However value of newmissedcalls was kept between calls to
phonebook_pull_read() resulting in adding application parameters header
multiple times.
This adds functions for initializing and freeing resources used by
message storage access backend and example implementation in the dummy
(or rather - filesystem) backend.
Dummy backend uses $MAP_ROOT (if set) and falls back to
$HOME/map-messages for its message storage. This directory should at
least contain basic folders required by the MAP specification. It
represents the root as seen from the perspective of MAP client. You can
prepare it as follows:
$ mkdir -p "$MAP_ROOT/telecom/msg/inbox"
$ mkdir "$MAP_ROOT/telecom/msg/sent"
$ mkdir "$MAP_ROOT/telecom/msg/deleted"
$ mkdir "$MAP_ROOT/telecom/msg/outbox"
Plugins options are now handle with --plugin(-p)/--noplugin(-P) which
takes a string set containing the plugin names separated by ',', ':' or
' ' (similar to bluetoothd, ofono and connman).
It is possible that phonebook_pull_read is invoked several times
submitting multiple pull requests without closing PBAP object. E.g.,
when history is large enough and maxlistcount>VCARDS_PART_COUNT.
The result is possibility of different data structures (GString and
contact_data) to be mixed in a single GSlist that may lead to undefined
behaviour.
Previously pull_newmissedcalls was called for every part when
processing large response (more that one part of results) and
number of 'newmissedcalls' was wrong in that scenario.
Now newmissedcalls will be counted only once (during generating
first part of mch results).
Graph patterns used in queries for PullPhonebook and PullvCardListing in
case of call history are now rewritten to share the same code and be
simpler - previously they were doing almost the same, but exact code
differed. So in this patch repeating parts of queries were reduced to one
place for easy management.
Also new queries fix the behaviour in situation when there is more than
one contact matching a phone number from call history entry - in this
case no contact data is returned instead of returning random contact as
it was the case before.
This fixes error "GLIB CRITICAL ** Tracker -
tracker_db_cursor_get_value_type: assertion `column < n_columns' failed"
occurring when pulling phone book or doing listing for missed calls. The
number of expected columns in reply to NEW_MISSED_CALLS_LIST query was
incorrectly set to PULL_QUERY_COL_AMOUNT (23) but the query actually
returns 3 columns.
Currently nmo:Call resources put to the Tracker by commhistory do not use
the same nco:PhoneNumber as the one bound to the nco:PersonContact. This
patch introduces matching contacts by actual phone number, thus returning
proper contact data regardless of this commhistory change.