According to [EMAIL PROTECTED]:
> A little background info:
> 
> I'm running version 3.2.0 B3 on RedHat Linux 7.1 and I'm not using any of
> the default directories, therefore when I run htdig & htsearch I need to
> specify the location of my configuration file with a "-c <config_dir>"
> 
> 
> Here's the problem:
> 
> The only way of being able to call htsearch without having to put the
> configuration file in the default directory, is to post the action as if I
> was running it as a command line program.  Since I'm not using any of the
> default directories, I need to specify to the htsearch where my
> configuration file is located or else it always goes hunting at /etc which
> is the default directory.
> 
> <form method="post"
> action="/cgi-bin/htsearch?-c/files/htdigDB/myweb/conf/myweb.conf">

Horribly bad idea, as it exploits a security hole in the code which we
closed up in the latest versions under development.  I.e. this won't
work for long, especially if you run into one of many bugs in 3.2.0b3
that are fixed in 3.2.0b4 development snapshots.

> I also modified the templates (header/footer/wrapper/nomatch/syntax.html) to
> make them fit to the action that I wanted them to take when a person
> "refines" their search.  I thought I hacked it pretty well, but apparently
> the buttons on the footer, the ones that create the previous page, page
> list, and next page buttons/links they all have htsearch dynamically create
> the hyperlink to go directly to the default directory to look for the
> configuration file.
> 
> I read somewhere on the development page that it's a known bug (being able
> to call a command line program from the form's action), but if it is a bug,
> how else is it possible for a search form to call htsearch and be able to
> use a specific configuration file that is not located in the default
> directory?  Is there a way to modify the $(PREVPAGE), $(PAGELIST), and
> $(NEXTPAGE) such that it'll point to a user defined directory?

You might be able to hack something that works with the script_name
attribute, but your best bet is to abandon this messy approach.

The proper way would be to recompile htsearch with the CONFIG_DIR defined
as you want it.  Failing that, you can put together a wrapper script for
htsearch as below, and make sure all your search forms call it with the
GET method, not POST.

------------------------
#!/bin/sh

query=$QUERY_STRING
unset QUERY_STRING
unset REQUEST_METHOD
CONFIG_DIR=/path/to/my/config/files
export CONFIG_DIR
exec /path/to/my/real/htsearch "$query"

------------------------

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to