upstream nginx-0.7.38 0.7.38
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 21 Mar 2009 17:02:55 +0000 (18:02 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 21 Mar 2009 17:02:55 +0000 (18:02 +0100)
nginx/CHANGES
nginx/CHANGES.ru
nginx/src/core/nginx.h
nginx/src/core/ngx_inet.h
nginx/src/http/modules/ngx_http_auth_basic_module.c
nginx/src/http/modules/perl/nginx.pm
nginx/src/os/unix/ngx_process_cycle.c

index 0532d44..a8cb108 100644 (file)
@@ -1,8 +1,20 @@
 
+Changes with nginx 0.7.38                                        23 Feb 2009
+
+    *) Feature: authentication failures logging.
+
+    *) Bugfix: name/password in auth_basic_user_file were ignored after odd 
+       number of empty lines.
+       Thanks to Alexander Zagrebin.
+
+    *) Bugfix: a segmentation fault occurred in a master process, if long 
+       path was used in unix domain socket; the bug had appeared in 0.7.36.
+
+
 Changes with nginx 0.7.37                                        21 Feb 2009
 
-    *) Bugfix: directive using upstreams did not work; the bug had appeare
-       in 0.7.36.
+    *) Bugfix: directives using upstreams did not work; the bug ha
+       appeared in 0.7.36.
 
 
 Changes with nginx 0.7.36                                        21 Feb 2009
index 9d6a824..3c1b029 100644 (file)
@@ -1,4 +1,17 @@
 
+éÚÍÅÎÅÎÉÑ × nginx 0.7.38                                          23.02.2009
+
+    *) äÏÂÁ×ÌÅÎÉÅ: ÌÏÇÇÉÒÏ×ÁÎÉÅ ÏÛÉÂÏË ÁÕÔÅÎÔÉÆÉËÁÃÉÉ.
+
+    *) éÓÐÒÁ×ÌÅÎÉÅ: ÉÍÑ/ÐÁÒÏÌØ, ÚÁÄÁÎÎÙÅ × auth_basic_user_file, 
+       ÉÇÎÏÒÉÒÏ×ÁÌÉÓØ ÐÏÓÌÅ ÎÅÞ£ÔÎÏÇÏ ÞÉÓÌÁ ÐÕÓÔÙÈ ÓÔÒÏË.
+       óÐÁÓÉÂÏ áÌÅËÓÁÎÄÒÕ úÁÇÒÅÂÉÎÕ.
+
+    *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÄÌÉÎÎÏÇÏ ÐÕÔÉ × unix domain ÓÏËÅÔÅ × 
+       ÇÌÁ×ÎÏÍ ÐÒÏÃÅÓÓÅ ÐÒÏÉÓÈÏÄÉÌ segmentation fault; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 
+       0.7.36.
+
+
 éÚÍÅÎÅÎÉÑ × nginx 0.7.37                                          21.02.2009
 
     *) éÓÐÒÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Ù, ÉÓÐÏÌØÚÕÀÝÉÅ upstream'Ù, ÎÅ ÒÁÂÏÔÁÌÉ; ÏÛÉÂËÁ 
index 69ae5c4..50ee0a2 100644 (file)
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VERSION      "0.7.37"
+#define NGINX_VERSION      "0.7.38"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
index d60c9c7..20d9844 100644 (file)
 /*
  * TODO: autoconfigure NGX_SOCKADDRLEN as
  *       sizeof(struct sockaddr_storage)
+ *       sizeof(struct sockaddr_un)
  *       sizeof(struct sockaddr_in6)
  *       sizeof(struct sockaddr_in)
  */
 
-#if (NGX_HAVE_INET6)
-#define NGX_SOCKADDRLEN       sizeof(struct sockaddr_in6)
+#if (NGX_HAVE_UNIX_DOMAIN)
+#define NGX_SOCKADDRLEN       sizeof(struct sockaddr_un)
 #else
-#define NGX_SOCKADDRLEN       sizeof(struct sockaddr_in)
+#define NGX_SOCKADDRLEN       512
 #endif
 
 
index b09359d..1c23339 100644 (file)
@@ -126,6 +126,10 @@ ngx_http_auth_basic_handler(ngx_http_request_t *r)
     rc = ngx_http_auth_basic_user(r);
 
     if (rc == NGX_DECLINED) {
+
+        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+                      "no user/password was provided for basic authentication");
+
         return ngx_http_auth_basic_set_realm(r, &alcf->realm);
     }
 
@@ -172,9 +176,16 @@ ngx_http_auth_basic_handler(ngx_http_request_t *r)
             switch (state) {
 
             case sw_login:
-                if (login == 0 && buf[i] == '#') {
-                    state = sw_skip;
-                    break;
+                if (login == 0) {
+
+                    if (buf[i] == '#' || buf[i] == CR) {
+                        state = sw_skip;
+                        break;
+                    }
+
+                    if (buf[i] == LF) {
+                        break;
+                    }
                 }
 
                 if (buf[i] != r->headers_in.user.data[login]) {
@@ -242,6 +253,10 @@ ngx_http_auth_basic_handler(ngx_http_request_t *r)
         return ngx_http_auth_basic_crypt_handler(r, NULL, &pwd, &alcf->realm);
     }
 
+    ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+                  "user \"%V\" was not found in \"%V\"",
+                  &r->headers_in.user, &alcf->user_file);
+
     return ngx_http_auth_basic_set_realm(r, &alcf->realm);
 }
 
@@ -257,8 +272,8 @@ ngx_http_auth_basic_crypt_handler(ngx_http_request_t *r,
                    &encrypted);
 
     ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-                  "rc: %d user: \"%V\" salt: \"%s\"",
-                  rc, &r->headers_in.user, passwd->data);
+                   "rc: %d user: \"%V\" salt: \"%s\"",
+                   rc, &r->headers_in.user, passwd->data);
 
     if (rc == NGX_OK) {
         if (ngx_strcmp(encrypted, passwd->data) == 0) {
@@ -268,6 +283,10 @@ ngx_http_auth_basic_crypt_handler(ngx_http_request_t *r,
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "encrypted: \"%s\"", encrypted);
 
+        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+                      "user \"%V\": password mismatch",
+                      &r->headers_in.user);
+
         return ngx_http_auth_basic_set_realm(r, realm);
     }
 
index cfe8ef5..0a65073 100644 (file)
@@ -47,7 +47,7 @@ our @EXPORT = qw(
     HTTP_INSUFFICIENT_STORAGE
 );
 
-our $VERSION = '0.7.37';
+our $VERSION = '0.7.38';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
index 54ca4ff..a14a03c 100644 (file)
@@ -1004,7 +1004,7 @@ ngx_worker_process_exit(ngx_cycle_t *cycle)
                 && !c[i].read->resolver)
             {
                 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
-                              "open socket #%d left in %ui connection %s",
+                              "open socket #%d left in connection %ui%s",
                               c[i].fd, i, ngx_debug_quit ? ", aborting" : "");
                 ngx_debug_point();
             }