aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon L. B. Nielsen <simon@FreeBSD.org>2005-03-08 23:03:20 +0000
committerSimon L. B. Nielsen <simon@FreeBSD.org>2005-03-08 23:03:20 +0000
commit9032bfc4257d29a3383008d56c5353bbe7aa420f (patch)
tree4e1550c08b82c66b7f8924f97789c68730ca11d8
parent526b67892888c4e10d2d0b3e05d7f221d7f96f78 (diff)
downloadports-9032bfc4257d29a3383008d56c5353bbe7aa420f.tar.gz
ports-9032bfc4257d29a3383008d56c5353bbe7aa420f.zip
Notes
-rw-r--r--ftp/wget-devel/Makefile2
-rw-r--r--ftp/wget-devel/files/patch-CAN-2004-148751
2 files changed, 52 insertions, 1 deletions
diff --git a/ftp/wget-devel/Makefile b/ftp/wget-devel/Makefile
index 9a1831c13420..1e01542bd898 100644
--- a/ftp/wget-devel/Makefile
+++ b/ftp/wget-devel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= wget-devel
PORTVERSION= 1.9.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= ftp www
MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= wget
diff --git a/ftp/wget-devel/files/patch-CAN-2004-1487 b/ftp/wget-devel/files/patch-CAN-2004-1487
new file mode 100644
index 000000000000..d37947a1c88f
--- /dev/null
+++ b/ftp/wget-devel/files/patch-CAN-2004-1487
@@ -0,0 +1,51 @@
+diff -ruN wget-LFS-20040909/src/http.c wget-LFS-20040909.patched/src/http.c
+--- src/http.c.orig 2004-09-09 19:28:26.000000000 -0700
++++ src/http.c 2005-02-21 04:13:05.000000000 -0800
+@@ -1719,6 +1719,7 @@
+ /* Open the local file. */
+ if (!output_stream)
+ {
++ sanitize_path(*hs->local_file);
+ mkalldirs (*hs->local_file);
+ if (opt.backups)
+ rotate_backups (*hs->local_file);
+diff -ruN wget-LFS-20040909/src/utils.c wget-LFS-20040909.patched/src/utils.c
+--- src/utils.c.orig 2004-09-09 13:32:07.000000000 -0700
++++ src/utils.c 2005-02-21 04:11:54.000000000 -0800
+@@ -368,6 +368,25 @@
+ #endif
+ }
+
++
++char *
++sanitize_path(char *path)
++{
++ char *str = NULL;
++
++ /* evilhost/../ */
++ while ((str = strstr(path, "..")) != NULL)
++ memcpy(str, "__", 2);
++ /* evilhost/.bashrc */
++ while ((str = strstr(path, "/.")) != NULL)
++ str[1] = '_';
++ /* .bashrc */
++ if (*path == '.')
++ *path = '_';
++ return path;
++}
++
++
+ /* Returns 0 if PATH is a directory, 1 otherwise (any kind of file).
+ Returns 0 on error. */
+ int
+diff -ruN wget-LFS-20040909/src/utils.h wget-LFS-20040909.patched/src/utils.h
+--- src/utils.h.orig 2004-09-09 21:05:36.000000000 -0700
++++ src/utils.h 2005-02-21 04:04:07.000000000 -0800
+@@ -83,6 +83,7 @@
+ int make_directory PARAMS ((const char *));
+ char *unique_name PARAMS ((const char *, int));
+ char *file_merge PARAMS ((const char *, const char *));
++char *sanitize_path PARAMS ((char *));
+
+ int acceptable PARAMS ((const char *));
+ int accdir PARAMS ((const char *s, enum accd));