@@ -757,6 +757,10 @@ EAP plugin to be used as backend for XAuth credential verification
|
|||||||
.TP
|
.TP
|
||||||
.BR charon.plugins.xauth-pam.pam_service " [login]"
|
.BR charon.plugins.xauth-pam.pam_service " [login]"
|
||||||
PAM service to be used for authentication
|
PAM service to be used for authentication
|
||||||
|
.TP
|
||||||
|
.BR charon.plugins.xauth-pam.trim_email " [yes]"
|
||||||
|
If an email address is given as an XAuth username, trim it to just the
|
||||||
|
username part.
|
||||||
.SS libstrongswan section
|
.SS libstrongswan section
|
||||||
.TP
|
.TP
|
||||||
.BR libstrongswan.cert_cache " [yes]"
|
.BR libstrongswan.cert_cache " [yes]"
|
||||||
|
|||||||
@@ -134,12 +134,17 @@ METHOD(xauth_method_t, process, status_t,
|
|||||||
switch (attr->get_type(attr))
|
switch (attr->get_type(attr))
|
||||||
{
|
{
|
||||||
case XAUTH_USER_NAME:
|
case XAUTH_USER_NAME:
|
||||||
/* trim to username part if email address given */
|
|
||||||
chunk = attr->get_chunk(attr);
|
chunk = attr->get_chunk(attr);
|
||||||
pos = memchr(chunk.ptr, '@', chunk.len);
|
/* trim to username part if email address given */
|
||||||
if (pos)
|
if (lib->settings->get_bool(lib->settings,
|
||||||
|
"%s.plugins.xauth-pam.trim_email",
|
||||||
|
TRUE, charon->name))
|
||||||
{
|
{
|
||||||
chunk.len = (u_char*)pos - chunk.ptr;
|
pos = memchr(chunk.ptr, '@', chunk.len);
|
||||||
|
if (pos)
|
||||||
|
{
|
||||||
|
chunk.len = (u_char*)pos - chunk.ptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
attr2string(user, sizeof(user), chunk);
|
attr2string(user, sizeof(user), chunk);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user