diff options
Diffstat (limited to 'src/plugins/fs/download.c')
-rw-r--r-- | src/plugins/fs/download.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c index 6698b329..18f81e7c 100644 --- a/src/plugins/fs/download.c +++ b/src/plugins/fs/download.c | |||
@@ -485,7 +485,13 @@ void displayDownloadComplete(const struct ECRS_URI * uri, | |||
485 | char fnURL[PATH_MAX + 1], dummy[2]; | 485 | char fnURL[PATH_MAX + 1], dummy[2]; |
486 | size_t len; | 486 | size_t len; |
487 | 487 | ||
488 | ren = ECRS_suggestFilename(fn); | 488 | len = strlen(ln); |
489 | /* Don't change the name of GNUnet directories (.gnd) */ | ||
490 | if (len >= 4 && strcmp(ln + len - 4, ".gnd") != 0) | ||
491 | ren = ECRS_suggestFilename(fn); | ||
492 | else | ||
493 | ren = NULL; | ||
494 | |||
489 | newFn = strrchr(ren ? ren : ln, DIR_SEPARATOR) + 1; | 495 | newFn = strrchr(ren ? ren : ln, DIR_SEPARATOR) + 1; |
490 | 496 | ||
491 | dstPath = getFileName("FS", | 497 | dstPath = getFileName("FS", |
@@ -529,7 +535,7 @@ void displayDownloadComplete(const struct ECRS_URI * uri, | |||
529 | fnURL[len] = 0; | 535 | fnURL[len] = 0; |
530 | 536 | ||
531 | /* avoid directory traversal */ | 537 | /* avoid directory traversal */ |
532 | while(dotdot = strstr("../")) { | 538 | while(dotdot = strstr(dstFile, "../")) { |
533 | dotdot[0] = '_'; | 539 | dotdot[0] = '_'; |
534 | dotdot[1] = '_'; | 540 | dotdot[1] = '_'; |
535 | } | 541 | } |