Browse Source

haproxy: fixes from upstream

 - [PATCH 05/13] BUG/MINOR: http/sample: gmtime/localtime can fail
 - [PATCH 06/13] DOC: typo in 'redirect', 302 code meaning
 - [PATCH 07/13] DOC: mention that %ms is left-padded with zeroes.
 - [PATCH 08/13] CLEANUP: .gitignore: ignore more test files
 - [PATCH 09/13] CLEANUP: .gitignore: finally ignore everything but what
 - [PATCH 10/13] MEDIUM: config: emit a warning on a frontend without
 - [PATCH 11/13] BUG/MEDIUM: counters: ensure that src_{inc,clr}_gpc0
 - [PATCH 12/13] DOC: ssl: missing LF
 - [PATCH 13/13] DOC: fix example of http-request using

Signed-off-by: heil <heil@terminal-consulting.de>
heil 9 years ago
parent
commit
8ce9ad4b8d

+ 1
- 1
net/haproxy/Makefile View File

@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
10 10
 
11 11
 PKG_NAME:=haproxy
12 12
 PKG_VERSION:=1.5.14
13
-PKG_RELEASE:=04
13
+PKG_RELEASE:=13
14 14
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
16 16
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

+ 33
- 0
net/haproxy/patches/0005-BUG-MINOR-http-sample-gmtime-localtime-can-fail.patch View File

@@ -0,0 +1,33 @@
1
+From 955587271031d66e9b7a768e3bb18dae00b60cc6 Mon Sep 17 00:00:00 2001
2
+From: Thierry FOURNIER <tfournier@arpalert.org>
3
+Date: Wed, 8 Jul 2015 00:15:20 +0200
4
+Subject: [PATCH 05/13] BUG/MINOR: http/sample: gmtime/localtime can fail
5
+
6
+The man said that gmtime() and localtime() can return a NULL value.
7
+This is not tested. It appears that all the values of a 32 bit integer
8
+are valid, but it is better to check the return of these functions.
9
+
10
+However, if the integer move from 32 bits to 64 bits, some 64 values
11
+can be unsupported.
12
+(cherry picked from commit fac9ccfb705702f211f99e67d5f5d5129002086a)
13
+[wt: we only have sample_conv_date() in 1.5]
14
+---
15
+ src/proto_http.c | 2 ++
16
+ 1 file changed, 2 insertions(+)
17
+
18
+diff --git a/src/proto_http.c b/src/proto_http.c
19
+index 5db64b5..02dc42b 100644
20
+--- a/src/proto_http.c
21
++++ b/src/proto_http.c
22
+@@ -11249,6 +11249,8 @@ static int sample_conv_http_date(const struct arg *args, struct sample *smp)
23
+ 		curr_date += args[0].data.sint;
24
+ 
25
+ 	tm = gmtime(&curr_date);
26
++	if (!tm)
27
++		return 0;
28
+ 
29
+ 	temp = get_trash_chunk();
30
+ 	temp->len = snprintf(temp->str, temp->size - temp->len,
31
+-- 
32
+2.4.6
33
+

+ 27
- 0
net/haproxy/patches/0006-DOC-typo-in-redirect-302-code-meaning.patch View File

@@ -0,0 +1,27 @@
1
+From 6c7351bdd0778bc171a2b54faed058eadc8c9d0d Mon Sep 17 00:00:00 2001
2
+From: Baptiste Assmann <bedis9@gmail.com>
3
+Date: Mon, 3 Aug 2015 11:42:50 +0200
4
+Subject: [PATCH 06/13] DOC: typo in 'redirect', 302 code meaning
5
+
6
+302 means a temprary move, not a permanent one
7
+(cherry picked from commit ea849c0cca63b1b56c9c36f9c3504caa5e826816)
8
+---
9
+ doc/configuration.txt | 2 +-
10
+ 1 file changed, 1 insertion(+), 1 deletion(-)
11
+
12
+diff --git a/doc/configuration.txt b/doc/configuration.txt
13
+index 64697a4..e8d8b2a 100644
14
+--- a/doc/configuration.txt
15
++++ b/doc/configuration.txt
16
+@@ -5443,7 +5443,7 @@ redirect scheme   <sch> [code <code>] <option> [{if | unless} <condition>]
17
+               is desired. Only codes 301, 302, 303, 307 and 308 are supported,
18
+               with 302 used by default if no code is specified. 301 means
19
+               "Moved permanently", and a browser may cache the Location. 302
20
+-              means "Moved permanently" and means that the browser should not
21
++              means "Moved temporarily" and means that the browser should not
22
+               cache the redirection. 303 is equivalent to 302 except that the
23
+               browser will fetch the location with a GET method. 307 is just
24
+               like 302 but makes it clear that the same method must be reused.
25
+-- 
26
+2.4.6
27
+

+ 27
- 0
net/haproxy/patches/0007-DOC-mention-that-ms-is-left-padded-with-zeroes.patch View File

@@ -0,0 +1,27 @@
1
+From c3453d53f2862b22d8c8e7d2399dfc38ec966aa4 Mon Sep 17 00:00:00 2001
2
+From: Willy Tarreau <w@1wt.eu>
3
+Date: Sun, 9 Aug 2015 10:56:35 +0200
4
+Subject: [PATCH 07/13] DOC: mention that %ms is left-padded with zeroes.
5
+
6
+That's important to emit logs.
7
+(cherry picked from commit 812c88ec126e8fc4fc0f7853f265594d03c63956)
8
+---
9
+ doc/configuration.txt | 2 +-
10
+ 1 file changed, 1 insertion(+), 1 deletion(-)
11
+
12
+diff --git a/doc/configuration.txt b/doc/configuration.txt
13
+index e8d8b2a..1d95b5b 100644
14
+--- a/doc/configuration.txt
15
++++ b/doc/configuration.txt
16
+@@ -12381,7 +12381,7 @@ Please refer to the table below for currently defined variables :
17
+   |   | %hrl | captured_request_headers CLF style            | string list |
18
+   |   | %hs  | captured_response_headers default style       | string      |
19
+   |   | %hsl | captured_response_headers CLF style           | string list |
20
+-  |   | %ms  | accept date milliseconds                      | numeric     |
21
++  |   | %ms  | accept date milliseconds (left-padded with 0) | numeric     |
22
+   |   | %pid | PID                                           | numeric     |
23
+   | H | %r   | http_request                                  | string      |
24
+   |   | %rc  | retries                                       | numeric     |
25
+-- 
26
+2.4.6
27
+

+ 50
- 0
net/haproxy/patches/0008-CLEANUP-.gitignore-ignore-more-test-files.patch View File

@@ -0,0 +1,50 @@
1
+From 1104336c0ba5f474fce8fe7c0125511b59f4dd3d Mon Sep 17 00:00:00 2001
2
+From: Willy Tarreau <w@1wt.eu>
3
+Date: Tue, 11 Aug 2015 11:20:45 +0200
4
+Subject: [PATCH 08/13] CLEANUP: .gitignore: ignore more test files
5
+
6
+Exclude from "git status" many of the files that often result from
7
+development tests and bug reports reproducers.
8
+(cherry picked from commit de365a320ead43168e78facfa337130759783515)
9
+---
10
+ .gitignore | 27 +++++++++++++++++++++++++++
11
+ 1 file changed, 27 insertions(+)
12
+
13
+diff --git a/.gitignore b/.gitignore
14
+index 762f5ad..f6ccd0e 100644
15
+--- a/.gitignore
16
++++ b/.gitignore
17
+@@ -18,3 +18,30 @@ make-*
18
+ dlmalloc.c
19
+ 00*.patch
20
+ *.service
21
++*.bak
22
++contrib/base64/base64rev
23
++contrib/halog/halog
24
++contrib/ip6range/ip6range
25
++contrib/iprange/iprange
26
++tests/test_hashes
27
++/*.cfg
28
++/*.conf
29
++/*.diff
30
++/*.patch
31
++/*.c
32
++/*.o
33
++/*.so
34
++/*.txt
35
++/*.TXT
36
++/*.txt.*
37
++/*.prof
38
++/*.gprof
39
++/*.prof.*
40
++/*.gprof.*
41
++/*.tar
42
++/*.tar.gz
43
++/*.tgz
44
++/*.mbox
45
++/*.sh
46
++/bug*
47
++/TAGS
48
+-- 
49
+2.4.6
50
+

+ 44
- 0
net/haproxy/patches/0009-CLEANUP-.gitignore-finally-ignore-everything-but-wha.patch View File

@@ -0,0 +1,44 @@
1
+From 5e077624951a65e6aae381c7213fc54984768dd4 Mon Sep 17 00:00:00 2001
2
+From: Willy Tarreau <w@1wt.eu>
3
+Date: Tue, 11 Aug 2015 11:21:47 +0200
4
+Subject: [PATCH 09/13] CLEANUP: .gitignore: finally ignore everything but what
5
+ is known.
6
+
7
+Still too many files remain, it's easier to block everything but
8
+what we know.
9
+(cherry picked from commit d71f1766bdbb041f80394662b0d293f033f93005)
10
+---
11
+ .gitignore | 20 ++++++++++++++++++++
12
+ 1 file changed, 20 insertions(+)
13
+
14
+diff --git a/.gitignore b/.gitignore
15
+index f6ccd0e..1953ba3 100644
16
+--- a/.gitignore
17
++++ b/.gitignore
18
+@@ -45,3 +45,23 @@ tests/test_hashes
19
+ /*.sh
20
+ /bug*
21
+ /TAGS
22
++# Below we forbid everything and only allow what we know, that's much easier
23
++# than blocking about 500 different test files and bug report outputs.
24
++/.*
25
++/*
26
++!/.gitignore
27
++!/CHANGELOG
28
++!/LICENSE
29
++!/Makefile
30
++!/README
31
++!/ROADMAP
32
++!/SUBVERS
33
++!/VERDATE
34
++!/VERSION
35
++!/contrib
36
++!/doc
37
++!/ebtree
38
++!/examples
39
++!/include
40
++!/src
41
++!/tests
42
+-- 
43
+2.4.6
44
+

+ 46
- 0
net/haproxy/patches/0010-MEDIUM-config-emit-a-warning-on-a-frontend-without-l.patch View File

@@ -0,0 +1,46 @@
1
+From c7c1e55f09839727ba7defd37347fc500dabb202 Mon Sep 17 00:00:00 2001
2
+From: Willy Tarreau <w@1wt.eu>
3
+Date: Tue, 11 Aug 2015 11:36:45 +0200
4
+Subject: [PATCH 10/13] MEDIUM: config: emit a warning on a frontend without
5
+ listener
6
+
7
+Commit c6678e2 ("MEDIUM: config: authorize frontend and listen without bind")
8
+completely removed the test for bind lines in frontends in order to make it
9
+easier for automated tools to generate configs (eg: replacing a bind with
10
+another one passing via a temporary config without any bind line). The
11
+problem is that some common mistakes are totally hidden now. For example,
12
+this apparently valid entry is silently ignored :
13
+
14
+       listen 1.2.3.4:8000
15
+           server s1 127.0.0.1:8000
16
+
17
+Hint: 1.2.3.4:8000 is mistakenly the proxy name here.
18
+
19
+Thus instead we now emit a warning to indicate that a frontend was found
20
+with no listener. This should be backported to 1.5 to help spot abnormal
21
+configurations.
22
+(cherry picked from commit f82d1ca2d7ec83804d6b54e61a35747ad2f85188)
23
+---
24
+ src/cfgparse.c | 6 ++++++
25
+ 1 file changed, 6 insertions(+)
26
+
27
+diff --git a/src/cfgparse.c b/src/cfgparse.c
28
+index 2a5f178..d67edc5 100644
29
+--- a/src/cfgparse.c
30
++++ b/src/cfgparse.c
31
+@@ -6193,6 +6193,12 @@ int check_config_validity()
32
+ 			break;
33
+ 		}
34
+ 
35
++		if ((curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners)) {
36
++			Warning("config : %s '%s' has no 'bind' directive. Please declare it as a backend if this was intended.\n",
37
++			        proxy_type_str(curproxy), curproxy->id);
38
++			err_code |= ERR_WARN;
39
++		}
40
++
41
+ 		if ((curproxy->cap & PR_CAP_BE) && (curproxy->mode != PR_MODE_HEALTH)) {
42
+ 			if (curproxy->lbprm.algo & BE_LB_KIND) {
43
+ 				if (curproxy->options & PR_O_TRANSP) {
44
+-- 
45
+2.4.6
46
+

+ 93
- 0
net/haproxy/patches/0011-BUG-MEDIUM-counters-ensure-that-src_-inc-clr-_gpc0-c.patch View File

@@ -0,0 +1,93 @@
1
+From ee12145d38a7dee81a20cf232c724ccb7a46ad8b Mon Sep 17 00:00:00 2001
2
+From: Willy Tarreau <w@1wt.eu>
3
+Date: Tue, 18 Aug 2015 17:15:20 +0200
4
+Subject: [PATCH 11/13] BUG/MEDIUM: counters: ensure that src_{inc,clr}_gpc0
5
+ creates a missing entry
6
+
7
+During 1.5-dev20 there was some code refactoring to make the src_* fetch
8
+function use the same code as sc_*. Unfortunately this introduced a
9
+regression where src_* doesn't create an entry anymore if it does not
10
+exist in the table. The reason is that smp_fetch_sc_stkctr() only calls
11
+stktable_lookup_key() while src_inc_*/src_clr_* used to make use of
12
+stktable_update_key() which additionally create the entry if it does
13
+not exist.
14
+
15
+There's no point modifying the common function for these two exceptions,
16
+so instead we now have a function dedicated to the creation of this entry
17
+for src_* only. It is called when the entry didn't exist, so that requires
18
+minimal modifications to existing code.
19
+
20
+Thanks to Thierry Fournier for helping diagnose the issue.
21
+
22
+This fix must be backported to 1.5.
23
+(cherry picked from commit 0f4eadd4830279f5ee83aa545728fb750f5c8185)
24
+
25
+[Note: the backport to 1.5 significantly differs from the version in 1.6
26
+ since we need to use the table's type and to retrieve the source address
27
+ directly from the connection. At least it matches the way other src_*
28
+ fetch functions work, and it's been verified to work fine]
29
+---
30
+ src/session.c | 33 +++++++++++++++++++++++++++++++++
31
+ 1 file changed, 33 insertions(+)
32
+
33
+diff --git a/src/session.c b/src/session.c
34
+index 5b9e407..6d62e36 100644
35
+--- a/src/session.c
36
++++ b/src/session.c
37
+@@ -2806,6 +2806,33 @@ smp_fetch_sc_stkctr(struct session *l4, const struct arg *args, const char *kw)
38
+ 	return &l4->stkctr[num];
39
+ }
40
+ 
41
++/* same as smp_fetch_sc_stkctr() but dedicated to src_* and can create
42
++ * the entry if it doesn't exist yet. This is needed for a few fetch
43
++ * functions which need to create an entry, such as src_inc_gpc* and
44
++ * src_clr_gpc*.
45
++ */
46
++struct stkctr *
47
++smp_create_src_stkctr(struct session *sess, const struct arg *args, const char *kw)
48
++{
49
++	static struct stkctr stkctr;
50
++	struct stktable_key *key;
51
++	struct connection *conn = objt_conn(sess->si[0].end);
52
++
53
++	if (strncmp(kw, "src_", 4) != 0)
54
++		return NULL;
55
++
56
++	if (!conn)
57
++		return NULL;
58
++
59
++	key = addr_to_stktable_key(&conn->addr.from, args->data.prx->table.type);
60
++	if (!key)
61
++		return NULL;
62
++
63
++	stkctr.table = &args->data.prx->table;
64
++	stkctr_set_entry(&stkctr, stktable_update_key(stkctr.table, key));
65
++	return &stkctr;
66
++}
67
++
68
+ /* set return a boolean indicating if the requested session counter is
69
+  * currently being tracked or not.
70
+  * Supports being called as "sc[0-9]_tracked" only.
71
+@@ -2887,6 +2914,9 @@ smp_fetch_sc_inc_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned i
72
+ 	if (!stkctr)
73
+ 		return 0;
74
+ 
75
++	if (stkctr_entry(stkctr) == NULL)
76
++		stkctr = smp_create_src_stkctr(l4, args, kw);
77
++
78
+ 	smp->flags = SMP_F_VOL_TEST;
79
+ 	smp->type = SMP_T_UINT;
80
+ 	smp->data.uint = 0;
81
+@@ -2924,6 +2954,9 @@ smp_fetch_sc_clr_gpc0(struct proxy *px, struct session *l4, void *l7, unsigned i
82
+ 	if (!stkctr)
83
+ 		return 0;
84
+ 
85
++	if (stkctr_entry(stkctr) == NULL)
86
++		stkctr = smp_create_src_stkctr(l4, args, kw);
87
++
88
+ 	smp->flags = SMP_F_VOL_TEST;
89
+ 	smp->type = SMP_T_UINT;
90
+ 	smp->data.uint = 0;
91
+-- 
92
+2.4.6
93
+

+ 27
- 0
net/haproxy/patches/0012-DOC-ssl-missing-LF.patch View File

@@ -0,0 +1,27 @@
1
+From 2272b4ffde38c836adfd9a9b43ff5c019ef4190a Mon Sep 17 00:00:00 2001
2
+From: Thierry FOURNIER <tfournier@arpalert.org>
3
+Date: Wed, 26 Aug 2015 08:21:26 +0200
4
+Subject: [PATCH 12/13] DOC: ssl: missing LF
5
+
6
+An error message miss LF
7
+(cherry picked from commit bc965348d7ccc0a306504232ab85dc240fd31fbf)
8
+---
9
+ src/ssl_sock.c | 2 +-
10
+ 1 file changed, 1 insertion(+), 1 deletion(-)
11
+
12
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
13
+index 2ae45ec..8f698c0 100644
14
+--- a/src/ssl_sock.c
15
++++ b/src/ssl_sock.c
16
+@@ -1760,7 +1760,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv, struct proxy *curproxy)
17
+ #ifndef OPENSSL_NO_SSL3
18
+ 		SSL_CTX_set_ssl_version(srv->ssl_ctx.ctx, SSLv3_client_method());
19
+ #else
20
+-		Alert("SSLv3 support requested but unavailable.");
21
++		Alert("SSLv3 support requested but unavailable.\n");
22
+ 		cfgerr++;
23
+ #endif
24
+ 	}
25
+-- 
26
+2.4.6
27
+

+ 30
- 0
net/haproxy/patches/0013-DOC-fix-example-of-http-request-using-ssl_fc_session.patch View File

@@ -0,0 +1,30 @@
1
+From d3a93a932430bc1a4cd5d1350820c2bec706e26d Mon Sep 17 00:00:00 2001
2
+From: Willy Tarreau <w@1wt.eu>
3
+Date: Thu, 27 Aug 2015 17:15:05 +0200
4
+Subject: [PATCH 13/13] DOC: fix example of http-request using
5
+ ssl_fc_session_id
6
+
7
+It was missing the ",hex" resulting in raw binary data being dumped in
8
+the header or the logs. Now we know where these crazy logs originated
9
+from!
10
+(cherry picked from commit fca4261dacab51db960d30120f4bb4201f7e4a51)
11
+---
12
+ doc/configuration.txt | 2 +-
13
+ 1 file changed, 1 insertion(+), 1 deletion(-)
14
+
15
+diff --git a/doc/configuration.txt b/doc/configuration.txt
16
+index 1d95b5b..67d273b 100644
17
+--- a/doc/configuration.txt
18
++++ b/doc/configuration.txt
19
+@@ -3135,7 +3135,7 @@ http-request { allow | deny | tarpit | auth [realm <realm>] | redirect <rule> |
20
+   Example:
21
+         http-request set-header X-Haproxy-Current-Date %T
22
+         http-request set-header X-SSL                  %[ssl_fc]
23
+-        http-request set-header X-SSL-Session_ID       %[ssl_fc_session_id]
24
++        http-request set-header X-SSL-Session_ID       %[ssl_fc_session_id,hex]
25
+         http-request set-header X-SSL-Client-Verify    %[ssl_c_verify]
26
+         http-request set-header X-SSL-Client-DN        %{+Q}[ssl_c_s_dn]
27
+         http-request set-header X-SSL-Client-CN        %{+Q}[ssl_c_s_dn(cn)]
28
+-- 
29
+2.4.6
30
+