Merge ~ahasenack/ubuntu/+source/samba:cosmic-smb-browse-nt1-1778322 into ubuntu/+source/samba:ubuntu/cosmic-devel

Proposed by Andreas Hasenack on 2019-03-29
Status: Merged
Approved by: Andreas Hasenack on 2019-04-01
Approved revision: 8a2846583c8e402ca2782c2211d435e4b4821969
Merged at revision: 8a2846583c8e402ca2782c2211d435e4b4821969
Proposed branch: ~ahasenack/ubuntu/+source/samba:cosmic-smb-browse-nt1-1778322
Merge into: ubuntu/+source/samba:ubuntu/cosmic-devel
Diff against target: 105 lines (+72/-0)
4 files modified
debian/changelog (+9/-0)
debian/libsmbclient.symbols (+1/-0)
debian/patches/add-smbc_setOptionProtocols.patch (+61/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  2019-03-29 Approve on 2019-04-01
Canonical Server Team 2019-03-29 Pending
Review via email:

Description of the change

This branch brings a new function into the cosmic samba packages. This function can be used by applications linked against libsmbclient in order to set the SMB protocol version they want to use.

gvfs in bionic and cosmic (and later) has already been changed to use this function if it is detected at build time. When that happens, this will close bug #1778322, allowing the gnome desktop (via gvfs) to display windows and samba machines from the local network.

Key points for this update:
- it's adding a new function, so the symbols file update includes the full version of the ubuntu package, and not just the upstream version
- gvfs needs to be rebuilt *after* the samba package has landed in proposed. I'm not adding any strict build-depends.
- gvfs build log *must* contain this line:
Checking for function "smbc_setOptionProtocols": YES
- gvfs, when rebuilt with this samba version, will change its depdendency on libsmbclient from a generic one to a very specific one. In bionic, for example, gvfs-backends currently depends on "libsmbclient (>= 2:4.0.3+dfsg1)". In the PPA I have for testing, that changed to "libsmbclient (>= 2:4.7.6+dfsg~ubuntu-0ubuntu2.8~)", following the symbols file change.

I tried to come up with testing instructions that didn't require the installation of ubuntu desktop, but manipulating gvfsd and gio (command-line tool) didn't work unless I also had the desktop installed. And I did start a dbus session, so I don't know what else was missing. The bug has the SRU template filled out and testing instructions.

PPA with test builds:

To post a comment you must log in.
Christian Ehrhardt  (paelzer) wrote :

The same as said on Bionic MP applies here, so copy&paste ...

We already discussed about this last week.
So a lot is already resolved in this MP (e.g. the details of the symbols handling).

I checked the formats and styles in the patch/changelog that LGTM.

Furthermore I have checked Cosmic and Bionic build logs and agree that the GVFS build detected the new feature and as well picked up the new version dependency.
No "breaks" are needed since the new SMB won't break an old GVFS and vice versa the dependency is autogenerated by make shlibs.

The test steps also seem ok for me, more complex than preferred but working.
All of the above sums up to +1

review: Approve
Andreas Hasenack (ahasenack) wrote :

Thanks, tagged and uploaded:

$ git push pkg upload/2%4.8.4+dfsg-2ubuntu2.2
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 4 threads
Compressing objects: 100% (15/15), done.
Writing objects: 100% (15/15), 2.48 KiB | 110.00 KiB/s, done.
Total 15 (delta 10), reused 0 (delta 0)
To ssh://
 * [new tag] upload/2%4.8.4+dfsg-2ubuntu2.2 -> upload/2%4.8.4+dfsg-2ubuntu2.2

$ dput ubuntu ../samba_4.8.4+dfsg-2ubuntu2.2_source.changes
Checking signature on .changes
gpg: ../samba_4.8.4+dfsg-2ubuntu2.2_source.changes: Valid signature from AC983EB5BF6BCBA9
Checking signature on .dsc
gpg: ../samba_4.8.4+dfsg-2ubuntu2.2.dsc: Valid signature from AC983EB5BF6BCBA9
Uploading to ubuntu (via ftp to
  Uploading samba_4.8.4+dfsg-2ubuntu2.2.dsc: done.
  Uploading samba_4.8.4+dfsg-2ubuntu2.2.debian.tar.xz: done.
  Uploading samba_4.8.4+dfsg-2ubuntu2.2_source.buildinfo: done.
  Uploading samba_4.8.4+dfsg-2ubuntu2.2_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 ded72ea..9f7f214 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+samba (2:4.8.4+dfsg-2ubuntu2.2) cosmic; urgency=medium
8+ * Backport function to set protocol levels (LP: #1778322):
9+ - d/p/add-smbc_setOptionProtocols.patch: add function to set protocol
10+ levels
11+ - d/libsmbclient.symbols: add smbc_setOptionProtocols
13+ -- Andreas Hasenack <> Thu, 28 Mar 2019 21:45:02 -0300
15 samba (2:4.8.4+dfsg-2ubuntu2.1) cosmic-security; urgency=medium
17 * SECURITY UPDATE: Unprivileged adding of CNAME record causing loop in AD
18diff --git a/debian/libsmbclient.symbols b/debian/libsmbclient.symbols
19index d88c61e..f539b3f 100644
20--- a/debian/libsmbclient.symbols
21+++ b/debian/libsmbclient.symbols
22@@ -160,6 +160,7 @@ libsmbclient #MINVER#
23 smbc_setOptionNoAutoAnonymousLogin@SMBCLIENT_0.1.0 2:4.0.3+dfsg1
24 smbc_setOptionOneSharePerServer@SMBCLIENT_0.1.0 2:4.0.3+dfsg1
25 smbc_setOptionOpenShareMode@SMBCLIENT_0.1.0 2:4.0.3+dfsg1
26+ smbc_setOptionProtocols@SMBCLIENT_0.3.1 2:4.8.4+dfsg-2ubuntu2.2~
27 smbc_setOptionSmbEncryptionLevel@SMBCLIENT_0.1.0 2:4.0.3+dfsg1
28 smbc_setOptionUrlEncodeReaddirEntries@SMBCLIENT_0.1.0 2:4.0.3+dfsg1
29 smbc_setOptionUseCCache@SMBCLIENT_0.1.0 2:4.0.3+dfsg1
30diff --git a/debian/patches/add-smbc_setOptionProtocols.patch b/debian/patches/add-smbc_setOptionProtocols.patch
31new file mode 100644
32index 0000000..c430b1c
33--- /dev/null
34+++ b/debian/patches/add-smbc_setOptionProtocols.patch
35@@ -0,0 +1,61 @@
36+Description: s3:libsmbclient: Add function to set protocol levels
37+Author: Andreas Schneider <>
41+Last-Update: 2019-03-28
42+--- a/source3/include/libsmbclient.h
43++++ b/source3/include/libsmbclient.h
44+@@ -775,7 +775,24 @@
45+ void
46+ smbc_setOptionUseNTHash(SMBCCTX *c, smbc_bool b);
50++ * @brief Set the 'client min protocol' and the 'client max protocol'.
51++ *
52++ * IMPORTANT: This overrrides the values 'client min protocol' and 'client max
53++ * protocol' set in the smb.conf file!
54++ *
55++ * @param[in] c The smbc context to use.
56++ *
57++ * @param[in] min_proto The minimal protocol to use or NULL for leaving it
58++ * untouched.
59++ *
60++ * @param[in] max_proto The maximum protocol to use or NULL for leaving it
61++ * untouched.
62++ *
63++ * @returns true for success, false otherwise
64++ */
66++smbc_setOptionProtocols(SMBCCTX *c, const char *min_proto, const char *max_proto);
68+ /*************************************
69+ * Getters and setters for FUNCTIONS *
70+--- a/source3/libsmb/libsmb_setget.c
71++++ b/source3/libsmb/libsmb_setget.c
72+@@ -503,6 +503,24 @@
73+ }
74+ }
77++smbc_setOptionProtocols(SMBCCTX *c,
78++ const char *min_proto,
79++ const char *max_proto)
81++ bool ok = true;
83++ if (min_proto != NULL) {
84++ ok = lp_set_cmdline("client min protocol", min_proto);
85++ }
87++ if (max_proto != NULL) {
88++ ok &= lp_set_cmdline("client max protocol", max_proto);
89++ }
91++ return ok;
94+ /** Get the function for obtaining authentication data */
95+ smbc_get_auth_data_fn
96+ smbc_getFunctionAuthData(SMBCCTX *c)
97diff --git a/debian/patches/series b/debian/patches/series
98index c653080..ed62c14 100644
99--- a/debian/patches/series
100+++ b/debian/patches/series
101@@ -14,3 +14,4 @@ CVE-2018-14629.patch
102 CVE-2018-16841-1.patch
103 CVE-2018-16841-2.patch
104 CVE-2018-16851.patch


People subscribed via source and target branches