summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Varshavchik2020-05-18 21:33:07 -0400
committerSam Varshavchik2020-05-18 21:33:07 -0400
commit1254414ce5fa07c5c8e2e51c547ee8646fc31879 (patch)
tree8812e97c2a794013d7d95f4abc48bf2dfcfd3679
parent6656d3269c04def99f91555310a318d2b8a29629 (diff)
downloadcourier-libs-1254414ce5fa07c5c8e2e51c547ee8646fc31879.tar.bz2
courier-authlib update.
-rw-r--r--imap/authenticate_auth.c3
-rw-r--r--imap/imaplogin.c3
-rw-r--r--imap/pop3login.c16
-rw-r--r--sqwebmail/auth.c11
4 files changed, 23 insertions, 10 deletions
diff --git a/imap/authenticate_auth.c b/imap/authenticate_auth.c
index 04b03ac..60334e9 100644
--- a/imap/authenticate_auth.c
+++ b/imap/authenticate_auth.c
@@ -136,7 +136,8 @@ int rc;
if (!p || !*p)
p="imap";
- rc=auth_generic(p, authtype, authdata, login_callback, (void *)tag);
+ rc=auth_generic_meta(NULL, p, authtype, authdata,
+ login_callback, (void *)tag);
free(authtype);
free(authdata);
return (rc);
diff --git a/imap/imaplogin.c b/imap/imaplogin.c
index 4cc5670..8e8289e 100644
--- a/imap/imaplogin.c
+++ b/imap/imaplogin.c
@@ -374,7 +374,8 @@ int do_imap_command(const char *tag, int *flushflag)
if (!p || !*p)
p="imap";
- rc=auth_login(p, userid, passwd, login_callback, (void *)tag);
+ rc=auth_login_meta(NULL, p, userid, passwd,
+ login_callback, (void *)tag);
courier_safe_printf("INFO: LOGIN FAILED, user=%s, ip=[%s], port=[%s]",
userid, getenv("TCPREMOTEIP"),
getenv("TCPREMOTEPORT"));
diff --git a/imap/pop3login.c b/imap/pop3login.c
index 1b43df2..611e927 100644
--- a/imap/pop3login.c
+++ b/imap/pop3login.c
@@ -1,5 +1,5 @@
/*
-** Copyright 1998 - 2014 Double Precision, Inc.
+** Copyright 1998 - 2020 Double Precision, Inc.
** See COPYING for distribution information.
*/
@@ -403,11 +403,12 @@ char *q ;
if (!q || !*q)
q="pop3";
- rc=auth_generic(q,
- authtype,
- authdata,
- login_callback,
- NULL);
+ rc=auth_generic_meta
+ (NULL, q,
+ authtype,
+ authdata,
+ login_callback,
+ NULL);
free(authtype);
free(authdata);
}
@@ -452,7 +453,8 @@ char *q ;
if (!q || !*q)
q="pop3";
- rc=auth_login(q, user, p, login_callback, NULL);
+ rc=auth_login_meta(NULL, q, user, p,
+ login_callback, NULL);
courier_safe_printf
("INFO: LOGIN "
"FAILED, user=%s, ip=[%s], port=[%s]",
diff --git a/sqwebmail/auth.c b/sqwebmail/auth.c
index 7294d7f..ef41568 100644
--- a/sqwebmail/auth.c
+++ b/sqwebmail/auth.c
@@ -169,7 +169,16 @@ static int doauthlogin(struct authinfo *a, void *vp)
const char *do_login(const char *u, const char *p, const char *ip)
{
- if (auth_login("webmail", u, p, doauthlogin, (void *)u))
+ char ipbuf[strlen(ip)+sizeof("TCPREMOTEIP=")];
+ char *envvars[2]={ipbuf, 0};
+ struct auth_meta meta;
+
+ strcat(strcpy(ipbuf, "TCPREMOTEIP="), ip);
+
+ memset(&meta, 0, sizeof(meta));
+ meta.envvars=envvars;
+
+ if (auth_login_meta(&meta, "webmail", u, p, doauthlogin, (void *)u))
{
courier_safe_printf("INFO: LOGIN FAILED, user=%s, ip=[%s]",
u?u:"", ip);