diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-10-19 10:54:53 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-10-19 10:54:53 +0000 |
commit | 23160352349d746d85724d3884443b845318f2bb (patch) | |
tree | 5502b07216909197143b3af4f9029f08eb555cf7 | |
parent | 01323bdd87d45a0212e0f9900f058ec6dc338559 (diff) | |
download | mailutils-23160352349d746d85724d3884443b845318f2bb.tar.gz mailutils-23160352349d746d85724d3884443b845318f2bb.tar.bz2 |
Default to symbolic tuple parsing in sql.
* auth/sql.c (decode_tuple): Use new tuple parsing mode, unless
`positional' is set to true.
* include/mailutils/sql.h (struct mu_sql_module_config)
(struct mu_internal_sql_config): New member `positional'.
* libcfg/sql.c (mu_sql_param): New statement `positional'.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | auth/sql.c | 2 | ||||
-rw-r--r-- | include/mailutils/sql.h | 2 | ||||
-rw-r--r-- | libcfg/sql.c | 2 |
4 files changed, 11 insertions, 1 deletions
@@ -1,5 +1,11 @@ 2008-10-19 Sergey Poznyakoff <gray@gnu.org.ua> + * auth/sql.c (decode_tuple): Use new tuple parsing mode, unless + `positional' is set to true. + * include/mailutils/sql.h (struct mu_sql_module_config) + (struct mu_internal_sql_config): New member `positional'. + * libcfg/sql.c (mu_sql_param): New statement `positional'. + * auth/virtual.c (getpwnam_virtual): Close file. * doc/texinfo/programs.texi: Document virtmode. * testsuite/Makefile.am (EXTRA_DIST): Remove diff --git a/auth/sql.c b/auth/sql.c index 5eab72952..105569019 100644 --- a/auth/sql.c +++ b/auth/sql.c @@ -301,7 +301,7 @@ static int decode_tuple (mu_sql_connection_t conn, int n, struct mu_auth_data **return_data) { - if (mu_sql_module_config.field_map) + if (mu_sql_module_config.field_map || !mu_sql_module_config.positional) return decode_tuple_new (conn, n, return_data); else return decode_tuple_v1_0 (conn, n, return_data); diff --git a/include/mailutils/sql.h b/include/mailutils/sql.h index ee200910c..f4ada26fd 100644 --- a/include/mailutils/sql.h +++ b/include/mailutils/sql.h @@ -39,6 +39,7 @@ struct mu_sql_module_config char *db; int port; enum mu_password_type password_type; + int positional; mu_assoc_t field_map; }; @@ -56,6 +57,7 @@ struct mu_internal_sql_config char *db; int port; enum mu_password_type password_type; + int positional; mu_assoc_t field_map; }; diff --git a/libcfg/sql.c b/libcfg/sql.c index 14a17ebc0..714cf3f62 100644 --- a/libcfg/sql.c +++ b/libcfg/sql.c @@ -84,6 +84,8 @@ static struct mu_cfg_param mu_sql_param[] = { { "password-type", mu_cfg_callback, NULL, 0, cb_password_type, N_("Type of password returned by getpass query (one of: plain, hash, " "scrambled).") }, + { "positional", mu_cfg_bool, &sql_settings.positional, 0, NULL, + N_("Use positional (v1.0 compatible) field interface.") }, { "field-map", mu_cfg_callback, NULL, 0, cb_field_map, N_("Set a field-map for parsing SQL replies. The map is a " "column-separated list of definitions. Each definition has the " |