Merge ~bryce/ubuntu/+source/librabbitmq:sru.1790657-xenial into ubuntu/+source/librabbitmq:ubuntu/xenial-devel

Proposed by Bryce Harrington
Status: Merged
Approved by: Bryce Harrington
Approved revision: 517e5e52c9b6c5a33fc5434c4c2e2b0253304c6d
Merge reported by: Bryce Harrington
Merged at revision: 517e5e52c9b6c5a33fc5434c4c2e2b0253304c6d
Proposed branch: ~bryce/ubuntu/+source/librabbitmq:sru.1790657-xenial
Merge into: ubuntu/+source/librabbitmq:ubuntu/xenial-devel
Diff against target: 147 lines (+126/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/fix-parameter-processing.patch (+117/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Canonical Server Pending
Canonical Server packageset reviewers Pending
Review via email: mp+370166@code.launchpad.net

Description of the change

Straightforward backport of an upstream fix for parameter handling.

    LP: #1790657

Please also review the SRU details in the bug description.

A PPA with fixes for xenial, bionic, and cosmic is available here:
    https://code.launchpad.net/~bryce/ubuntu/+source/librabbitmq/+git/librabbitmq

Red/green testing in lxc can be done via:

    $ sudo apt-get -y install librabbitmq-dev
    $ sudo apt-get -y install amqp-tools

    ### Broken behavior:
    $ sudo amqp-consume --server=foobar:5672 -q queue cat
    both --server and --url options specify server host

    ### Fixed behavior:
    $ sudo apt-add-repository -y ppa:bryce/librabbitmq-sru-1790657
    $ sudo apt-get -y install librabbitmq-dev
    $ sudo amqp-consume --server=foobar:5672 -q queue cat
    Specifying the port number with --server is deprecated
    opening socket to foobar:5672

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

As with Bionic (change is identical) ...
Tested against PPA - ok
Upstream references - ok
Patch headers - perfect
Check upstream bug discussions - ok
Check LP bug - ok
SRU template - ok

Given how long things are broken this seems rather unimportant, but OTOH a very low hanging fruit.
Thanks Bryce for prepping that.
+1 on the MP

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks for the review Christian.

$ git ubuntu tag --upload
$ git push pkg upload/0.7.1-1ubuntu0.1
Counting objects: 11, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 2.62 KiB | 892.00 KiB/s, done.
Total 11 (delta 5), reused 0 (delta 0)
To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/librabbitmq
 * [new tag] upload/0.7.1-1ubuntu0.1 -> upload/0.7.1-1ubuntu0.1
$ dput ubuntu ../librabbitmq_0.7.1-1ubuntu0.1_source.changes
Checking signature on .changes
gpg: ../librabbitmq_0.7.1-1ubuntu0.1_source.changes: Valid signature from E603B2578FB8F0FB
Checking signature on .dsc
gpg: ../librabbitmq_0.7.1-1ubuntu0.1.dsc: Valid signature from E603B2578FB8F0FB
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading librabbitmq_0.7.1-1ubuntu0.1.dsc: done.
  Uploading librabbitmq_0.7.1-1ubuntu0.1.debian.tar.xz: done.
  Uploading librabbitmq_0.7.1-1ubuntu0.1_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 8240ae7..9470e5d 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+librabbitmq (0.7.1-1ubuntu0.1) xenial; urgency=medium
7+
8+ * d/patches: Add fix-parameter-processing.patch to correct handling of
9+ --server, --url, and other options by reorganizing the logic flow.
10+ (LP: #1790657)
11+
12+ -- Bryce Harrington <bryce@canonical.com> Mon, 08 Jul 2019 20:19:04 -0700
13+
14 librabbitmq (0.7.1-1) unstable; urgency=medium
15
16 * New upstream release.
17diff --git a/debian/patches/fix-parameter-processing.patch b/debian/patches/fix-parameter-processing.patch
18new file mode 100644
19index 0000000..4a49fc8
20--- /dev/null
21+++ b/debian/patches/fix-parameter-processing.patch
22@@ -0,0 +1,117 @@
23+From 5dfe5d2f2680a4639090a9c239a2b0018d90c789 Mon Sep 17 00:00:00 2001
24+From: Alan Antonuk <alan.antonuk@gmail.com>
25+Date: Fri, 19 Aug 2016 23:22:44 -0700
26+Subject: [PATCH] Tools: fix --url parameter processing issues.
27+
28+--url parameter should not be specified with the --server --port
29+--username and --password parameters. Correct parameter processing
30+routines to correctly enforce this.
31+
32+Fixes #364
33+
34+Author: Alan Antonuk <alan.antonuk@gmail.com>
35+Origin: upstream, https://github.com/alanxz/rabbitmq-c/commit/5dfe5d2f2680a4639090a9c239a2b0018d90c789
36+Bug: https://github.com/alanxz/rabbitmq-c/issues/364
37+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/librabbitmq/+bug/1790657
38+Acked-By: Bryce Harrington <bryce@canonical.com>
39+Applied-Upstream: 0.9.0, commit:5dfe5d2f2680a4639090a9c239a2b0018d90c789
40+Last-Updated: 2019-06-27
41+---
42+ tools/common.c | 43 ++++++++++++++++++++-----------------------
43+ 1 file changed, 20 insertions(+), 23 deletions(-)
44+
45+diff --git a/tools/common.c b/tools/common.c
46+index c8b13e31..9c6b085f 100644
47+--- a/tools/common.c
48++++ b/tools/common.c
49+@@ -247,9 +247,9 @@ static void init_connection_info(struct amqp_connection_info *ci)
50+
51+ if (amqp_server) {
52+ char *colon;
53+- if (ci->host)
54+- die("both --server and --url options specify"
55+- " server host");
56++ if (amqp_url) {
57++ die("--server and --url options cannot be used at the same time");
58++ }
59+
60+ /* parse the server string into a hostname and a port */
61+ colon = strchr(amqp_server, ':');
62+@@ -260,7 +260,7 @@ static void init_connection_info(struct amqp_connection_info *ci)
63+ /* Deprecate specifying the port number with the
64+ --server option, because it is not ipv6 friendly.
65+ --url now allows connection options to be
66+- specificied concisely. */
67++ specified concisely. */
68+ fprintf(stderr, "Specifying the port number with"
69+ " --server is deprecated\n");
70+
71+@@ -269,12 +269,9 @@ static void init_connection_info(struct amqp_connection_info *ci)
72+ memcpy(ci->host, amqp_server, host_len);
73+ ci->host[host_len] = 0;
74+
75+- if (ci->port >= 0)
76+- die("both --server and --url options specify"
77+- " server port");
78+- if (amqp_port >= 0)
79+- die("both --server and --port options specify"
80+- " server port");
81++ if (amqp_port >= 0) {
82++ die("both --server and --port options specify server port");
83++ }
84+
85+ ci->port = strtol(colon+1, &port_end, 10);
86+ if (ci->port < 0
87+@@ -288,39 +285,39 @@ static void init_connection_info(struct amqp_connection_info *ci)
88+ #if WITH_SSL
89+ if (amqp_ssl && !ci->ssl) {
90+ die("the --ssl option specifies an SSL connection"
91+- " but the --server option does not");
92++ " but the --url option does not");
93+ }
94+ #endif
95+ }
96+
97+ if (amqp_port >= 0) {
98+- if (ci->port >= 0)
99+- die("both --port and --url options specify"
100+- " server port");
101++ if (amqp_url) {
102++ die("--port and --url options cannot be used at the same time");
103++ }
104+
105+ ci->port = amqp_port;
106+ }
107+
108+ if (amqp_username) {
109+- if (ci->user)
110+- die("both --username and --url options specify"
111+- " AMQP username");
112++ if (amqp_url) {
113++ die("--username and --url options cannot be used at the same time");
114++ }
115+
116+ ci->user = amqp_username;
117+ }
118+
119+ if (amqp_password) {
120+- if (ci->password)
121+- die("both --password and --url options specify"
122+- " AMQP password");
123++ if (amqp_url) {
124++ die("--password and --url options cannot be used at the same time");
125++ }
126+
127+ ci->password = amqp_password;
128+ }
129+
130+ if (amqp_vhost) {
131+- if (ci->vhost)
132+- die("both --vhost and --url options specify"
133+- " AMQP vhost");
134++ if (amqp_url) {
135++ die("--vhost and --url options cannot be used at the same time");
136++ }
137+
138+ ci->vhost = amqp_vhost;
139+ }
140diff --git a/debian/patches/series b/debian/patches/series
141index c717f5f..b596ba9 100644
142--- a/debian/patches/series
143+++ b/debian/patches/series
144@@ -1,2 +1,3 @@
145 cmake_with_ssl.patch
146 use_cmake_package.patch
147+fix-parameter-processing.patch

Subscribers

People subscribed via source and target branches