- implement testcases
- implement performance tests
* FS: [CG]
- - publishing a directory sets the embedded filename to "empty"
- (likely an issue with cutting off everything before '/' in the filename,
- which in the case of a directory would leave nothing)
- trust: do not charge when "idle" / load considerations (migration, routing)
- bound our priorities based on priorities used by other peers
- datastore reservation (publishing)
char *us;
char *ext;
char *dn;
+ char *pos;
char *full_name;
if (NULL == uri)
fn = NULL;
if (NULL == filename)
{
- fn = GNUNET_FS_meta_data_suggest_filename (meta);
+ fn = GNUNET_FS_meta_data_suggest_filename (meta);
if (fn == NULL)
{
us = GNUNET_FS_uri_to_string (uri);
GNUNET_free (ext);
GNUNET_free (us);
}
+ /* change '\' to '/' (this should have happened
+ during insertion, but malicious peers may
+ not have done this) */
+ while (NULL != (pos = strstr (fn, "\\")))
+ *pos = '/';
+ /* remove '../' everywhere (again, well-behaved
+ peers don't do this, but don't trust that
+ we did not get something nasty) */
+ while (NULL != (pos = strstr (fn, "../")))
+ {
+ pos[0] = '_';
+ pos[1] = '_';
+ pos[2] = '_';
+ }
filename = fn;
}
if (dc->filename == NULL)
dc.entries = dc.entries->next;
}
fn = filename;
- while (NULL != (ss = strstr (fn,
- DIR_SEPARATOR_STR)))
+ while ( (NULL != (ss = strstr (fn,
+ DIR_SEPARATOR_STR))) &&
+ (strlen (ss) > 1) )
fn = ss + 1;
GNUNET_CONTAINER_meta_data_insert (ret->meta,
"<gnunet>",