diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-07-01 16:57:28 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-07-11 16:52:52 -0400 |
commit | 2e1973b90ea87b343d39fef1f6393cc201989ecd (patch) | |
tree | 0a3849264e36ac94b3c336ab5f69dc7032dc8479 /src/util/util.c | |
parent | d9e5e97c90b31b84c3abf6e7ce92176afa950f61 (diff) | |
download | sssd-2e1973b90ea87b343d39fef1f6393cc201989ecd.tar.gz sssd-2e1973b90ea87b343d39fef1f6393cc201989ecd.tar.xz sssd-2e1973b90ea87b343d39fef1f6393cc201989ecd.zip |
Move IP adress escaping from the LDAP namespace
Diffstat (limited to 'src/util/util.c')
-rw-r--r-- | src/util/util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/util.c b/src/util/util.c index 6c4a6033d..649d58ea6 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -19,6 +19,7 @@ */ #include <ctype.h> +#include <netdb.h> #include "talloc.h" #include "util/util.h" @@ -589,3 +590,10 @@ errno_t sss_filter_sanitize(TALLOC_CTX *mem_ctx, return EOK; } + +char * +sss_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); +} |