Merge ~ahasenack/ubuntu/+source/cyrus-sasl2:kinetic-sasl2-digestmd5-noise into ubuntu/+source/cyrus-sasl2:ubuntu/devel

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 2cb706ea1b8228261ab6d0ebe7866b2207777d30
Proposed branch: ~ahasenack/ubuntu/+source/cyrus-sasl2:kinetic-sasl2-digestmd5-noise
Merge into: ubuntu/+source/cyrus-sasl2:ubuntu/devel
Diff against target: 124 lines (+90/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/0033-honor-log_level-option-on-clients-too.patch (+80/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server Pending
Review via email: mp+423455@code.launchpad.net

Description of the change

Upstream patch to fix some default logging noise in client apps using the cyrus-sasl2 libraries.

I didn't push this one to Debian because it's not really a severe bug, and since it's committed usptream it will be part of the next release, and we will sync the pacakge again when debian updates it. Also, having it as a patch like this makes it easier to provide an SRU if deemed necessary.

PPA with just amd64, but proposed enabled: https://launchpad.net/~ahasenack/+archive/ubuntu/sasl-verbose-digestmd5

DEP8 tests pass:
autopkgtest [09:22:07]: @@@@@@@@@@@@@@@@@@@@ summary
pluginviewer PASS
saslauthd PASS
gssapi PASS
shared-secret-mechs PASS

(shared-secret-mechs is the one that tests digest-md5, among others)

To test, install in a container:
apt install slapd ldap-utils

Tail the auth log:
tail -f /var/log/auth.log

Run this command, with any password (it will fail, as expected):
ldapwhoami -Y DIGEST-MD5

Watch the logs get lots of debugging messages for digest-md5:
May 26 12:30:57 k1 ldapwhoami: DIGEST-MD5 client step 2
May 26 12:30:57 k1 ldapwhoami: DIGEST-MD5 parse_server_challenge()
May 26 12:30:57 k1 ldapwhoami: DIGEST-MD5 ask_user_info()
May 26 12:30:58 k1 ldapwhoami: DIGEST-MD5 client step 2
May 26 12:30:58 k1 ldapwhoami: DIGEST-MD5 ask_user_info()
May 26 12:30:58 k1 ldapwhoami: DIGEST-MD5 make_client_response()
May 26 12:30:58 k1 ldapwhoami: DIGEST-MD5 create_layer_keys()
May 26 12:30:58 k1 ldapwhoami: DIGEST-MD5 client mech dispose
May 26 12:30:58 k1 ldapwhoami: DIGEST-MD5 common mech dispose

With the new cyrus-sasl2 packages, there is blissed silence.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

I've triggered autopkgtests against the PPA

$ lp-test-ppa -r kinetic --showpass ppa:ahasenack/sasl-verbose-digestmd5
Tests for PPA sasl-verbose-digestmd5
---- ---- ---- ----
Release: kinetic
Sources:
  SRC: cyrus-sasl2 @ 2.1.28+dfsg-6ubuntu1~ppa1 - Published
Triggers on published Sources:
           cyrus-sasl2 @ amd64 for cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1 Trigger @amd64 ♻️ Trigger all proposed @amd64 ♻️ πŸ’
           cyrus-sasl2 @ s390x for cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1 Trigger @s390x ♻️ Trigger all proposed @s390x ♻️ πŸ’
           cyrus-sasl2 @ ppc64el for cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1 Trigger @ppc64el ♻️ Trigger all proposed @ppc64el ♻️ πŸ’
           cyrus-sasl2 @ arm64 for cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1 Trigger @arm64 ♻️ Trigger all proposed @arm64 ♻️ πŸ’
           cyrus-sasl2 @ armhf for cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1 Trigger @armhf ♻️ Trigger all proposed @armhf ♻️ πŸ’
           cyrus-sasl2 @ riscv64 for cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1 Trigger @riscv64 ♻️ Trigger all proposed @riscv64 ♻️ πŸ’
Results from https://autopkgtest.ubuntu.com/results/autopkgtest-kinetic-ahasenack-sasl-verbose-digestmd5/?format=plain:
    No results published yet
Running:
    time pkg release arch ppa trigger
    0:00:20 cyrus-sasl2 kinetic amd64 ahasenack/sasl-verbose-digestmd5 cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1
    0:01:20 cyrus-sasl2 kinetic s390x ahasenack/sasl-verbose-digestmd5 cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1
    0:01:20 cyrus-sasl2 kinetic ppc64el ahasenack/sasl-verbose-digestmd5 cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1
    0:01:20 cyrus-sasl2 kinetic armhf ahasenack/sasl-verbose-digestmd5 cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1
Waiting:
    Q-num pkg release arch ppa trigger
    1 cyrus-sasl2 kinetic arm64 ahasenack/sasl-verbose-digestmd5 cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1

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

Some inline discussion but mostly me talking to myself, nothing that really has to be changed.

I'm not sure how this is enacted in the client, but I noticed you asked that question and got an answer, and you've tested thoroughly enough to confirm it does behave as expected in practice, so presumably you're confident it's being enacted properly.

Everything LGTM, +1.

Results from https://autopkgtest.ubuntu.com/results/autopkgtest-kinetic-ahasenack-sasl-verbose-digestmd5/?format=plain:
  cyrus-sasl2 @ arm64:
    27.05.22 18:52:51 Log πŸ—’οΈ βœ… Triggers: ['cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1']
      pluginviewer PASS βœ…
      saslauthd PASS βœ…
      gssapi PASS βœ…
      shared-secret-mechs PASS βœ…
  cyrus-sasl2 @ armhf:
    27.05.22 18:54:57 Log πŸ—’οΈ βœ… Triggers: ['cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1']
      pluginviewer PASS βœ…
      saslauthd PASS βœ…
      gssapi PASS βœ…
      shared-secret-mechs PASS βœ…
  cyrus-sasl2 @ ppc64el:
    27.05.22 18:43:38 Log πŸ—’οΈ βœ… Triggers: ['cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1']
      pluginviewer PASS βœ…
      saslauthd PASS βœ…
      gssapi PASS βœ…
      shared-secret-mechs PASS βœ…
  cyrus-sasl2 @ s390x:
    27.05.22 18:42:11 Log πŸ—’οΈ βœ… Triggers: ['cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1']
      pluginviewer PASS βœ…
      saslauthd PASS βœ…
      gssapi PASS βœ…
      shared-secret-mechs PASS βœ…
Running:
    time pkg release arch ppa trigger
    0:23:22 cyrus-sasl2 kinetic amd64 ahasenack/sasl-verbose-digestmd5 cyrus-sasl2/2.1.28+dfsg-6ubuntu1~ppa1
Waiting:

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Thanks Bryce for the thorough checks

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 4383f9f..3bb340c 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+cyrus-sasl2 (2.1.28+dfsg-6ubuntu1) kinetic; urgency=medium
7+
8+ * d/p/0033-honor-log_level-option-on-clients-too.patch: honor log
9+ level option on clients (LP: #827151)
10+
11+ -- Andreas Hasenack <andreas@canonical.com> Wed, 25 May 2022 16:41:43 -0300
12+
13 cyrus-sasl2 (2.1.28+dfsg-6) unstable; urgency=high
14
15 * d/copyright: Add debian/tests info
16diff --git a/debian/control b/debian/control
17index 3974a90..4c87ba6 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: cyrus-sasl2
22 Section: libs
23 Priority: optional
24-Maintainer: Debian Cyrus Team <team+cyrus@tracker.debian.org>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: Debian Cyrus Team <team+cyrus@tracker.debian.org>
27 Uploaders: Fabian Fagerholm <fabbe@debian.org>,
28 OndΕ™ej SurΓ½ <ondrej@debian.org>,
29 Bastian Germann <bage@debian.org>,
30diff --git a/debian/patches/0033-honor-log_level-option-on-clients-too.patch b/debian/patches/0033-honor-log_level-option-on-clients-too.patch
31new file mode 100644
32index 0000000..f2806e0
33--- /dev/null
34+++ b/debian/patches/0033-honor-log_level-option-on-clients-too.patch
35@@ -0,0 +1,80 @@
36+From cb549ef71c5bb646fe583697ebdcaba93267a237 Mon Sep 17 00:00:00 2001
37+From: Howard Chu <hyc@symas.com>
38+Date: Thu, 14 Apr 2022 16:27:54 +0100
39+Subject: [PATCH] Fix #386 - honor log_level option on clients too
40+
41+Signed-off-by: Howard Chu <hyc@symas.com>
42+---
43+ include/saslplug.h | 2 +-
44+ lib/client.c | 5 ++++-
45+ lib/common.c | 7 ++++++-
46+ 3 files changed, 11 insertions(+), 3 deletions(-)
47+
48+Origin: upstream, https://github.com/cyrusimap/cyrus-sasl/commit/cb549ef71c5bb646fe583697ebdcaba93267a237
49+Bug: https://github.com/cyrusimap/cyrus-sasl/issues/386
50+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/jammy/+source/cyrus-sasl2/+bug/827151
51+Last-Update: 2022-05-25
52+
53+diff --git a/include/saslplug.h b/include/saslplug.h
54+index ab79e68c..988010f6 100755
55+--- a/include/saslplug.h
56++++ b/include/saslplug.h
57+@@ -305,7 +305,7 @@ typedef struct sasl_client_params {
58+ int (*spare_fptr1)(void);
59+
60+ unsigned int cbindingdisp;
61+- int spare_int2;
62++ int log_level;
63+ int spare_int3;
64+
65+ /* flags field as passed to sasl_client_new */
66+diff --git a/lib/client.c b/lib/client.c
67+index 3784bb0e..443f8cde 100644
68+--- a/lib/client.c
69++++ b/lib/client.c
70+@@ -403,7 +403,7 @@ int sasl_client_new(const char *service,
71+ sasl_utils_t *utils;
72+ sasl_getopt_t *getopt;
73+ void *context;
74+- const char *mlist = NULL;
75++ const char *mlist = NULL, *log_level;
76+ int plus = 0;
77+
78+ if (_sasl_client_active == 0) return SASL_NOTINIT;
79+@@ -445,9 +445,12 @@ int sasl_client_new(const char *service,
80+ utils->conn= *pconn;
81+ conn->cparams->utils = utils;
82+
83++ log_level = NULL;
84+ if(_sasl_getcallback(*pconn, SASL_CB_GETOPT, (sasl_callback_ft *)&getopt, &context) == SASL_OK) {
85++ getopt(context, NULL, "log_level", &log_level, NULL);
86+ getopt(context, NULL, "client_mech_list", &mlist, NULL);
87+ }
88++ conn->cparams->log_level = log_level ? atoi(log_level) : SASL_LOG_ERR;
89+
90+ /* if we have a client_mech_list, create ordered list of
91+ available mechanisms for this conn */
92+diff --git a/lib/common.c b/lib/common.c
93+index d9104c89..fd8fcc3c 100644
94+--- a/lib/common.c
95++++ b/lib/common.c
96+@@ -1480,13 +1480,18 @@ static int _sasl_syslog(void *context,
97+ const char *message)
98+ {
99+ int syslog_priority;
100+- sasl_server_conn_t *sconn;
101+
102+ if (context) {
103+ if (((sasl_conn_t *)context)->type == SASL_CONN_SERVER) {
104++ sasl_server_conn_t *sconn;
105+ sconn = (sasl_server_conn_t *)context;
106+ if (sconn->sparams->log_level < priority)
107+ return SASL_OK;
108++ } else {
109++ sasl_client_conn_t *conn;
110++ conn = (sasl_client_conn_t *)context;
111++ if (conn->cparams->log_level < priority)
112++ return SASL_OK;
113+ }
114+ }
115+
116diff --git a/debian/patches/series b/debian/patches/series
117index 3f0a7da..cecd7ba 100644
118--- a/debian/patches/series
119+++ b/debian/patches/series
120@@ -18,3 +18,4 @@
121 0027-Catch-errors-from-EVP_Digest-functions.patch
122 0029-Load-OpenSSL3-legacy-provider-digestmd5.patch
123 0032-Add-with_pgsql-include-postgresql-to-include-path.patch
124+0033-honor-log_level-option-on-clients-too.patch

Subscribers

People subscribed via source and target branches