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

Proposed by Andreas Hasenack on 2019-03-29
Status: Merged
Approved by: Andreas Hasenack on 2019-04-01
Approved revision: 8b6e3cc238c5fcdda0d179e441b1da4b7c3dc337
Merge reported by: Andreas Hasenack
Merged at revision: 8b6e3cc238c5fcdda0d179e441b1da4b7c3dc337
Proposed branch: ~ahasenack/ubuntu/+source/samba:bionic-smb-browse-nt1-1778322
Merge into: ubuntu/+source/samba:ubuntu/bionic-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: mp+365297@code.launchpad.net

Description of the change

This branch brings a new function into the bionic and 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: https://launchpad.net/~ahasenack/+archive/ubuntu/samba-browse-nt1-1778322

To post a comment you must log in.
8b6e3cc... by Andreas Hasenack on 2019-03-29

changelog

Christian Ehrhardt  (paelzer) wrote :

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.7.6+dfsg_ubuntu-0ubuntu2.8
Enumerating objects: 25, done.
Counting objects: 100% (25/25), done.
Delta compression using up to 4 threads
Compressing objects: 100% (17/17), done.
Writing objects: 100% (17/17), 2.57 KiB | 97.00 KiB/s, done.
Total 17 (delta 12), reused 0 (delta 0)
To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/samba
 * [new tag] upload/2%4.7.6+dfsg_ubuntu-0ubuntu2.8 -> upload/2%4.7.6+dfsg_ubuntu-0ubuntu2.8

$ dput ubuntu ../samba_4.7.6+dfsg~ubuntu-0ubuntu2.8_source.changes
Checking signature on .changes
gpg: ../samba_4.7.6+dfsg~ubuntu-0ubuntu2.8_source.changes: Valid signature from AC983EB5BF6BCBA9
Checking signature on .dsc
gpg: ../samba_4.7.6+dfsg~ubuntu-0ubuntu2.8.dsc: Valid signature from AC983EB5BF6BCBA9
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading samba_4.7.6+dfsg~ubuntu-0ubuntu2.8.dsc: done.
  Uploading samba_4.7.6+dfsg~ubuntu-0ubuntu2.8.debian.tar.xz: done.
  Uploading samba_4.7.6+dfsg~ubuntu-0ubuntu2.8_source.buildinfo: done.
  Uploading samba_4.7.6+dfsg~ubuntu-0ubuntu2.8_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 9f97d93..844d41a 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+samba (2:4.7.6+dfsg~ubuntu-0ubuntu2.8) bionic; urgency=medium
7+
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
12+
13+ -- Andreas Hasenack <andreas@canonical.com> Fri, 29 Mar 2019 16:45:27 -0300
14+
15 samba (2:4.7.6+dfsg~ubuntu-0ubuntu2.7) bionic; urgency=medium
16
17 * d/p/memleak-fix-13372.patch: Fix memory leak in vfswrap_getwd().
18diff --git a/debian/libsmbclient.symbols b/debian/libsmbclient.symbols
19index c0f5697..9e61517 100644
20--- a/debian/libsmbclient.symbols
21+++ b/debian/libsmbclient.symbols
22@@ -157,6 +157,7 @@ libsmbclient.so.0 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.2.3 2:4.7.6+dfsg~ubuntu-0ubuntu2.8~
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 <asn@samba.org>
38+Origin: https://github.com/samba-team/samba/commit/0dae4e2f5c65167fdb2405e232436921a0bb17e6
39+Origin: https://github.com/samba-team/samba/commit/885435e8a4dc561749b880f8be7a32041fa954ec
40+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1778322
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);
47+
48+-
49++/**
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++ */
65++smbc_bool
66++smbc_setOptionProtocols(SMBCCTX *c, const char *min_proto, const char *max_proto);
67+
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+ }
75+
76++smbc_bool
77++smbc_setOptionProtocols(SMBCCTX *c,
78++ const char *min_proto,
79++ const char *max_proto)
80++{
81++ bool ok = true;
82++
83++ if (min_proto != NULL) {
84++ ok = lp_set_cmdline("client min protocol", min_proto);
85++ }
86++
87++ if (max_proto != NULL) {
88++ ok &= lp_set_cmdline("client max protocol", max_proto);
89++ }
90++
91++ return ok;
92++}
93++
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 1b2c8ec..4ecd4fd 100644
99--- a/debian/patches/series
100+++ b/debian/patches/series
101@@ -39,3 +39,4 @@ CVE-2018-16841-2.patch
102 CVE-2018-16851.patch
103 auth-fail-eexist.diff
104 memleak-fix-13372.patch
105+add-smbc_setOptionProtocols.patch

Subscribers

People subscribed via source and target branches