diff options
author | Simo Sorce <ssorce@redhat.com> | 2010-03-18 17:24:00 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-09-15 12:05:46 -0400 |
commit | 6c188d847dfcd2778d134d5a0f80ecbce53e7b57 (patch) | |
tree | 45866919cdcc05f8a16e8a7559e4476922062c86 /src/providers/ldap/sdap.c | |
parent | 95126debf6fc78d63ab29dbae19993ef4992e123 (diff) | |
download | sssd-6c188d847dfcd2778d134d5a0f80ecbce53e7b57.tar.gz sssd-6c188d847dfcd2778d134d5a0f80ecbce53e7b57.tar.xz sssd-6c188d847dfcd2778d134d5a0f80ecbce53e7b57.zip |
Check if control is supported before using it.
Diffstat (limited to 'src/providers/ldap/sdap.c')
-rw-r--r-- | src/providers/ldap/sdap.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index cfcaff095..4d911c458 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -432,3 +432,21 @@ int build_attrs_from_map(TALLOC_CTX *memctx, return EOK; } +int sdap_control_create(struct sdap_handle *sh, const char *oid, int iscritical, + struct berval *value, int dupval, LDAPControl **ctrlp) +{ + int ret; + + if (sdap_is_control_supported(sh, oid)) { + ret = sss_ldap_control_create(oid, iscritical, value, dupval, ctrlp); + if (ret != LDAP_SUCCESS) { + DEBUG(1, ("sss_ldap_control_create failed [%d][%s].\n", + ret, ldap_err2string(ret))); + } + } else { + DEBUG(3, ("Server does not support the requested control [%s].\n", oid)); + ret = LDAP_NOT_SUPPORTED; + } + + return ret; +} |