Changeset 3653

Show
Ignore:
Timestamp:
09/16/08 16:49:28 (3 months ago)
Author:
prahal
Message:

Send a misconfiguration error if same path is defined for more than one active objtype sink.
This is unsupported use case.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/file-sync/src/file_sync.c

    r3584 r3653  
    483483 
    484484 
     485        GList *pathes = NULL; 
    485486        int i, numobjs = osync_plugin_info_num_objtypes(info); 
    486487        for (i = 0; i < numobjs; i++) { 
     
    499500                        goto error_free_env; 
    500501                } 
     502                if(g_list_find_custom(pathes, dir->path, (GCompareFunc)strcmp)) { 
     503                        osync_error_set(error, OSYNC_ERROR_MISCONFIGURATION, "Path for objtype \"%s\" defined for more than one objtype sink in configuration.", objtype); 
     504                        goto error_free_env; 
     505                } 
     506                pathes = g_list_append(pathes, g_strdup(dir->path)); 
    501507 
    502508                OSyncList *s = osync_plugin_resource_get_objformat_sinks(res); 
     
    551557        } 
    552558 
     559        if (pathes) { 
     560                g_list_foreach(pathes, (GFunc)g_free, NULL); 
     561                g_list_free(pathes); 
     562        } 
     563 
    553564        osync_trace(TRACE_EXIT, "%s: %p", __func__, env); 
    554565        return (void *)env;