Hello all,

I'm setting up a server that will provide web hosting service to multiple 
people and would like to offer ht://Dig as the search engine.

At present, my biggest problem is with using custom config files for 
htsearch.  Each user will have their own ht://Dig config file, database and 
copy of htsearch in their cgi-bin directory.  htsearch will accept the name 
of the config file, but not the location.  My plan is to pass a username in 
on the "config" HTML form variable (instead of the config file name).  That 
way, htsearch would always find the config file at 
"/home/USERNAME/htdig/htdig.conf".  Does anybody have a patch to do this?

I've been playing with the source, but haven't been able to quite get it to 
work.  Here's what I've done:

(htsearch.cc: the config file stuff starts around line 125)

     config.Defaults(&defaults[0]);
     // To allow . in filename while still being 'secure',
     // e.g. htdig-f.q.d.n.conf
     if (!override_config && input.exists("config")
    && (strstr(input["config"], "./") == NULL))
     {

    // *** commented this line
    // char   *configDir = getenv("CONFIG_DIR");

    // *** changes follow
    char  *configDir;
    configDir = strcat("home/", input["config"]);
    configDir = strcat(configDir, "/htdig/htdig");
    // *** end changes

    if (configDir)
    {
        configFile = configDir;
    }
    else
    {
        configFile = CONFIG_DIR;
    }
    if (strlen(input["config"]) == 0)
      configFile = DEFAULT_CONFIG_FILE;
    else

      // *** this line changed too
      configFile << '/' << configDir << ".conf";
     }
     if (access(configFile, R_OK) < 0)
     {
    reportError(form("Unable to read configuration file '%s'",
           configFile.get()));
     }
     config.Read(configFile);


This seems to work from the command-line, but gives an error when running 
under Apache (Premature end of script headers).

Any suggestions would be appreciated.

thanks,
-dougl

____________________________________________________________

Doug Ledbetter -- Hagen Software, Inc.
[EMAIL PROTECTED]



_______________________________________________
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