Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Fix ldap page_size default value
Browse files Browse the repository at this point in the history
  • Loading branch information
babelouest committed Apr 27, 2018
1 parent 00870a2 commit 96e3d85
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 41 deletions.
2 changes: 1 addition & 1 deletion docs/glewlwyd.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ authentication =
bind_dn = "cn=operator,dc=example,dc=org"
bind_passwd = "password"
search_scope = "subtree" # optional, scope of the LDAP search, values available are "onelevel", "subtree" or "children", default is "onelevel", see the manpage ldap_search(3) for more information
page_size = 100 # optional, size of the page for LDAP search, must be lower or equal to the LDAP server sizelimit parameter, default is 100
page_size = 100 # optional, size of the page for LDAP search, must be lower or equal to the LDAP server sizelimit parameter, default is 50
base_search_user = "ou=user,dc=example,dc=org"
base_search_client = "ou=client,dc=example,dc=org"

Expand Down
81 changes: 41 additions & 40 deletions src/glewlwyd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1099,49 +1099,48 @@ int build_config_from_file(struct config_elements * config) {
config_setting_lookup_string(auth, "password_algorithm_client_write", &cur_auth_ldap_password_algorithm_client_write);
config_setting_lookup_string(auth, "object_class_client_write", &cur_auth_ldap_object_class_client_write);

if (cur_auth_ldap_uri != NULL &&
cur_auth_ldap_bind_dn != NULL &&
cur_auth_ldap_bind_passwd != NULL &&
cur_auth_ldap_page_size > 0 &&
if (cur_auth_ldap_uri != NULL &&
cur_auth_ldap_bind_dn != NULL &&
cur_auth_ldap_bind_passwd != NULL &&

cur_auth_ldap_base_search_user != NULL &&
cur_auth_ldap_filter_user_read != NULL &&
cur_auth_ldap_login_property_user_read != NULL &&
cur_auth_ldap_name_property_user_read != NULL &&
cur_auth_ldap_email_property_user_read != NULL &&
cur_auth_ldap_additional_property_value_read != NULL &&
(cur_auth_ldap_scope_property_user_read != NULL || !config->use_scope) &&
cur_auth_ldap_base_search_user != NULL &&
cur_auth_ldap_filter_user_read != NULL &&
cur_auth_ldap_login_property_user_read != NULL &&
cur_auth_ldap_name_property_user_read != NULL &&
cur_auth_ldap_email_property_user_read != NULL &&
cur_auth_ldap_additional_property_value_read != NULL &&
(cur_auth_ldap_scope_property_user_read != NULL || !config->use_scope) &&

(!cur_auth_ldap_user_write ||
(cur_auth_ldap_rdn_property_user_write != NULL &&
cur_auth_ldap_login_property_user_write != NULL &&
cur_auth_ldap_name_property_user_write != NULL &&
cur_auth_ldap_email_property_user_write != NULL &&
cur_auth_ldap_additional_property_value_write != NULL &&
(cur_auth_ldap_scope_property_user_write != NULL || !config->use_scope) &&
cur_auth_ldap_password_property_user_write != NULL &&
cur_auth_ldap_password_algorithm_user_write != NULL &&
cur_auth_ldap_object_class_user_write != NULL)) &&
(!cur_auth_ldap_user_write ||
(cur_auth_ldap_rdn_property_user_write != NULL &&
cur_auth_ldap_login_property_user_write != NULL &&
cur_auth_ldap_name_property_user_write != NULL &&
cur_auth_ldap_email_property_user_write != NULL &&
cur_auth_ldap_additional_property_value_write != NULL &&
(cur_auth_ldap_scope_property_user_write != NULL || !config->use_scope) &&
cur_auth_ldap_password_property_user_write != NULL &&
cur_auth_ldap_password_algorithm_user_write != NULL &&
cur_auth_ldap_object_class_user_write != NULL)) &&

cur_auth_ldap_base_search_client != NULL &&
cur_auth_ldap_filter_client_read != NULL &&
cur_auth_ldap_client_id_property_client_read != NULL &&
cur_auth_ldap_name_property_client_read != NULL &&
cur_auth_ldap_description_property_client_read != NULL &&
cur_auth_ldap_redirect_uri_property_client_read != NULL &&
cur_auth_ldap_confidential_property_client_read != NULL &&
(cur_auth_ldap_scope_property_client_read != NULL || !config->use_scope) &&
cur_auth_ldap_base_search_client != NULL &&
cur_auth_ldap_filter_client_read != NULL &&
cur_auth_ldap_client_id_property_client_read != NULL &&
cur_auth_ldap_name_property_client_read != NULL &&
cur_auth_ldap_description_property_client_read != NULL &&
cur_auth_ldap_redirect_uri_property_client_read != NULL &&
cur_auth_ldap_confidential_property_client_read != NULL &&
(cur_auth_ldap_scope_property_client_read != NULL || !config->use_scope) &&

(!cur_auth_ldap_client_write ||
(cur_auth_ldap_rdn_property_client_write != NULL &&
cur_auth_ldap_client_id_property_client_write != NULL &&
cur_auth_ldap_name_property_client_write != NULL &&
cur_auth_ldap_description_property_client_write != NULL &&
cur_auth_ldap_redirect_uri_property_client_write != NULL &&
cur_auth_ldap_confidential_property_client_write != NULL &&
(cur_auth_ldap_scope_property_client_write != NULL || !config->use_scope) &&
cur_auth_ldap_password_property_client_write != NULL &&
cur_auth_ldap_password_algorithm_client_write != NULL &&
(!cur_auth_ldap_client_write ||
(cur_auth_ldap_rdn_property_client_write != NULL &&
cur_auth_ldap_client_id_property_client_write != NULL &&
cur_auth_ldap_name_property_client_write != NULL &&
cur_auth_ldap_description_property_client_write != NULL &&
cur_auth_ldap_redirect_uri_property_client_write != NULL &&
cur_auth_ldap_confidential_property_client_write != NULL &&
(cur_auth_ldap_scope_property_client_write != NULL || !config->use_scope) &&
cur_auth_ldap_password_property_client_write != NULL &&
cur_auth_ldap_password_algorithm_client_write != NULL &&
cur_auth_ldap_object_class_client_write != NULL))) {
config->auth_ldap = o_malloc(sizeof(struct _auth_ldap));
if (config->auth_ldap == NULL) {
Expand Down Expand Up @@ -1185,7 +1184,9 @@ int build_config_from_file(struct config_elements * config) {
}
}

config->auth_ldap->page_size = cur_auth_ldap_page_size;
if (cur_auth_ldap_page_size > 0) {
config->auth_ldap->page_size = cur_auth_ldap_page_size;
}

config->auth_ldap->base_search_user = o_strdup(cur_auth_ldap_base_search_user);
if (config->auth_ldap->base_search_user == NULL) {
Expand Down

0 comments on commit 96e3d85

Please sign in to comment.