diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-11-30 06:24:58 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-11-30 06:24:58 +0000 |
commit | 090ca40dda05f308a7800ef540c4910251d17ebd (patch) | |
tree | ce05c345c8a17cb265c553e2c631e544f8fd8eda /ftp | |
parent | upgrade to 4.2.0 (diff) |
Use vendor-supplied prevent glob overflow patch
Diffstat (limited to 'ftp')
-rw-r--r-- | ftp/wu-ftpd+ipv6/Makefile | 11 | ||||
-rw-r--r-- | ftp/wu-ftpd+ipv6/distinfo | 2 | ||||
-rw-r--r-- | ftp/wu-ftpd+ipv6/files/patch-ak | 11 | ||||
-rw-r--r-- | ftp/wu-ftpd+ipv6/files/patch-ap | 229 | ||||
-rw-r--r-- | ftp/wu-ftpd/Makefile | 11 | ||||
-rw-r--r-- | ftp/wu-ftpd/distinfo | 2 | ||||
-rw-r--r-- | ftp/wu-ftpd/files/patch-ak | 11 | ||||
-rw-r--r-- | ftp/wu-ftpd/files/patch-ap | 229 |
8 files changed, 36 insertions, 470 deletions
diff --git a/ftp/wu-ftpd+ipv6/Makefile b/ftp/wu-ftpd+ipv6/Makefile index 5745f8993586..bbf6378a8a77 100644 --- a/ftp/wu-ftpd+ipv6/Makefile +++ b/ftp/wu-ftpd+ipv6/Makefile @@ -9,15 +9,16 @@ PORTNAME= wu-ftpd PORTVERSION= 2.6.1 -PORTREVISION= 7 +PORTREVISION= 8 CATEGORIES= ftp DIST_SUBDIR= wu-ftpd MASTER_SITES= ftp://ftp.wu-ftpd.org/pub/wu-ftpd/ PATCH_SITES= ftp://ftp.wu-ftpd.org/pub/wu-ftpd/patches/apply_to_2.6.1/ -PATCHFILES= missing_format_strings.patch \ - nlst-shows-dirs.patch \ - pasv-port-allow-correction.patch -PATCH_DIST_STRIP= -S + -p0 + +# Due to error pasv-port-allow-correction.patch copied locally as patch-ak +PATCHFILES= ftpglob.patch \ + missing_format_strings.patch \ + nlst-shows-dirs.patch MAINTAINER= ache@FreeBSD.org diff --git a/ftp/wu-ftpd+ipv6/distinfo b/ftp/wu-ftpd+ipv6/distinfo index 1397115cb1f5..86bada90de74 100644 --- a/ftp/wu-ftpd+ipv6/distinfo +++ b/ftp/wu-ftpd+ipv6/distinfo @@ -1,4 +1,4 @@ MD5 (wu-ftpd/wu-ftpd-2.6.1.tar.gz) = 857ab8504998a753195eb94ac2dc39a4 +MD5 (wu-ftpd/ftpglob.patch) = 85f6ce5ab6e0d29d439c19b0582e20f8 MD5 (wu-ftpd/missing_format_strings.patch) = ddf252d05e01931b4f985cdcf6f5f106 MD5 (wu-ftpd/nlst-shows-dirs.patch) = 58c002ad680fae0d0caba45b2ead30aa -MD5 (wu-ftpd/pasv-port-allow-correction.patch) = 973f82a3cce4cb30ef0adc873d5078fc diff --git a/ftp/wu-ftpd+ipv6/files/patch-ak b/ftp/wu-ftpd+ipv6/files/patch-ak new file mode 100644 index 000000000000..ba65587542a6 --- /dev/null +++ b/ftp/wu-ftpd+ipv6/files/patch-ak @@ -0,0 +1,11 @@ +--- src/ftpd.c 2000/07/07 22:17:38 1.113 ++++ src/ftpd.c 2000/08/29 17:26:23 +@@ -7274,7 +7274,7 @@ + int which; + struct aclmember *entry = NULL; + (void) acl_getclass(class); +- while (getaclentry("port-allow", &entry)) { ++ while (getaclentry("pasv-allow", &entry)) { + if ((ARG0 != NULL) && (strcasecmp(class, ARG0) == 0)) + for (which = 1; (which < MAXARGS) && (ARG[which] != NULL); which++) { + if (hostmatch(ARG[which], remoteaddr, NULL)) diff --git a/ftp/wu-ftpd+ipv6/files/patch-ap b/ftp/wu-ftpd+ipv6/files/patch-ap index d3b1685e2ca9..68357225ffe0 100644 --- a/ftp/wu-ftpd+ipv6/files/patch-ap +++ b/ftp/wu-ftpd+ipv6/files/patch-ap @@ -1,25 +1,5 @@ --- src/glob.c.old Sat Jul 1 22:17:39 2000 +++ src/glob.c Wed Nov 28 13:42:26 2001 -@@ -41,6 +41,7 @@ - #include <pwd.h> - #include <errno.h> - #include <stdio.h> -+#include <stdlib.h> - #include <string.h> - - #include "proto.h" -@@ -48,6 +49,11 @@ - #define QUOTE 0200 - #define TRIM 0177 - #define eq(a,b) (strcmp(a, b)==0) -+ -+#ifndef NCARGS -+#define NCARGS 20480 /* at least on SGI IRIX */ -+#endif -+ - #define GAVSIZ (NCARGS/6) - #define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR) - @@ -112,7 +118,7 @@ fixpath(v); @@ -29,212 +9,3 @@ else if ((strlen(v) > 1) && (v[strlen(v) - 1] == '/')) v[strlen(v) - 1] = '\0'; -@@ -174,19 +180,21 @@ - sort(); - } - -+static int -+argcmp(const void *p1, const void *p2) -+{ -+ char *s1 = *(char **) p1; -+ char *s2 = *(char **) p2; -+ -+ return (strcmp(s1, s2)); -+} -+ - static void sort(void) - { -- register char **p1, **p2, *c; - char **Gvp = &gargv[gargc]; - -- p1 = sortbas; -- while (p1 < Gvp - 1) { -- p2 = p1; -- while (++p2 < Gvp) -- if (strcmp(*p1, *p2) > 0) -- c = *p1, *p1 = *p2, *p2 = c; -- p1++; -- } -+ if (!globerr) -+ qsort(sortbas, Gvp - sortbas, sizeof (*sortbas), argcmp); - sortbas = Gvp; - } - -@@ -292,13 +300,16 @@ - static int execbrc(char *p, char *s) - { - char restbuf[BUFSIZ + 2]; -+ char *restbufend = &restbuf[sizeof(restbuf)]; - register char *pe, *pm, *pl; - int brclev = 0; - char *lm, savec, *sgpathp; - -- for (lm = restbuf; *p != '{'; *lm++ = *p++) -- continue; -- for (pe = ++p; *pe; pe++) -+ for (lm = restbuf; *p != '{'; *lm++ = *p++) { -+ if (lm >= restbufend) -+ return (0); -+ } -+ for (pe = ++p; *pe; pe++) { - switch (*pe) { - - case '{': -@@ -314,11 +325,19 @@ - case '[': - for (pe++; *pe && *pe != ']'; pe++) - continue; -+ if (!*pe) { -+ globerr = "Missing ]"; -+ return (0); -+ } - continue; - } -+ } - pend: -- brclev = 0; -- for (pl = pm = p; pm <= pe; pm++) -+ if (brclev || !*pe) { -+ globerr = "Missing }"; -+ return (0); -+ } -+ for (pl = pm = p; pm <= pe; pm++) { - switch (*pm & (QUOTE | TRIM)) { - - case '{': -@@ -339,6 +358,8 @@ - doit: - savec = *pm; - *pm = 0; -+ if (lm + strlen(pl) + strlen(pe + 1) >= restbufend) -+ return (0); - (void) strcpy(lm, pl); - (void) strcat(restbuf, pe + 1); - *pm = savec; -@@ -352,19 +373,18 @@ - return (1); - sort(); - pl = pm + 1; -- if (brclev) -- return (0); - continue; - - case '[': - for (pm++; *pm && *pm != ']'; pm++) - continue; -- if (!*pm) -- pm--; -+ if (!*pm) { -+ globerr = "Missing ]"; -+ return (0); -+ } - continue; - } -- if (brclev) -- goto doit; -+ } - return (0); - } - -@@ -416,11 +436,10 @@ - else if (scc == (lc = cc)) - ok++; - } -- if (cc == 0) -- if (ok) -- p--; -- else -- return 0; -+ if (cc == 0) { -+ globerr = "Missing ]"; -+ return (0); -+ } - continue; - - case '*': -@@ -473,73 +492,16 @@ - } - } - --/* This function appears to be unused, so why waste time and space on it? */ --#if 0 == 1 --static int Gmatch(register char *s, register char *p) --{ -- register int scc; -- int ok, lc; -- int c, cc; -- -- for (;;) { -- scc = *s++ & TRIM; -- switch (c = *p++) { -- -- case '[': -- ok = 0; -- lc = 077777; -- while (cc = *p++) { -- if (cc == ']') { -- if (ok) -- break; -- return (0); -- } -- if (cc == '-') { -- if (lc <= scc && scc <= *p++) -- ok++; -- } -- else if (scc == (lc = cc)) -- ok++; -- } -- if (cc == 0) -- if (ok) -- p--; -- else -- return 0; -- continue; -- -- case '*': -- if (!*p) -- return (1); -- for (s--; *s; s++) -- if (Gmatch(s, p)) -- return (1); -- return (0); -- -- case 0: -- return (scc == 0); -- -- default: -- if ((c & TRIM) != scc) -- return (0); -- continue; -- -- case '?': -- if (scc == 0) -- return (0); -- continue; -- -- } -- } --} --#endif /* Gmatch exclusion */ -- - static void Gcat(register char *s1, register char *s2) - { - register size_t len = strlen(s1) + strlen(s2) + 1; - -+ if (globerr) -+ return; - if (len >= gnleft || gargc >= GAVSIZ - 1) - globerr = "Arguments too long"; -+ else if (len > MAXPATHLEN) -+ globerr = "Pathname too long"; - else { - gargc++; - gnleft -= len; -@@ -620,6 +582,7 @@ - { - register char **av = av0; - -+ if (av) - while (*av) - free(*av++); - } diff --git a/ftp/wu-ftpd/Makefile b/ftp/wu-ftpd/Makefile index 5745f8993586..bbf6378a8a77 100644 --- a/ftp/wu-ftpd/Makefile +++ b/ftp/wu-ftpd/Makefile @@ -9,15 +9,16 @@ PORTNAME= wu-ftpd PORTVERSION= 2.6.1 -PORTREVISION= 7 +PORTREVISION= 8 CATEGORIES= ftp DIST_SUBDIR= wu-ftpd MASTER_SITES= ftp://ftp.wu-ftpd.org/pub/wu-ftpd/ PATCH_SITES= ftp://ftp.wu-ftpd.org/pub/wu-ftpd/patches/apply_to_2.6.1/ -PATCHFILES= missing_format_strings.patch \ - nlst-shows-dirs.patch \ - pasv-port-allow-correction.patch -PATCH_DIST_STRIP= -S + -p0 + +# Due to error pasv-port-allow-correction.patch copied locally as patch-ak +PATCHFILES= ftpglob.patch \ + missing_format_strings.patch \ + nlst-shows-dirs.patch MAINTAINER= ache@FreeBSD.org diff --git a/ftp/wu-ftpd/distinfo b/ftp/wu-ftpd/distinfo index 1397115cb1f5..86bada90de74 100644 --- a/ftp/wu-ftpd/distinfo +++ b/ftp/wu-ftpd/distinfo @@ -1,4 +1,4 @@ MD5 (wu-ftpd/wu-ftpd-2.6.1.tar.gz) = 857ab8504998a753195eb94ac2dc39a4 +MD5 (wu-ftpd/ftpglob.patch) = 85f6ce5ab6e0d29d439c19b0582e20f8 MD5 (wu-ftpd/missing_format_strings.patch) = ddf252d05e01931b4f985cdcf6f5f106 MD5 (wu-ftpd/nlst-shows-dirs.patch) = 58c002ad680fae0d0caba45b2ead30aa -MD5 (wu-ftpd/pasv-port-allow-correction.patch) = 973f82a3cce4cb30ef0adc873d5078fc diff --git a/ftp/wu-ftpd/files/patch-ak b/ftp/wu-ftpd/files/patch-ak new file mode 100644 index 000000000000..ba65587542a6 --- /dev/null +++ b/ftp/wu-ftpd/files/patch-ak @@ -0,0 +1,11 @@ +--- src/ftpd.c 2000/07/07 22:17:38 1.113 ++++ src/ftpd.c 2000/08/29 17:26:23 +@@ -7274,7 +7274,7 @@ + int which; + struct aclmember *entry = NULL; + (void) acl_getclass(class); +- while (getaclentry("port-allow", &entry)) { ++ while (getaclentry("pasv-allow", &entry)) { + if ((ARG0 != NULL) && (strcasecmp(class, ARG0) == 0)) + for (which = 1; (which < MAXARGS) && (ARG[which] != NULL); which++) { + if (hostmatch(ARG[which], remoteaddr, NULL)) diff --git a/ftp/wu-ftpd/files/patch-ap b/ftp/wu-ftpd/files/patch-ap index d3b1685e2ca9..68357225ffe0 100644 --- a/ftp/wu-ftpd/files/patch-ap +++ b/ftp/wu-ftpd/files/patch-ap @@ -1,25 +1,5 @@ --- src/glob.c.old Sat Jul 1 22:17:39 2000 +++ src/glob.c Wed Nov 28 13:42:26 2001 -@@ -41,6 +41,7 @@ - #include <pwd.h> - #include <errno.h> - #include <stdio.h> -+#include <stdlib.h> - #include <string.h> - - #include "proto.h" -@@ -48,6 +49,11 @@ - #define QUOTE 0200 - #define TRIM 0177 - #define eq(a,b) (strcmp(a, b)==0) -+ -+#ifndef NCARGS -+#define NCARGS 20480 /* at least on SGI IRIX */ -+#endif -+ - #define GAVSIZ (NCARGS/6) - #define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR) - @@ -112,7 +118,7 @@ fixpath(v); @@ -29,212 +9,3 @@ else if ((strlen(v) > 1) && (v[strlen(v) - 1] == '/')) v[strlen(v) - 1] = '\0'; -@@ -174,19 +180,21 @@ - sort(); - } - -+static int -+argcmp(const void *p1, const void *p2) -+{ -+ char *s1 = *(char **) p1; -+ char *s2 = *(char **) p2; -+ -+ return (strcmp(s1, s2)); -+} -+ - static void sort(void) - { -- register char **p1, **p2, *c; - char **Gvp = &gargv[gargc]; - -- p1 = sortbas; -- while (p1 < Gvp - 1) { -- p2 = p1; -- while (++p2 < Gvp) -- if (strcmp(*p1, *p2) > 0) -- c = *p1, *p1 = *p2, *p2 = c; -- p1++; -- } -+ if (!globerr) -+ qsort(sortbas, Gvp - sortbas, sizeof (*sortbas), argcmp); - sortbas = Gvp; - } - -@@ -292,13 +300,16 @@ - static int execbrc(char *p, char *s) - { - char restbuf[BUFSIZ + 2]; -+ char *restbufend = &restbuf[sizeof(restbuf)]; - register char *pe, *pm, *pl; - int brclev = 0; - char *lm, savec, *sgpathp; - -- for (lm = restbuf; *p != '{'; *lm++ = *p++) -- continue; -- for (pe = ++p; *pe; pe++) -+ for (lm = restbuf; *p != '{'; *lm++ = *p++) { -+ if (lm >= restbufend) -+ return (0); -+ } -+ for (pe = ++p; *pe; pe++) { - switch (*pe) { - - case '{': -@@ -314,11 +325,19 @@ - case '[': - for (pe++; *pe && *pe != ']'; pe++) - continue; -+ if (!*pe) { -+ globerr = "Missing ]"; -+ return (0); -+ } - continue; - } -+ } - pend: -- brclev = 0; -- for (pl = pm = p; pm <= pe; pm++) -+ if (brclev || !*pe) { -+ globerr = "Missing }"; -+ return (0); -+ } -+ for (pl = pm = p; pm <= pe; pm++) { - switch (*pm & (QUOTE | TRIM)) { - - case '{': -@@ -339,6 +358,8 @@ - doit: - savec = *pm; - *pm = 0; -+ if (lm + strlen(pl) + strlen(pe + 1) >= restbufend) -+ return (0); - (void) strcpy(lm, pl); - (void) strcat(restbuf, pe + 1); - *pm = savec; -@@ -352,19 +373,18 @@ - return (1); - sort(); - pl = pm + 1; -- if (brclev) -- return (0); - continue; - - case '[': - for (pm++; *pm && *pm != ']'; pm++) - continue; -- if (!*pm) -- pm--; -+ if (!*pm) { -+ globerr = "Missing ]"; -+ return (0); -+ } - continue; - } -- if (brclev) -- goto doit; -+ } - return (0); - } - -@@ -416,11 +436,10 @@ - else if (scc == (lc = cc)) - ok++; - } -- if (cc == 0) -- if (ok) -- p--; -- else -- return 0; -+ if (cc == 0) { -+ globerr = "Missing ]"; -+ return (0); -+ } - continue; - - case '*': -@@ -473,73 +492,16 @@ - } - } - --/* This function appears to be unused, so why waste time and space on it? */ --#if 0 == 1 --static int Gmatch(register char *s, register char *p) --{ -- register int scc; -- int ok, lc; -- int c, cc; -- -- for (;;) { -- scc = *s++ & TRIM; -- switch (c = *p++) { -- -- case '[': -- ok = 0; -- lc = 077777; -- while (cc = *p++) { -- if (cc == ']') { -- if (ok) -- break; -- return (0); -- } -- if (cc == '-') { -- if (lc <= scc && scc <= *p++) -- ok++; -- } -- else if (scc == (lc = cc)) -- ok++; -- } -- if (cc == 0) -- if (ok) -- p--; -- else -- return 0; -- continue; -- -- case '*': -- if (!*p) -- return (1); -- for (s--; *s; s++) -- if (Gmatch(s, p)) -- return (1); -- return (0); -- -- case 0: -- return (scc == 0); -- -- default: -- if ((c & TRIM) != scc) -- return (0); -- continue; -- -- case '?': -- if (scc == 0) -- return (0); -- continue; -- -- } -- } --} --#endif /* Gmatch exclusion */ -- - static void Gcat(register char *s1, register char *s2) - { - register size_t len = strlen(s1) + strlen(s2) + 1; - -+ if (globerr) -+ return; - if (len >= gnleft || gargc >= GAVSIZ - 1) - globerr = "Arguments too long"; -+ else if (len > MAXPATHLEN) -+ globerr = "Pathname too long"; - else { - gargc++; - gnleft -= len; -@@ -620,6 +582,7 @@ - { - register char **av = av0; - -+ if (av) - while (*av) - free(*av++); - } |