You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@hyperreal.org on 1998/07/13 23:34:10 UTC
cvs commit: modperl/src/modules/perl mod_perl.c
dougm 98/07/13 14:34:10
Modified: src/modules/perl mod_perl.c
Log:
mod_perl_set_cwd() will try to getenv("PWD") before trying Cwd::fastcwd()
which does not untaint in 5.004
Revision Changes Path
1.30 +8 -2 modperl/src/modules/perl/mod_perl.c
Index: mod_perl.c
===================================================================
RCS file: /export/home/cvs/modperl/src/modules/perl/mod_perl.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- mod_perl.c 1998/07/12 19:54:16 1.29
+++ mod_perl.c 1998/07/13 21:34:09 1.30
@@ -352,8 +352,14 @@
{
char *name = "Apache::Server::CWD";
GV *gv = gv_fetchpv(name, GV_ADDMULTI, SVt_PV);
- SV *cwd = perl_eval_pv("require Cwd; Cwd::fastcwd()", TRUE);
- sv_setsv(GvSV(gv), cwd);
+ char *pwd = getenv("PWD");
+
+ if(pwd)
+ sv_setpv(GvSV(gv), pwd);
+ else
+ sv_setsv(GvSV(gv),
+ perl_eval_pv("require Cwd; Cwd::fastcwd()", TRUE));
+
mod_perl_untaint(GvSV(gv));
}