diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-11-08 17:46:29 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-11-08 17:53:28 +0200 |
commit | 172ada3fcdeb3a2c02f905792a398567820e53c4 (patch) | |
tree | eec44c88d5f11510e48ac4814b2b459d2d3846d9 /src | |
parent | e62cdd725b6088b9989ded9ee036eeb8a53ebed6 (diff) | |
download | mailfromd-172ada3fcdeb3a2c02f905792a398567820e53c4.tar.gz mailfromd-172ada3fcdeb3a2c02f905792a398567820e53c4.tar.bz2 |
Fix mfdbtool.
* lib/db.c (mf_database_mode): New global variable.
(mf_dbm_open): Remove "mode" parameter. Use mf_database_mode.
(db_expire_func): Fix passing the datum size.
(db_compact): Preserve mode and ownership of the database.
* lib/dbcfg.c (cb_database_mode): New function.
* lib/mfdb.h (mf_database_mode): New extern.
(mf_dbm_open): Change signature.
(cb_database_mode): New proto.
* src/mfdbtool.c (mfdbtool_cfg_param): New statement "database-mode".
Read configuration from /etc/mailfromd.conf
* src/srvcfg.c (srv_cfg_param): Likewise.
* lib/cache.c: Update calls to mf_dbm_open.
* lib/rate.c: Likewise.
* lib/tbf_rate.c: Likewise.
Diffstat (limited to 'src')
-rw-r--r-- | src/mfdbtool.c | 11 | ||||
-rw-r--r-- | src/srvcfg.c | 5 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/mfdbtool.c b/src/mfdbtool.c index 1571526e..db6bc18c 100644 --- a/src/mfdbtool.c +++ b/src/mfdbtool.c @@ -30,2 +30,3 @@ #include "mfdb.h" +#include "filenames.h" @@ -142,3 +143,2 @@ mfdbtool_expire(int argc, char **argv) { - /*FIXME: priv_setup(); */ if (all_option) @@ -157,3 +157,2 @@ mfdbtool_compact(int argc, char **argv) { - /* FIXME: priv_setup(); */ if (all_option) @@ -308,2 +307,6 @@ struct mu_cfg_param mfdbtool_cfg_param[] = { { "database", mu_cfg_section, NULL, 0, NULL, NULL }, + { "database-mode", mu_cfg_callback, + &mf_database_mode, 0, cb_database_mode, + N_("Configure file mode for database files"), + N_("mode: octal") }, { "state-directory", mu_c_string, &state_dir, 0, NULL, @@ -361,5 +364,3 @@ main(int argc, char **argv) database_cfg_init(); - mf_getopt(&cli, &argc, &argv, capa, 0, - /* FIXME: Use mailfromd.conf somehow? */ - SYSCONFDIR "/mfdbtool.conf"); + mf_getopt(&cli, &argc, &argv, capa, 0, DEFAULT_CONFIG_FILE); diff --git a/src/srvcfg.c b/src/srvcfg.c index 1f39921a..57388122 100644 --- a/src/srvcfg.c +++ b/src/srvcfg.c @@ -32,2 +32,3 @@ #include "srvcfg.h" +#include "mfdb.h" @@ -525,2 +526,6 @@ static struct mu_cfg_param srv_cfg_param[] = { { "database", mu_cfg_section, NULL, 0, NULL, NULL }, + { "database-mode", mu_cfg_callback, + &mf_database_mode, 0, cb_database_mode, + N_("Configure file mode for database files"), + N_("mode: octal") }, { "ehlo-domain", mu_c_string, &ehlo_domain, 0, NULL, |