According to Peter L. Peres:
> On Tue, 17 Apr 2001, Doug Ledbetter wrote:
> >I'd prefer to store the config files in each user's account.  That way they 
> >have permission to edit them.
> 
> I think that you can make symlinks from ${config_dir} to each user's
> config file or, better, copy the user's config files into
> ${config_dir}/users/ using a batch script, every time this is needed ?.

Why would copying the users' config files into ${config_dir}/users/ be
better?  This has the disadvantage that changes by the user would not
take effect immediately, but instead would only happen when the batch
script runs.

Symbolic links are definitely the way to go, and are better and safer
than hacking htsearch to use a different scheme.  This could easily
be automated into the user account creation process.  E.g., if your
CONFIG_DIR is /etc/htdig, user home directories are in /home, and you want
user "buddy" to have his htdig.conf file in /home/buddy/htdig/htdig.conf,
then when you set up the account for "buddy" and make his home directory,
you can also make an htdig subdirectory and copy in a sample htdig.conf
in there, as well as making a symbolic link from /etc/htdig/buddy.conf
to /home/buddy/htdig/htdig.conf.  Better yet, you can make the symbolic
link from /etc/htdig/buddy to /home/buddy/htdig/conf, and they "buddy"
can create any number of config files in his htdig/conf subdirectory,
which will all be accessible from the search form as

  <input name="config" type="hidden" value="buddy/htdig">

where the "htdig" part could be changed to any other config file name
in the htdig/conf directory.  This gives you maximum flexibility with
no code changes required.

Setting the CONFIG_DIR compile-time variable to /home would definitely
not be a safe thing to do, unless you appended something more than just
".conf" to the "config" input parameter value.  (E.g.: you could append
"/htdig/htdig.conf", to do what your were suggesting.)  In any case,
if you do go ahead and hack the code, don't use strcat() the way you
were in the snippet of code you sent a couple weeks ago.  It will do
bad things!  strcat() expects a char * buffer as it's first argument,
and appends to it right in place, you you need to make sure ahead of
time the buffer is big enough to take what you're concatenating to it.
It would be better to use a String variable and append to it using the
"<<" operator as is done already in many places in the code.

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