According to Tsai, Jin:
> I have followed your suggestion to execute the handler.pl from command line,
> as follows:  Note that there is $ special character in the URL, so I have to
> use the single quote to prevent the shell escape.  The first output is
> executing handler.pl without the single quote protection, and the 2nd one
> has the single quote protection.
> 
> [root@fhlx007 bin]# ./handler.pl https
> https://fh2k018.fhmis.net/quickplace/mis/PageLibrary85256B3500795FD6.nsf/h_i
> ndex/C6D21E7CEE35AC8185256B3C0055D8F1/$FILE/Technology+Standards.doc
> /etc/htdig.conf
> s:    500
> r:    Unable to process request
> t:    text/html
> l:    187

Yes, this would fail because the shell would replace $FILE on the command
line with whatever the environment variable FILE contained, or an empty
string if undefined.

> [root@fhlx007 bin]# ./handler.pl https
> 'https://fh2k018.fhmis.net/quickplace/mis/PageLibrary85256B3500795FD6.nsf/h_
> index/C6D21E7CEE35AC8185256B3C0055D8F1/$FILE/Technology+Standards.doc'
> /etc/htdig.conf | more
> s:    200
> r:    OK
> t:    application/msword
> l:    72192
> m:    Thu, 31 Jan 2002 18:34:48 GMT

This is the relevant test.  When htdig calls the handler.pl script
itself, it passes the URL as a single argument without modifications or
expansions, so the handler will get it as-is.

> I thought I had added single quote in the curl command line in handler.pl to
> protect the URL from shell escape (please see my prevous message
> attachment).  However, it is not the case and the single quote has to be in
> place before the URL been passed to handler.pl.

Yes, you did put the '$url' in single quotes in the curl command used by
handler.pl, and that was indeed the correct thing to do.  I don't think
this is the cause of your problems.  How about you try the following
command to see what it does:

 ./handler.pl https ]
 
'https://fh2k018.fhmis.net/quickplace/mis/PageLibrary85256B3500795FD6.nsf/h_index/C6D21E7CEE35AC8185256B3C0055D8F1/$FILE/Technology+Standards.doc'
 \
 /etc/htdig.conf | cat -v -t -e | grep '^.:'

What I want to see is whether there are any extra space characters
getting added to the header.  If everything looks right with this,
the next step would be to put some debugging output in handler.pl
and/or ExternalTransport.cc to see what's going on when htdig calls the
handler.pl itself.

-- 
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