diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-05-27 11:44:16 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-06-02 15:23:33 -0400 |
commit | 807402e4e9ac43d0fe7a7533698102a74e23844b (patch) | |
tree | 4b434d4f4613412b4a5280697fe5f687974b04f4 /src/util/sss_ldap.c | |
parent | 9e082d13d8b1b66092747db8454de3a0d50ce51f (diff) | |
download | sssd_unused-807402e4e9ac43d0fe7a7533698102a74e23844b.tar.gz sssd_unused-807402e4e9ac43d0fe7a7533698102a74e23844b.tar.xz sssd_unused-807402e4e9ac43d0fe7a7533698102a74e23844b.zip |
Properly support IPv6 in LDAP URIs for IPA and LDAP providers
Add utility function to return IP address as string
Add a utility function to escape IPv6 address for use in URIs
Use escaped IP addresses in LDAP provider
Escape IPv6 IP addresses in the IPA provider
https://fedorahosted.org/sssd/ticket/880
Fix bad merge
We merged in a patch, but missed that it missed a dependency added
by another earlier patch.
Diffstat (limited to 'src/util/sss_ldap.c')
-rw-r--r-- | src/util/sss_ldap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c index f098e7d6..94a10386 100644 --- a/src/util/sss_ldap.c +++ b/src/util/sss_ldap.c @@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> +#include <netdb.h> #include "config.h" @@ -68,3 +69,10 @@ int sss_ldap_control_create(const char *oid, int iscritical, return LDAP_SUCCESS; #endif } + +inline const char * +sss_ldap_escape_ip_address(TALLOC_CTX *mem_ctx, int family, const char *addr) +{ + return family == AF_INET6 ? talloc_asprintf(mem_ctx, "[%s]", addr) : + talloc_strdup(mem_ctx, addr); +} |