-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 11:03:48 oes Exp $";
+/* vim:ts=3: */
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.13 2001/06/05 22:33:54 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.13 2001/06/05 22:33:54 jongfoster
+ *
+ * Fixed minor memory leak.
+ * Also now uses make_path to prepend the pathnames.
+ *
+ * Revision 1.12 2001/06/05 20:04:09 jongfoster
+ * Now uses _snprintf() in place of snprintf() under Win32.
+ *
+ * Revision 1.11 2001/06/04 18:31:58 swa
+ * files are now prefixed with either `confdir' or `logdir'.
+ * `make redhat-dist' replaces both entries confdir and logdir
+ * with redhat values
+ *
+ * Revision 1.10 2001/06/03 19:11:54 oes
+ * introduced confdir option
+ *
* Revision 1.10 2001/06/03 11:03:48 oes
* Makefile/in
*
# include "w32log.h"
# endif /* ndef _WIN_CONSOLE */
+/* VC++ has "_snprintf", not "snprintf" */
+#define snprintf _snprintf
+
#else /* ifndef _WIN32 */
# include <unistd.h>
#define hash_actions_file 3825730796ul /* FIXME "permissionsfile" */
#define hash_debug 78263ul
#define hash_confdir 1978389lu
+#define hash_logdir 422889lu
#define hash_forwardfile 1268669141ul
#define hash_jarfile 2046641ul
#define hash_listen_address 1255650842ul
#define hash_show_on_task_bar 215410365ul
-
/*********************************************************************
*
* Function : unload_configfile
}
#endif /* def JAR_FILES */
+ freez((char *)config->confdir);
+ freez((char *)config->logdir);
+
freez((char *)config->haddr);
freez((char *)config->logfile);
FILE *configfp = NULL;
struct configuration_spec * config = NULL;
struct client_state * fake_csp;
-
struct file_list *fs;
if (!check_file_changed(current_configfile, configfile, &fs))
#ifdef TRUST_FILES
case hash_trustfile :
freez((char *)config->trustfile);
- config->trustfile = strdup(arg);
+ config->trustfile = make_path(config->confdir, arg);
continue;
case hash_trust_info_url :
continue;
case hash_confdir :
+ freez((char *)config->confdir);
config->confdir = strdup(arg);
continue;
+ case hash_logdir :
+ freez((char *)config->logdir);
+ config->logdir = strdup(arg);
+ continue;
+
case hash_single_threaded :
config->multi_threaded = 0;
continue;
case hash_actions_file :
freez((char *)config->actions_file);
- config->actions_file = strdup(arg);
+ config->actions_file = make_path(config->confdir, arg);
continue;
case hash_logfile :
freez((char *)config->logfile);
- config->logfile = strdup(arg);
+ config->logfile = make_path(config->logdir, arg);
continue;
#ifdef JAR_FILES
case hash_jarfile :
freez((char *)config->jarfile);
- config->jarfile = strdup(arg);
+ config->jarfile = make_path(config->logdir, arg);
continue;
#endif /* def JAR_FILES */
case hash_forwardfile :
freez((char *)config->forwardfile);
- config->forwardfile = strdup(arg);
+ config->forwardfile = make_path(config->confdir, arg);
continue;
#ifdef ACL_FILES
case hash_aclfile :
freez((char *)config->aclfile);
- config->aclfile = strdup(arg);
+ config->aclfile = make_path(config->confdir, arg);
continue;
#endif /* def ACL_FILES */
#ifdef PCRS
case hash_re_filterfile :
freez((char *)config->re_filterfile);
- config->re_filterfile = strdup(arg);
+ config->re_filterfile = make_path(config->confdir, arg);
continue;
#endif /* def PCRS */