summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2014-02-19 23:24:29 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-02-21 10:27:34 +0100
commit9a8f44c09e0e78550b126235240214e7b11af081 (patch)
treefa88c15377512399958fda1b57537f28f1237eaf
parent9f62d0c15795ca9fca0c64a8b4bd1b09540b47f1 (diff)
downloadfreeipa.git-9a8f44c09e0e78550b126235240214e7b11af081.zip
freeipa.git-9a8f44c09e0e78550b126235240214e7b11af081.tar.gz
freeipa.git-9a8f44c09e0e78550b126235240214e7b11af081.tar.xz
libotp: do not call internal search for NULL dn
Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
-rw-r--r--daemons/ipa-slapi-plugins/libotp/libotp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/daemons/ipa-slapi-plugins/libotp/libotp.c b/daemons/ipa-slapi-plugins/libotp/libotp.c
index 31cc591..e6c8eaa 100644
--- a/daemons/ipa-slapi-plugins/libotp/libotp.c
+++ b/daemons/ipa-slapi-plugins/libotp/libotp.c
@@ -332,6 +332,7 @@ static struct otptoken **find(Slapi_ComponentId *id, const char *user_dn,
Slapi_PBlock *pb = NULL;
Slapi_DN *sdn = NULL;
char *filter = NULL;
+ const char *basedn = NULL;
size_t count = 0;
int result = -1;
@@ -362,8 +363,12 @@ static struct otptoken **find(Slapi_ComponentId *id, const char *user_dn,
if (sdn == NULL)
goto error;
+ basedn = get_basedn(sdn);
+ if (basedn == NULL)
+ goto error;
+
/* Find all user tokens. */
- slapi_search_internal_set_pb(pb, get_basedn(sdn),
+ slapi_search_internal_set_pb(pb, basedn,
LDAP_SCOPE_SUBTREE, filter, NULL,
0, NULL, NULL, id, 0);
}