diff options
author | Nils Durner <durner@gnunet.org> | 2005-12-20 21:00:39 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2005-12-20 21:00:39 +0000 |
commit | e70a8dec5b6ca856f28bac2ce62e9d014dfe7f3d (patch) | |
tree | 74d6a0b91060a1994577b3d65413dd082073a7e8 | |
parent | a42191f9d61a87d374bf125a74732f751d9a2dc4 (diff) | |
download | gnunet-gtk-e70a8dec5b6ca856f28bac2ce62e9d014dfe7f3d.tar.gz gnunet-gtk-e70a8dec5b6ca856f28bac2ce62e9d014dfe7f3d.zip |
Don't "suggest" names for GNUnet directories
-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 | } |