diff options
Diffstat (limited to 'src/util/sss_ldap.c')
-rw-r--r-- | src/util/sss_ldap.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c index f7834d940..dea38eaa9 100644 --- a/src/util/sss_ldap.c +++ b/src/util/sss_ldap.c @@ -587,3 +587,18 @@ done: talloc_free(filter); return ret; } + +char *sss_ldap_encode_ndr_uint32(TALLOC_CTX *mem_ctx, uint32_t flags) +{ + char hex[9]; /* 4 bytes in hex + terminating zero */ + errno_t ret; + + ret = snprintf(hex, 9, "%08x", flags); + if (ret != 8) { + return NULL; + } + + return talloc_asprintf(mem_ctx, "\\%c%c\\%c%c\\%c%c\\%c%c", + hex[6], hex[7], hex[4], hex[5], + hex[2], hex[3], hex[0], hex[1]); +} |