diff options
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 a4d73a8aa..49d989b62 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" @@ -86,3 +87,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); +} |