aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2019-04-17 23:47:51 +0100
committerSteve Holme <steve_holme@hotmail.com>2019-05-22 22:55:05 +0100
commita14d72ca2fec5d4eb5a043936e4f7ce08015c177 (patch)
treead856028203028c20e1ba9c30bb3b74d64a7f41c /lib/url.c
parent081d374f4949b7fabfa76a0fb14daa02d47b5050 (diff)
sasl: Implement SASL authorisation identity via CURLOPT_SASL_AUTHZID
Added the ability for the calling program to specify the authorisation identity (authzid), the identity to act as, in addition to the authentication identity (authcid) and password when using SASL PLAIN authentication. Fixed #3653 Closes #3790
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index 16d910b71..5b4b00eac 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -713,6 +713,7 @@ static void conn_free(struct connectdata *conn)
Curl_safefree(conn->user);
Curl_safefree(conn->passwd);
Curl_safefree(conn->oauth_bearer);
+ Curl_safefree(conn->sasl_authzid);
Curl_safefree(conn->options);
Curl_safefree(conn->http_proxy.user);
Curl_safefree(conn->socks_proxy.user);
@@ -3461,6 +3462,14 @@ static CURLcode create_conn(struct Curl_easy *data,
}
}
+ if(data->set.str[STRING_SASL_AUTHZID]) {
+ conn->sasl_authzid = strdup(data->set.str[STRING_SASL_AUTHZID]);
+ if(!conn->sasl_authzid) {
+ result = CURLE_OUT_OF_MEMORY;
+ goto out;
+ }
+ }
+
#ifdef USE_UNIX_SOCKETS
if(data->set.str[STRING_UNIX_SOCKET_PATH]) {
conn->unix_domain_socket = strdup(data->set.str[STRING_UNIX_SOCKET_PATH]);