]> git.kaiwu.me - nginx.git/commitdiff
Fixed calls to ngx_open_file() in certain places.
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 9 Aug 2017 12:03:27 +0000 (15:03 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 9 Aug 2017 12:03:27 +0000 (15:03 +0300)
Pass NGX_FILE_OPEN to ngx_open_file() to fix "The parameter is incorrect"
error on win32 when using the ssl_session_ticket_key directive or loading
a binary geo base.  On UNIX, this change is a no-op.

src/event/ngx_event_openssl.c
src/http/modules/ngx_http_geo_module.c
src/stream/ngx_stream_geo_module.c

index ccd0cd5b8f4b395f1bbafec8e8a18cabc2016d7b..d67394bf525a811c95036e6e1866530e1b703f1e 100644 (file)
@@ -2906,7 +2906,8 @@ ngx_ssl_session_ticket_keys(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_array_t *paths)
         file.name = path[i];
         file.log = cf->log;
 
-        file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY, 0, 0);
+        file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY,
+                                NGX_FILE_OPEN, 0);
 
         if (file.fd == NGX_INVALID_FILE) {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
index 45b1a8e491720135eb857275724e22a5b70ff685..8262c9d61ff174a068d5672ceb62567aeba1d82b 100644 (file)
@@ -1400,7 +1400,7 @@ ngx_http_geo_include_binary_base(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
     file.name = *name;
     file.log = cf->log;
 
-    file.fd = ngx_open_file(name->data, NGX_FILE_RDONLY, 0, 0);
+    file.fd = ngx_open_file(name->data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
 
     if (file.fd == NGX_INVALID_FILE) {
         err = ngx_errno;
index b34316bdd1954cc4a277b0ea3b72655bfd9314cd..632fa5a5a639c67de2d4a65b065ce4f8fcc2ea56 100644 (file)
@@ -1326,7 +1326,7 @@ ngx_stream_geo_include_binary_base(ngx_conf_t *cf,
     file.name = *name;
     file.log = cf->log;
 
-    file.fd = ngx_open_file(name->data, NGX_FILE_RDONLY, 0, 0);
+    file.fd = ngx_open_file(name->data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
 
     if (file.fd == NGX_INVALID_FILE) {
         err = ngx_errno;