From aaa629866a5664b2cef2dbc15d976a0f1c0d9b1c Mon Sep 17 00:00:00 2001 From: Denis Denisov Date: Sat, 20 Jun 2015 01:09:56 +0300 Subject: [PATCH 1/4] darwin requires lber --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index 7931d74..2420bb6 100644 --- a/config +++ b/config @@ -5,7 +5,7 @@ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_auth_ldap_module.c" CORE_LIBS="$CORE_LIBS -lldap" case "$NGX_PLATFORM" in - FreeBSD:*|Linux:*|SunOS:*) + Darwin:*|FreeBSD:*|Linux:*|SunOS:*) CORE_LIBS="$CORE_LIBS -llber" ;; esac From 3f7ab7f81ffb5d5127ee7d9d9b6b43ae9809ae9b Mon Sep 17 00:00:00 2001 From: Petrovich Date: Tue, 4 Aug 2015 16:06:21 +0300 Subject: [PATCH 2/4] change confuging emergency error message to notice --- ngx_http_auth_ldap_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ngx_http_auth_ldap_module.c b/ngx_http_auth_ldap_module.c index 4ca1d1e..e7772f4 100644 --- a/ngx_http_auth_ldap_module.c +++ b/ngx_http_auth_ldap_module.c @@ -588,7 +588,7 @@ ngx_http_auth_ldap_parse_require(ngx_conf_t *cf, ngx_http_auth_ldap_server_t *se ngx_http_compile_complex_value_t ccv; value = cf->args->elts; - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "http_auth_ldap: parse_require"); + ngx_conf_log_error(NGX_LOG_NOTICE, cf, 0, "http_auth_ldap: parse_require"); if (ngx_strcmp(value[1].data, "valid_user") == 0) { server->require_valid_user = 1; @@ -608,7 +608,7 @@ ngx_http_auth_ldap_parse_require(ngx_conf_t *cf, ngx_http_auth_ldap_server_t *se } target = ngx_array_push(server->require_user); } else if (ngx_strcmp(value[1].data, "group") == 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "http_auth_ldap: Setting group"); + ngx_conf_log_error(NGX_LOG_NOTICE, cf, 0, "http_auth_ldap: Setting group"); if (server->require_group == NULL) { server->require_group = ngx_array_create(cf->pool, 4, sizeof(ngx_http_complex_value_t)); if (server->require_group == NULL) { @@ -643,7 +643,7 @@ ngx_http_auth_ldap_parse_satisfy(ngx_conf_t *cf, ngx_http_auth_ldap_server_t *se value = cf->args->elts; if (ngx_strcmp(value[1].data, "all") == 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "http_auth_ldap: Setting satisfy all"); + ngx_conf_log_error(NGX_LOG_NOTICE, cf, 0, "http_auth_ldap: Setting satisfy all"); server->satisfy_all = 1; return NGX_CONF_OK; } From 878da132fb95a15d3d4e67800df350cf6384c9cc Mon Sep 17 00:00:00 2001 From: rascal-hats Date: Wed, 16 Dec 2015 13:22:45 -0600 Subject: [PATCH 3/4] Update ngx_http_auth_ldap_module.c Initialize count on line 806. Prevents compilation errors. ``` nginx-auth-ldap/ngx_http_auth_ldap_module.c:815:26: error: variable 'count' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] cache->num_buckets = count; ^~~~~ nginx-auth-ldap/ngx_http_auth_ldap_module.c:793:27: note: initialize the variable 'count' to silence this warning ngx_uint_t want, count, i; ^ = 0 ``` --- ngx_http_auth_ldap_module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ngx_http_auth_ldap_module.c b/ngx_http_auth_ldap_module.c index 4ca1d1e..39530de 100644 --- a/ngx_http_auth_ldap_module.c +++ b/ngx_http_auth_ldap_module.c @@ -803,6 +803,7 @@ ngx_http_auth_ldap_init_cache(ngx_cycle_t *cycle) } want = (conf->cache_size + 7) / 8; + count = 0; for (i = 0; i < sizeof(primes)/sizeof(primes[0]); i++) { count = primes[i]; if (count >= want) { From c8d86783686a79db7d02e8dfe460c3ed71feb430 Mon Sep 17 00:00:00 2001 From: Marcin Deranek Date: Thu, 28 Apr 2016 14:32:05 +0200 Subject: [PATCH 4/4] Support for building as dynamic module --- config | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/config b/config index 2420bb6..80de726 100644 --- a/config +++ b/config @@ -1,6 +1,15 @@ ngx_addon_name=ngx_http_auth_ldap_module -HTTP_MODULES="$HTTP_MODULES ngx_http_auth_ldap_module" -NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_auth_ldap_module.c" + +if test -n "$ngx_module_link"; then + ngx_module_type=HTTP + ngx_module_name=ngx_http_auth_ldap_module + ngx_module_srcs="$ngx_addon_dir/ngx_http_auth_ldap_module.c" + + . auto/module +else + HTTP_MODULES="$HTTP_MODULES ngx_http_auth_ldap_module" + NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_auth_ldap_module.c" +fi CORE_LIBS="$CORE_LIBS -lldap"