View Issue Details

IDProjectCategoryView StatusLast Update
0002416gnunet-gtkgnunet-fs-gtkpublic2012-11-05 17:32
ReporterLRN Assigned ToChristian Grothoff Due Date
PriorityurgentSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.9.4Fixed in Version0.9.4 
Summary0002416: GNUnet fails to create namespace with wrong names
DescriptionGNUNET_FS_namespace_create() creates a file that stores namespace key.
File name == namespace description.
If namespace description contains invalid characters (such as '?' on W32), GNUNET_FS_namespace_create() fails and returns NULL.
gnunet-fs-gtk_create-pseudonym.c calls GNUNET_FS_namespace_delete() for it immediately, not bothering to check that ns is NULL.
Anyway, i think that using arbitrary strings for filenames might be error-prone. Maybe use key hashes or something? On the other hand, they don't have any metadata, and the only things that help one to identify them are their filenames...Normalize them?
TagsNo tags attached.

Activities

Christian Grothoff

2012-06-12 10:05

manager   ~0006046

I guess using the encoded hash as the namespace filename might be best. Maybe 'struct GNUNET_CRYPTO_ShortHashAsciiEncoded' to get a slightly shorter filename (as the very long filenames sometimes also cause problems on some file systems).

LRN

2012-06-12 10:11

reporter   ~0006047

yes, but how are you going to show a list of identities to the user? The files do not have any data other than the key (AFAIK). You need also to add some kind of description to key files.

Christian Grothoff

2012-06-12 10:17

manager   ~0006048

Sure, I thought the metadata was serialized as well. But that problem would exist either way, as with canonicalization the descriptions would also be garbled.

Christian Grothoff

2012-06-13 15:55

manager   ~0006065

Ok, went over the code. The 'name' here is clearly supposed to be a valid filename; GNUNET_FS_namespace_create is also used to open an existing namespace file, so the 'name' argument must be a valid filename, otherwise the whole API won't work. Also, changing this will break backwards-compatibility badly.

So I think the answer is to restrict the legal characters in gnunet-fs-gtk (and likely gnunet-pseudonym) and of course check for the return value being NULL.

Christian Grothoff

2012-06-13 16:16

manager   ~0006066

SVN 21978 restricts characters for pseudonym names to alpha-numerical and "_" and "-", which should be pretty safe. (Albeit possibly inconvenient for international users, dealing with non-English characters that are safe for filenames is left as an exercise to the reader ;-).)

Issue History

Date ModifiedUsernameFieldChange
2012-06-11 12:19LRNNew Issue
2012-06-12 10:05Christian GrothoffNote Added: 0006046
2012-06-12 10:05Christian GrothoffAssigned To => Christian Grothoff
2012-06-12 10:05Christian GrothoffStatusnew => confirmed
2012-06-12 10:05Christian GrothoffAssigned ToChristian Grothoff =>
2012-06-12 10:05Christian GrothoffTarget Version => 0.9.4
2012-06-12 10:11LRNNote Added: 0006047
2012-06-12 10:17Christian GrothoffNote Added: 0006048
2012-06-12 18:54Christian GrothoffPrioritylow => high
2012-06-13 09:12Christian GrothoffAssigned To => Christian Grothoff
2012-06-13 09:12Christian GrothoffStatusconfirmed => assigned
2012-06-13 09:12Christian GrothoffPriorityhigh => urgent
2012-06-13 15:55Christian GrothoffNote Added: 0006065
2012-06-13 16:16Christian GrothoffNote Added: 0006066
2012-06-13 16:16Christian GrothoffStatusassigned => resolved
2012-06-13 16:16Christian GrothoffFixed in Version => 0.9.4
2012-06-13 16:16Christian GrothoffResolutionopen => fixed
2012-11-05 17:32Christian GrothoffStatusresolved => closed