dgaudet 97/09/15 21:40:36
Modified: src/modules/standard mod_speling.c
Log:
use popendir/pclosedir to avoid resource losing race condition
Revision Changes Path
1.3 +3 -3 apachen/src/modules/standard/mod_speling.c
Index: mod_speling.c
===================================================================
RCS file: /export/home/cvs/apachen/src/modules/standard/mod_speling.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mod_speling.c 1997/09/16 04:30:22 1.2
+++ mod_speling.c 1997/09/16 04:40:34 1.3
@@ -228,7 +228,7 @@
url = pstrndup(r->pool, r->uri, (urlen - pglen));
/* Now open the directory and do ourselves a check... */
- dirp = opendir(good);
+ dirp = popendir(r->pool, good);
if (dirp == NULL) /* Oops, not a directory... */
return DECLINED;
@@ -247,7 +247,7 @@
* Do _not_ try to redirect this, it causes a loop!
*/
if (strcmp(bad, dir_entry->d_name) == 0) {
- closedir(dirp);
+ pclosedir(r->pool, dirp);
return OK;
}
/*
@@ -310,7 +310,7 @@
#endif
}
}
- closedir(dirp);
+ pclosedir(r->pool, dirp);
if (candidates->nelts != 0) {
/* Wow... we found us a mispelling. Construct a fixed url */