Ticket #1083 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

[API] drop osync_plugin_info_get_configdir

Reported by: dgollub Owned by: dgollub
Priority: high Milestone: OpenSync 0.39
Component: OpenSync: Plugin API Version: 0.38
Severity: blocker Keywords:
Cc:

Description

osync_plugin_info_get_configdir() is a critical interface which should NOT part of public API. This get often abused to dump files into the group/member directory.

Unfortunately this ticket depends on #1082

Move this interface into private API ASAP #1082 is fixed and before 0.39 gets released.

Change History

comment:1 Changed 3 years ago by dgollub

Affected plugins:

file-sync/src/file_sync.c
gnokii-sync/src/gnokii_sync.c
gpe/src/contacts.c
gpe/src/todo.c
gpe/src/calendar.c
irmc-sync/src/irmc_sync.c
kdepim/src/datasource.cpp
mozilla-sync/trunk/src/mozilla-sync.cpp
opie-sync/src/opie_sync.c
qtopia4-sync/src/qtopia4_plugin.cpp
syncml/src/syncml_common.c
tomboy-sync/src/tomboy_sync.c

Mostly used due the hashtable (#1082). Trivial to port.

comment:2 Changed 3 years ago by dgollub

(In [5371]) Dropped following interfaces: osync_hashtable_new osync_hashtable_ref osync_hashtable_unref osync_hashtable_load osync_hashtable_save

This affects all plugins using hashtables!

Short Porting instruction:

  • Drop osync_hashtable_{un,}ref() calls (no replacement required)
  • Drop osync_hashtable_new() (no replacement required)
  • Drop calls like osync_plugin_info_get_configdir() if they were used to create a hashtable path (obsolete now)
  • Drop calls of osync_hashtable_save() (no replacement required)
  • Call osync_objtype_sink_enable_hashtable(OSyncObjTypeSink *sink, TRUE); in plugin init function for each ObjTypeSink?
  • Hashtable will be initilaized and loaded by the Engine right after the plugin init function. Don't expect to get a HashTable? pointer in the init function!
  • You can get an valid OSyncHashTable pointer by calling inside Plugin Sink Functions (e.g. connect, get_changes, commit, sync_done, ...):

OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink);

  • Hashtable get stored after the sync_done() plugin call. No call by plugin required.

refs #1082 refs #1083

comment:3 Changed 3 years ago by dgollub

(In [5377]) Drop devinf_path. Plugins no longer have access to plugin's configuratuion path. #1083

refs #1083

comment:4 Changed 3 years ago by dgollub

  • Status changed from new to closed
  • Resolution set to fixed

(In [5378]) Drop osync_plugin_info_get_configdir() from plugin interface to avoid that plugins directly access the filesystem of the configuration direcoty. This hopefully avoids an maintenance nightmare.

osync_plugin_info_get_configdir() will not get replaced by any other function.

fixes #1083

Note: See TracTickets for help on using tickets.