[nginx] svn commit: r5064 - in branches/stable-1.2: . src/http/modules

mdounin at mdounin.ru mdounin at mdounin.ru
Mon Feb 11 16:09:36 UTC 2013


Author: mdounin
Date: 2013-02-11 16:09:35 +0000 (Mon, 11 Feb 2013)
New Revision: 5064
URL: http://trac.nginx.org/nginx/changeset/5064/nginx

Log:
Merge of r5018: secure link: fixed configuration inheritance.

The "secure_link_secret" directive was always inherited from the outer
configuration level even when "secure_link" and "secure_link_md5" were
specified on the inner level.


Modified:
   branches/stable-1.2/
   branches/stable-1.2/src/http/modules/ngx_http_secure_link_module.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2	2013-02-11 16:06:39 UTC (rev 5063)
+++ branches/stable-1.2	2013-02-11 16:09:35 UTC (rev 5064)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5004,5011-5017,5019-5025,5030
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5004,5011-5025,5030
\ No newline at end of property
Modified: branches/stable-1.2/src/http/modules/ngx_http_secure_link_module.c
===================================================================
--- branches/stable-1.2/src/http/modules/ngx_http_secure_link_module.c	2013-02-11 16:06:39 UTC (rev 5063)
+++ branches/stable-1.2/src/http/modules/ngx_http_secure_link_module.c	2013-02-11 16:09:35 UTC (rev 5064)
@@ -111,7 +111,7 @@
 
     conf = ngx_http_get_module_loc_conf(r, ngx_http_secure_link_module);
 
-    if (conf->secret.len) {
+    if (conf->secret.data) {
         return ngx_http_secure_link_old_variable(r, conf, v, data);
     }
 
@@ -318,8 +318,17 @@
     ngx_http_secure_link_conf_t *prev = parent;
     ngx_http_secure_link_conf_t *conf = child;
 
-    ngx_conf_merge_str_value(conf->secret, prev->secret, "");
+    if (conf->secret.data) {
+        if (conf->variable || conf->md5) {
+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                               "\"secure_link_secret\" cannot be mixed with "
+                               "\"secure_link\" and \"secure_link_md5\"");
+            return NGX_CONF_ERROR;
+        }
 
+        return NGX_CONF_OK;
+    }
+
     if (conf->variable == NULL) {
         conf->variable = prev->variable;
     }
@@ -328,6 +337,10 @@
         conf->md5 = prev->md5;
     }
 
+    if (conf->variable == NULL && conf->md5 == NULL) {
+        conf->secret = prev->secret;
+    }
+
     return NGX_CONF_OK;
 }
 



More information about the nginx-devel mailing list