Merge ~ahasenack/ubuntu/+source/sssd:eoan-offline-reboot into ubuntu/+source/sssd:ubuntu/eoan-devel

Proposed by Andreas Hasenack
Status: Merged
Approved by: Andreas Hasenack
Approved revision: b4460f38d45a622080b477028241d24d10d5ac93
Merged at revision: b4460f38d45a622080b477028241d24d10d5ac93
Proposed branch: ~ahasenack/ubuntu/+source/sssd:eoan-offline-reboot
Merge into: ubuntu/+source/sssd:ubuntu/eoan-devel
Diff against target: 188 lines (+160/-0)
4 files modified
debian/changelog (+9/-0)
debian/patches/monitor-propagate-error.patch (+45/-0)
debian/patches/monitor-resolve-symlinks.patch (+104/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Canonical Server Pending
Review via email: mp+384137@code.launchpad.net

Description of the change

Fix https://bugs.launchpad.net/bugs/1723350

The linked bug has the SRU template filled out with two test cases, corresponding to the two patches being added via this branch.

Focal and later have this fixed already.

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

Changelog:
- [√] changelog entry correct version and targeted codename
- [√] changelog entries correct
- [√] update-maintainer has been run

New Delta:
- [√] new patches are good or match what was proposed upstream
- [√] new patches correctly included in debian/patches/series?
- [√] new patches have correct DEP3 metadata

Build/Test:
- [√] build is ok

LGTM +1
Excessive (good) SRU details on the bug

Revision history for this message
Christian Ehrhardt  (paelzer) :
review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Thanks, tagging and uploading b4460f38d45a622080b477028241d24d10d5ac93

$ git push pkg upload/2.2.0-4ubuntu1.1
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 4 threads
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 3.44 KiB | 587.00 KiB/s, done.
Total 12 (delta 7), reused 0 (delta 0)
remote: Checking connectivity: 12, done.
To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/sssd
 * [new tag] upload/2.2.0-4ubuntu1.1 -> upload/2.2.0-4ubuntu1.1

$ dput ubuntu ../sssd_2.2.0-4ubuntu1.1_source.changes
Checking signature on .changes
gpg: ../sssd_2.2.0-4ubuntu1.1_source.changes: Valid signature from AC983EB5BF6BCBA9
Checking signature on .dsc
gpg: ../sssd_2.2.0-4ubuntu1.1.dsc: Valid signature from AC983EB5BF6BCBA9
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading sssd_2.2.0-4ubuntu1.1.dsc: done.
  Uploading sssd_2.2.0-4ubuntu1.1.diff.gz: done.
  Uploading sssd_2.2.0-4ubuntu1.1_source.buildinfo: done.
  Uploading sssd_2.2.0-4ubuntu1.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 6e636f7..189489e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+sssd (2.2.0-4ubuntu1.1) eoan; urgency=medium
7+
8+ * d/p/monitor-propagate-error.patch,
9+ d/p/monitor-resolve-symlinks.patch: correctly monitor the
10+ /etc/resolv.conf symlink when its target changes from a non-existent
11+ file to one that exists (LP: #1723350)
12+
13+ -- Andreas Hasenack <andreas@canonical.com> Tue, 12 May 2020 16:58:37 -0300
14+
15 sssd (2.2.0-4ubuntu1) eoan; urgency=medium
16
17 * Merge with Debian unstable. Remaining changes:
18diff --git a/debian/patches/monitor-propagate-error.patch b/debian/patches/monitor-propagate-error.patch
19new file mode 100644
20index 0000000..89db976
21--- /dev/null
22+++ b/debian/patches/monitor-propagate-error.patch
23@@ -0,0 +1,45 @@
24+commit d20a7f9d5e56d1e9af273d97c7fd42fe8b2eda47
25+Author: Samuel Cabrero <scabrero@suse.de>
26+Date: Fri Jul 19 12:19:53 2019 +0200
27+
28+ MONITOR: Propagate error when resolv.conf does not exists in polling mode
29+
30+ Return ENOENT when resolv.conf is missing after falling back to polling
31+ mode. This way missing_resolv_conf will schedule a timer to check again
32+ after some seconds.
33+
34+ Signed-off-by: Samuel Cabrero <scabrero@suse.de>
35+
36+ Reviewed-by: Sumit Bose <sbose@redhat.com>
37+
38+ Ubuntu note: part of https://github.com/SSSD/sssd/pull/864
39+
40+Origin: upstream, https://github.com/SSSD/sssd/commit/d20a7f9d5e56d1e9af273d97c7fd42fe8b2eda47
41+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/sssd/+bug/1723350
42+Last-Update: 2020-05-18
43+diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
44+index d3f8c8878..0b000a66f 100644
45+--- a/src/monitor/monitor.c
46++++ b/src/monitor/monitor.c
47+@@ -1789,18 +1789,14 @@ static errno_t monitor_config_file_fallback(TALLOC_CTX *parent_ctx,
48+ if (ret < 0) {
49+ err = errno;
50+ if (err == ENOENT) {
51+- DEBUG(SSSDBG_MINOR_FAILURE,
52+- "file [%s] is missing. Will not update online status "
53+- "based on watching the file\n", file);
54+- return EOK;
55+-
56++ DEBUG(SSSDBG_CRIT_FAILURE,
57++ "file [%s] is missing. Will try again later.\n", file);
58+ } else {
59+ DEBUG(SSSDBG_FATAL_FAILURE,
60+ "Could not stat file [%s]. Error [%d:%s]\n",
61+ file, err, strerror(err));
62+-
63+- return err;
64+ }
65++ return err;
66+ }
67+
68+ file_ctx->poll_check.parent_ctx = parent_ctx;
69diff --git a/debian/patches/monitor-resolve-symlinks.patch b/debian/patches/monitor-resolve-symlinks.patch
70new file mode 100644
71index 0000000..089274c
72--- /dev/null
73+++ b/debian/patches/monitor-resolve-symlinks.patch
74@@ -0,0 +1,104 @@
75+commit d57c67e4efc64a16b874b46eb9670fdc9c73a39f
76+Author: Samuel Cabrero <scabrero@suse.de>
77+Date: Fri Jul 19 12:24:56 2019 +0200
78+
79+ MONITOR: Resolve symlinks setting the inotify watchers
80+
81+ If resolv.conf is a symlink and sssd starts before getting an address
82+ from dhcp the data provider will remain forever offline, as the watched
83+ parent directory is the directory containing the symlink.
84+
85+ Signed-off-by: Samuel Cabrero <scabrero@suse.de>
86+
87+ Reviewed-by: Sumit Bose <sbose@redhat.com>
88+ Ubuntu note: part of https://github.com/SSSD/sssd/pull/864
89+
90+Origin: upstream, https://github.com/SSSD/sssd/commit/d57c67e4efc64a16b874b46eb9670fdc9c73a39f
91+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/sssd/+bug/1723350
92+Last-Update: 2020-05-18
93+diff --git a/src/util/inotify.c b/src/util/inotify.c
94+index 2e2dc1a6e..ffc15ad4d 100644
95+--- a/src/util/inotify.c
96++++ b/src/util/inotify.c
97+@@ -381,13 +381,62 @@ static int watch_ctx_destructor(void *memptr)
98+ return 0;
99+ }
100+
101++static errno_t resolve_filename(struct snotify_ctx *snctx,
102++ const char *filename,
103++ char *resolved,
104++ size_t resolved_size)
105++{
106++ /* NOTE: The code below relies in the GNU extensions for realpath,
107++ * which will store in 'resolved' the prefix of 'filename' that does
108++ * not exists if realpath call fails and errno is set to ENOENT */
109++ if (realpath(filename, resolved) == NULL) {
110++ char fcopy[PATH_MAX + 1];
111++ char *p;
112++ struct stat st;
113++
114++ if (errno != ENOENT) {
115++ return errno;
116++ }
117++
118++ /* Check if the unique missing component is the basename. The
119++ * dirname must exist to be notified watching the parent dir. */
120++ strncpy(fcopy, filename, sizeof(fcopy) - 1);
121++ fcopy[PATH_MAX] = '\0';
122++
123++ p = dirname(fcopy);
124++ if (p == NULL) {
125++ return EIO;
126++ }
127++
128++ if (stat(p, &st) == -1) {
129++ return errno;
130++ }
131++
132++ /* The basedir exist, check the caller requested to watch it.
133++ * Otherwise return error as never will be notified. */
134++
135++ if ((snctx->snotify_flags & SNOTIFY_WATCH_DIR) == 0) {
136++ return ENOENT;
137++ }
138++ }
139++
140++ return EOK;
141++}
142++
143+ static errno_t copy_filenames(struct snotify_ctx *snctx,
144+ const char *filename)
145+ {
146+ char *p;
147++ char resolved[PATH_MAX + 1];
148+ char fcopy[PATH_MAX + 1];
149++ errno_t ret;
150++
151++ ret = resolve_filename(snctx, filename, resolved, sizeof(resolved));
152++ if (ret != EOK) {
153++ return ret;
154++ }
155+
156+- strncpy(fcopy, filename, sizeof(fcopy) - 1);
157++ strncpy(fcopy, resolved, sizeof(fcopy) - 1);
158+ fcopy[PATH_MAX] = '\0';
159+
160+ p = dirname(fcopy);
161+@@ -400,7 +449,7 @@ static errno_t copy_filenames(struct snotify_ctx *snctx,
162+ return ENOMEM;
163+ }
164+
165+- strncpy(fcopy, filename, sizeof(fcopy) - 1);
166++ strncpy(fcopy, resolved, sizeof(fcopy) - 1);
167+ fcopy[PATH_MAX] = '\0';
168+
169+ p = basename(fcopy);
170+@@ -413,7 +462,7 @@ static errno_t copy_filenames(struct snotify_ctx *snctx,
171+ return ENOMEM;
172+ }
173+
174+- snctx->filename = talloc_strdup(snctx, filename);
175++ snctx->filename = talloc_strdup(snctx, resolved);
176+ if (snctx->filename == NULL) {
177+ return ENOMEM;
178+ }
179diff --git a/debian/patches/series b/debian/patches/series
180index 8bfa56a..a54e2d3 100644
181--- a/debian/patches/series
182+++ b/debian/patches/series
183@@ -3,3 +3,5 @@ fix-whitespace-test.diff
184 default-to-socket-activated-services.diff
185 python3-shebang.patch
186 restart-on-failure.patch
187+monitor-resolve-symlinks.patch
188+monitor-propagate-error.patch

Subscribers

People subscribed via source and target branches