If you run dbmail-adduser without a configuration file, it will segfault.
I tracked this down to an list that had never been through list_init().
Applying this trivial patch fixes the problem by init'ing the list even if
GetConfigValue() ends up bailing due to missing config file.
Please apply to CVS at your earliest convenience :-)
Aaron
*** dbmail/config.c 2003-03-17 08:04:08.000000000 -0800
--- dbmail-aaron/config.c 2003-05-14 02:04:50.000000000 -0700
***************
*** 44,57 ****
snprintf(service, LINESIZE, "[%s]", serviceName);
if ( !(cfile = fopen(cfilename, "r")) )
{
trace(CONFIG_ERROR_LEVEL, "ReadConfig(): could not open config file [%s]", cfilename);
return -1;
}
- list_init(items);
-
do
{
fgets(line, LINESIZE, cfile);
--- 44,58 ----
snprintf(service, LINESIZE, "[%s]", serviceName);
+ /* Everything later on relies on this list being initialized! */
+ list_init(items);
+
if ( !(cfile = fopen(cfilename, "r")) )
{
trace(CONFIG_ERROR_LEVEL, "ReadConfig(): could not open config file [%s]", cfilename);
return -1;
}
do
{
fgets(line, LINESIZE, cfile);
I tracked this down to an list that had never been through list_init().
Applying this trivial patch fixes the problem by init'ing the list even if
GetConfigValue() ends up bailing due to missing config file.
Please apply to CVS at your earliest convenience :-)
Aaron
*** dbmail/config.c 2003-03-17 08:04:08.000000000 -0800
--- dbmail-aaron/config.c 2003-05-14 02:04:50.000000000 -0700
***************
*** 44,57 ****
snprintf(service, LINESIZE, "[%s]", serviceName);
if ( !(cfile = fopen(cfilename, "r")) )
{
trace(CONFIG_ERROR_LEVEL, "ReadConfig(): could not open config file [%s]", cfilename);
return -1;
}
- list_init(items);
-
do
{
fgets(line, LINESIZE, cfile);
--- 44,58 ----
snprintf(service, LINESIZE, "[%s]", serviceName);
+ /* Everything later on relies on this list being initialized! */
+ list_init(items);
+
if ( !(cfile = fopen(cfilename, "r")) )
{
trace(CONFIG_ERROR_LEVEL, "ReadConfig(): could not open config file [%s]", cfilename);
return -1;
}
do
{
fgets(line, LINESIZE, cfile);