summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-06-10 13:03:21 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-06-14 16:54:42 -0400
commitbdf389ab445986e0ab1d66e51d946bda2dc91c43 (patch)
tree28c5ec58d9f121ad7bcec2f606e34f375593f0e3
parenta28ca31bb77ce38bb8821681b00113fd6525fa17 (diff)
downloadsssd-bdf389ab445986e0ab1d66e51d946bda2dc91c43.tar.gz
sssd-bdf389ab445986e0ab1d66e51d946bda2dc91c43.tar.xz
sssd-bdf389ab445986e0ab1d66e51d946bda2dc91c43.zip
Don't segfault if ldap_access_filter is unspecified
https://fedorahosted.org/sssd/ticket/539
-rw-r--r--src/providers/ldap/ldap_init.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index ec35a6277..b4fcc73cb 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -242,19 +242,20 @@ int sssm_ldap_access_init(struct be_ctx *bectx,
"but no ldap_access_filter configured. "
"All domain users will be denied access.\n"));
}
-
- if (filter[0] == '(') {
- /* This filter is wrapped in parentheses.
- * Pass it as-is to the openldap libraries.
- */
- access_ctx->filter = filter;
- }
else {
- /* Add parentheses around the filter */
- access_ctx->filter = talloc_asprintf(access_ctx, "(%s)", filter);
- if (access_ctx->filter == NULL) {
- ret = ENOMEM;
- goto done;
+ if (filter[0] == '(') {
+ /* This filter is wrapped in parentheses.
+ * Pass it as-is to the openldap libraries.
+ */
+ access_ctx->filter = filter;
+ }
+ else {
+ /* Add parentheses around the filter */
+ access_ctx->filter = talloc_asprintf(access_ctx, "(%s)", filter);
+ if (access_ctx->filter == NULL) {
+ ret = ENOMEM;
+ goto done;
+ }
}
}