[Tickets #11743] ActiveSync Horde5 php serialize on PostgreSQL

bugs at horde.org bugs at horde.org
Thu Nov 22 11:03:35 UTC 2012


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11743
------------------------------------------------------------------------------
  Ticket             | 11743
  Created By         | horde at albasoft.com
  Summary            | ActiveSync Horde5 php serialize on PostgreSQL
  Queue              | Synchronization
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


horde at albasoft.com (2012-11-22 11:03) wrote:

I'm running ActiveSync on Groupware 5.0.1 using postgresql-8.4.9 as  
default backend.
I have activated email sync with 12.1 version. There are some errors  
related to php serialize.

As stated in php serialize manual "return values" [  
http://php.net/manual/en/function.serialize.php ]:
"Note that this is a binary string which may include null bytes, and  
needs to be stored and handled as such. For example, serialize()  
output should generally be stored in a BLOB field in a database,  
rather than a CHAR or TEXT field. "

But 'horde_activesync_state.sync_data' column is defined as 'text',  
and pgsql ends insertion of data right after the first null found in a  
string, storing just a part of the data. Sometimes serialize has to  
store object's private members and so the string has nulls.

Either serialize is been called with incorrect data, or it has to be  
filtered to avoid nulls when inserting into pgsql table.

This is a device log, where "^@" are NULL bytes:

2012-11-13T01:09:49+01:00 DEBUG: O   <Folders>
2012-11-13T01:09:49+01:00 DEBUG: O    <Folder>
2012-11-13T01:09:49+01:00 DEBUG: O     <FolderType>
2012-11-13T01:09:49+01:00 DEBUG: O      Contacts
2012-11-13T01:09:49+01:00 DEBUG: O     <FolderType/>
2012-11-13T01:09:49+01:00 DEBUG: O     <SyncKey>
2012-11-13T01:09:49+01:00 DEBUG: O       
{50a15189-9928-4757-9dcb-06c6c0a80102}46
2012-11-13T01:09:49+01:00 DEBUG: O     <SyncKey/>
2012-11-13T01:09:49+01:00 DEBUG: O     <FolderId>
2012-11-13T01:09:49+01:00 DEBUG: O      @Contacts@
2012-11-13T01:09:49+01:00 DEBUG: O     <FolderId/>
2012-11-13T01:09:49+01:00 DEBUG: O     <Status>
2012-11-13T01:09:49+01:00 DEBUG: O      1
2012-11-13T01:09:49+01:00 DEBUG: O     <Status/>
2012-11-13T01:09:49+01:00 DEBUG: [4162] Saving state: Array
(
     [0] => {50a15189-9928-4757-9dcb-06c6c0a80102}46
     [1] =>  
O:34:"Horde_ActiveSync_Folder_Collection":3:{s:10:"^@*^@_status";a:0:{}s:12:"^@*^@_serverid";s:10:"@Contacts@";s:9:"^@*^@_class";s:8:"Contacts";}
     [2] => androidc1261044290
     [3] => 1352765389
     [4] => @Contacts@
     [5] => jlsanz
     [6] => 0
)

2012-11-13T01:09:49+01:00 DEBUG: O    <Folder/>
2012-11-13T01:09:49+01:00 DEBUG: O   <Folders/>
2012-11-13T01:09:49+01:00 DEBUG: O  <Synchronize/>


Looking at pgsql table for the above logged insert, only  
'O:34:"Horde_ActiveSync_Folder_Collection":3:{s:10:"' gets inserted,  
just until the first NULL byte.






More information about the bugs mailing list