Commit 42a7cc48 42a7cc48c7398707710bed6f6dd8bebe755690b2 by Sergey Poznyakoff

Update

1 parent 6d63a068
2007-11-17 Sergey Poznyakoff <gray@gnu.org.ua>
* auth/sql.h (mu_internal_sql_config): Move to ...
* include/mailutils/sql.h: ... here
* imap4d/auth_gsasl.c: Bugfix.
Move rc file and argp parsing into separate abstract layers.
* include/mailutils/gocs.h, include/mailutils/pam.h,
......
......@@ -40,20 +40,4 @@
#include <mailutils/nls.h>
#include <mailutils/mailbox.h>
struct mu_internal_sql_config
{
int interface;
char *getpwnam_query;
char *getpass_query;
char *getpwuid_query;
char *host;
char *user;
char *passwd;
char *db;
int port;
enum mu_password_type password_type;
mu_assoc_t field_map;
};
extern struct mu_internal_sql_config mu_sql_module_config;
......
......@@ -269,9 +269,10 @@ cb_retrieve (Gsasl_session_ctx *ctx,
if (username && *username == 0 && authentication_id)
*username = strdup (authentication_id);
if (mu_gsasl_cram_md5_pwd && access (mu_gsasl_cram_md5_pwd, R_OK) == 0)
if (mu_gsasl_module_data.cram_md5_pwd
&& access (mu_gsasl_module_data.cram_md5_pwd, R_OK) == 0)
{
int rc = gsasl_md5pwd_get_password (mu_gsasl_cram_md5_pwd,
int rc = gsasl_md5pwd_get_password (mu_gsasl_module_data.cram_md5_pwd,
authentication_id,
key, keylen);
if (rc == GSASL_OK)
......@@ -279,7 +280,7 @@ cb_retrieve (Gsasl_session_ctx *ctx,
}
#ifdef USE_SQL
if (mu_sql_password_type == password_plaintext)
if (mu_sql_module_config.password_type == password_plaintext)
{
char *passwd;
int status = mu_sql_getpass (username, &passwd);
......
......@@ -42,6 +42,25 @@ struct mu_sql_module_config
mu_assoc_t field_map;
};
/* FIXME: Should not be here, but needed for several other sources
(imap4d/auth_gsasl.c, for instance) */
struct mu_internal_sql_config
{
int interface;
char *getpwnam_query;
char *getpass_query;
char *getpwuid_query;
char *host;
char *user;
char *passwd;
char *db;
int port;
enum mu_password_type password_type;
mu_assoc_t field_map;
};
extern struct mu_internal_sql_config mu_sql_module_config;
/* Loadable Modules Support */
#define __s_cat2__(a,b) a ## b
#define __s_cat3__(a,b,c) a ## b ## c
......