Commit 23160352 23160352349d746d85724d3884443b845318f2bb by Sergey Poznyakoff

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'.
1 parent 01323bdd
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
......
......@@ -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);
......
......@@ -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;
};
......
......@@ -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 "
......