1 Index: heimdal-0.7.2/appl/ftp/ftp/cmds.c
2 ===================================================================
3 --- heimdal-0.7.2.orig/appl/ftp/ftp/cmds.c 2005-04-18 17:45:12.000000000 +1000
4 +++ heimdal-0.7.2/appl/ftp/ftp/cmds.c 2006-03-09 12:50:02.997025112 +1100
7 memset(&gl, 0, sizeof(gl));
8 flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE;
10 if (glob(argv[i], flags, NULL, &gl) || gl.gl_pathc == 0) {
12 + if (roken_glob(argv[i], flags, NULL, &gl) || gl.gl_pathc == 0) {
14 warnx("%s: not found", argv[i]);
18 + roken_globfree(&gl);
22 for (cpp = gl.gl_pathv; cpp && *cpp != NULL; cpp++) {
30 + roken_globfree(&gl);
33 signal(SIGINT, oldintr);
35 @@ -1568,14 +1580,27 @@
37 flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE;
38 memset(&gl, 0, sizeof(gl));
40 if (glob(*cpp, flags, NULL, &gl) ||
42 + if (roken_glob(*cpp, flags, NULL, &gl) ||
45 warnx("%s: not found", *cpp);
49 + roken_globfree(&gl);
53 *cpp = strdup(gl.gl_pathv[0]); /* XXX - wasted memory */
57 + roken_globfree(&gl);
63 Index: heimdal-0.7.2/appl/ftp/ftp/ftp_locl.h
64 ===================================================================
65 --- heimdal-0.7.2.orig/appl/ftp/ftp/ftp_locl.h 2002-09-11 06:03:46.000000000 +1000
66 +++ heimdal-0.7.2/appl/ftp/ftp/ftp_locl.h 2006-03-09 12:50:02.998024960 +1100
74 +#include <roken-glob.h>
79 Index: heimdal-0.7.2/appl/ftp/ftpd/ftpcmd.y
80 ===================================================================
81 --- heimdal-0.7.2.orig/appl/ftp/ftpd/ftpcmd.y 2004-08-20 23:31:19.000000000 +1000
82 +++ heimdal-0.7.2/appl/ftp/ftpd/ftpcmd.y 2006-03-09 12:50:03.000024656 +1100
84 GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE;
86 memset(&gl, 0, sizeof(gl));
88 if (glob($1, flags, NULL, &gl) ||
90 + if (roken_glob($1, flags, NULL, &gl) ||
93 reply(550, "not found");
96 $$ = strdup(gl.gl_pathv[0]);
101 + roken_globfree(&gl);
106 Index: heimdal-0.7.2/appl/ftp/ftpd/ftpd.c
107 ===================================================================
108 --- heimdal-0.7.2.orig/appl/ftp/ftpd/ftpd.c 2005-06-02 20:41:28.000000000 +1000
109 +++ heimdal-0.7.2/appl/ftp/ftpd/ftpd.c 2006-03-09 12:50:03.003024200 +1100
110 @@ -2234,7 +2234,11 @@
112 memset(&gl, 0, sizeof(gl));
115 if (glob(whichf, flags, 0, &gl)) {
117 + if (roken_glob(whichf, flags, 0, &gl)) {
119 reply(550, "not found");
121 } else if (gl.gl_pathc == 0) {
122 @@ -2341,7 +2345,11 @@
129 + roken_globfree(&gl);
134 Index: heimdal-0.7.2/appl/ftp/ftpd/ftpd_locl.h
135 ===================================================================
136 --- heimdal-0.7.2.orig/appl/ftp/ftpd/ftpd_locl.h 2005-04-25 05:58:14.000000000 +1000
137 +++ heimdal-0.7.2/appl/ftp/ftpd/ftpd_locl.h 2006-03-09 12:50:03.004024048 +1100
145 +#include <roken-glob.h>
150 Index: heimdal-0.7.2/appl/ftp/ftpd/popen.c
151 ===================================================================
152 --- heimdal-0.7.2.orig/appl/ftp/ftpd/popen.c 2002-04-02 21:57:39.000000000 +1000
153 +++ heimdal-0.7.2/appl/ftp/ftpd/popen.c 2006-03-09 12:50:03.013022680 +1100
155 #include <sys/wait.h>
161 +#include <roken-glob.h>
168 memset(&gl, 0, sizeof(gl));
171 glob(argv[argc], flags, NULL, &gl) ||
173 + roken_glob(argv[argc], flags, NULL, &gl) ||
176 gargv[gargc++] = strdup(argv[argc]);
179 *pop && gargc < MAXGLOBS - 1;
181 gargv[gargc++] = strdup(*pop);
185 + roken_globfree(&gl);
190 Index: heimdal-0.7.2/lib/roken/glob.c
191 ===================================================================
192 --- heimdal-0.7.2.orig/lib/roken/glob.c 2005-04-12 21:28:50.000000000 +1000
193 +++ heimdal-0.7.2/lib/roken/glob.c 2006-03-09 12:50:03.015022376 +1100
199 +#include "roken-glob.h"
206 int ROKEN_LIB_FUNCTION
207 -glob(const char *pattern,
208 +roken_glob(const char *pattern,
210 int (*errfunc)(const char *, int),
214 /* Free allocated data belonging to a glob_t structure. */
215 void ROKEN_LIB_FUNCTION
216 -globfree(glob_t *pglob)
217 +roken_globfree(glob_t *pglob)
221 Index: heimdal-0.7.2/lib/roken/glob.hin
222 ===================================================================
223 --- heimdal-0.7.2.orig/lib/roken/glob.hin 2005-04-13 23:17:56.000000000 +1000
224 +++ heimdal-0.7.2/lib/roken/glob.hin 2006-03-09 12:50:03.016022224 +1100
226 * @(#)glob.h 8.1 (Berkeley) 6/2/93
231 +#ifndef _ROKEN_GLOB_H_
232 +#define _ROKEN_GLOB_H_
234 #ifndef ROKEN_LIB_FUNCTION
237 #define GLOB_ABEND (-2) /* Unignored error. */
239 int ROKEN_LIB_FUNCTION
240 -glob (const char *, int, int (*)(const char *, int), glob_t *);
241 +roken_glob (const char *, int, int (*)(const char *, int), glob_t *);
243 void ROKEN_LIB_FUNCTION
244 -globfree (glob_t *);
245 +roken_globfree (glob_t *);
247 -#endif /* !_GLOB_H_ */
248 +#endif /* !_ROKEN_GLOB_H_ */
249 Index: heimdal-0.7.2/lib/roken/Makefile.am
250 ===================================================================
251 --- heimdal-0.7.2.orig/lib/roken/Makefile.am 2005-05-24 21:39:01.000000000 +1000
252 +++ heimdal-0.7.2/lib/roken/Makefile.am 2006-03-09 12:50:03.016022224 +1100
258 +glob_h = roken-glob.h
267 + cp glob.hin roken-glob.h
269 roken.h: make-roken$(EXEEXT)
270 @./make-roken$(EXEEXT) > tmp.h ;\