tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Brazile <ja...@netcetera.ch>
Subject Re: websh and folders that contain spaces
Date Fri, 14 Nov 2003 10:11:07 GMT
> I'm taking this to the dev list ...

[problem with websh and filenames with spaces]

I haven't looked at the problem but I just wanted to mention that
as late as the Tcl conference this summer, there was still disagreement
about the proper way to safely exec/eval commands that were at least
partially made of variables. I am talking about the usage from the
Tcl side. I couldn't find the exact info about it from a quick search,
but I think this tip touches on it.

	http://www.tcl.tk/cgi-bin/tct/tip/103.html

I only point it out because I personally have never composed a command 
line as complicated as this:

eval exec \$prog [lrange $opts1 0 end] [lrange [getMoreopts] 0 end] \$file1 \$file2

Jason
------------------------------------------------------------------------
Jason Brazile                                 jason.brazile@netcetera.ch
Netcetera AG, 8040 Zuerich    phone +41 1 247 70 70  fax +41 1 247 70 75


> 
> I tracked the problem down: in src/generic/interpool.c there is a bug
> in lines 304-308:
> 
>     mapCmd = Tcl_NewStringObj("web::interpmap ", -1);
>     Tcl_IncrRefCount(mapCmd);
>     Tcl_AppendToObj(mapCmd, filename, -1);
>     res = Tcl_EvalObjEx(conf->mainInterp, mapCmd, 0);
>     Tcl_DecrRefCount(mapCmd);
> 
> The command to be evaled is a string instead of a list with two elements.
> Does anybody have a quick fix for this?
> 
> > I'm using version 3.5.0 that I downloaded from the Apache site. I then
> > compiled this to work in mod_websh mode. I'm running on FreeBSD 4.8 with
> > Apache 1.3.28. I also have tcl 8.3.5 installed along with itcl 3.2 and
> > tcllib 1.2.
> > My websh.conf file is completely empty (not sure if it should be, but was
> > the default file), and I've modified my apache httpd.conf as follows:
> > 
> > LoadModule websh_module         libexec/apache/mod_websh83.so.1
> > AddModule mod_websh.c
> > <IfModule mod_websh.c>
> >     WebshConfig /usr/local/etc/apache/websh.conf
> >     AddHandler websh .ws3
> >     AddHandler websh .wsh
> > </IfModule>
> > 
> > 
> > I don't believe I have any initializer code that I'm aware of. I've just
> > been vim'ing .ws3 files directly in my root directory until now. I realized
> > that I was going to need spaces in my directory names so that I could
> > dynamically create the navigation system based on file elements. Seemed like
> > a good idea at the time.
> > 
> > Anything else I can provide that may help?
> > 
> > 
> > d.
> > 
> > 
> > 
> > 
> > From: Ronnie Brunner [mailto:ronnie@netcetera.ch]
> > Sent: Thursday, November 13, 2003 3:01 AM
> > To: David McTavish
> > Cc: 'websh-user@tcl.apache.org'
> > Subject: Re: websh and folders that contain spaces
> > 
> > 
> > Hi
> > 
> > > Is there a bug in websh when it is trying to parse .ws3 files when those
> > > files are contained in a folder that contains spaces in the names?
> > 
> > We used to have a bug in web::include which was fixed in websh3.5
> > which sounded like that. Are you sure you work with the latest
> > release? It was fixed a very long time ago when Websh was still
> > version 3.0 (May 2002)
> > 
> > If you work with Websh3.5.0 there I need to know more about your setup
> > (mod_websh/cgi, interp. classes. initializer code ...)
> > 
> > Regards
> > Ronnie
> > 
> > > ie:
> > > I have the file t.ws3 which contains:
> > > web::put test
> > > 
> > > 
> > > If I put this in my root folder, everything works fine.
> > > As soon as I rename this file, to say:
> > > mv t.ws3 "t t.ws3"
> > 
> > Ronnie Brunner                             ronnie.brunner@netcetera.ch
> > Netcetera AG, 8040 Zuerich   phone +41 1 247 79 79 fax +41 1 247 70 75
> > 
> > To unsubscribe, e-mail: websh-user-unsubscribe@tcl.apache.org
> > For additional commands, e-mail: websh-user-help@tcl.apache.org
> > 
> > To unsubscribe, e-mail: websh-user-unsubscribe@tcl.apache.org
> > For additional commands, e-mail: websh-user-help@tcl.apache.org
> 
> ----------------------------------------------------------------------
> Ronnie Brunner                             ronnie.brunner@netcetera.ch
> Netcetera AG, 8040 Zuerich   phone +41 1 247 79 79 fax +41 1 247 70 75
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: websh-dev-help@tcl.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Mime
View raw message