summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-arch/zoo/files/zoo-2.10-CAN-2005-2349.patch')
-rw-r--r--app-arch/zoo/files/zoo-2.10-CAN-2005-2349.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/app-arch/zoo/files/zoo-2.10-CAN-2005-2349.patch b/app-arch/zoo/files/zoo-2.10-CAN-2005-2349.patch
new file mode 100644
index 000000000000..3752728c8e5a
--- /dev/null
+++ b/app-arch/zoo/files/zoo-2.10-CAN-2005-2349.patch
@@ -0,0 +1,36 @@
+Taken from Fedora
+
+--- portable.c
++++ portable.c
+@@ -364,6 +364,31 @@
+ show_dir(direntry);
+ }
+ #endif
++ char *p;
++ /* take off '../' */
++ while ((p = strstr( direntry->dirname, "../" )) != NULL) {
++ while (*(p+3) != '\0') {
++ *p = *(p + 3);
++ p++;
++ }
++ *p = *(p+3); /* move last null */
++ //printf("zoo: skipped \"../\" path component in '%s'\n", direntry->dirname);
++ }
++ /* take off '/' */
++ if ( direntry->dirname[0] == '/' ) {
++ p = direntry->dirname;
++ while (*p != '\0') {
++ *p = *(p + 1);
++ p++;
++ }
++ *p = *(p+1); /* move last null */
++ //printf("zoo: skipped \"/\" path component in '%s'\n", direntry->dirname);
++ }
++ /* take off '..' */
++ if(!strcmp(direntry->dirname, ".."))
++ direntry->dirname[0] = '\0';
++ /* direntry->dirlen = strlen(direntry->dirname); */
++
+ return (0);
+ }
+