diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2014-03-11 20:48:48 +0100 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2014-03-11 20:48:48 +0100 |
commit | 15fb7904f4431a6e7c305fd08732458f7f885e7e (patch) | |
tree | c93b60ee813af70509f00f34e29ebec311762427 /src/libcharon/plugins/xauth_pam/xauth_pam.c | |
parent | 5313d2d78ca150515f7f5eb39801c100690b6b29 (diff) | |
download | vyos-strongswan-15fb7904f4431a6e7c305fd08732458f7f885e7e.tar.gz vyos-strongswan-15fb7904f4431a6e7c305fd08732458f7f885e7e.zip |
Imported Upstream version 5.1.2
Diffstat (limited to 'src/libcharon/plugins/xauth_pam/xauth_pam.c')
-rw-r--r-- | src/libcharon/plugins/xauth_pam/xauth_pam.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libcharon/plugins/xauth_pam/xauth_pam.c b/src/libcharon/plugins/xauth_pam/xauth_pam.c index 8ba2c764d..71c79ecc0 100644 --- a/src/libcharon/plugins/xauth_pam/xauth_pam.c +++ b/src/libcharon/plugins/xauth_pam/xauth_pam.c @@ -116,7 +116,11 @@ static void attr2string(char *buf, size_t len, chunk_t chunk) { if (chunk.len && chunk.len < len) { - snprintf(buf, len, "%.*s", (int)chunk.len, chunk.ptr); + chunk_t sane; + + chunk_printable(chunk, &sane, '?'); + snprintf(buf, len, "%.*s", (int)sane.len, sane.ptr); + chunk_clear(&sane); } } @@ -138,7 +142,7 @@ METHOD(xauth_method_t, process, status_t, /* trim to username part if email address given */ if (lib->settings->get_bool(lib->settings, "%s.plugins.xauth-pam.trim_email", - TRUE, charon->name)) + TRUE, lib->ns)) { pos = memchr(chunk.ptr, '@', chunk.len); if (pos) @@ -171,9 +175,8 @@ METHOD(xauth_method_t, process, status_t, service = lib->settings->get_str(lib->settings, "%s.plugins.xauth-pam.pam_service", lib->settings->get_str(lib->settings, - "%s.plugins.eap-gtc.pam_service", - "login", charon->name), - charon->name); + "%s.plugins.eap-gtc.pam_service", "login", lib->ns), + lib->ns); if (authenticate(service, user, pass)) { |