summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch349
1 files changed, 349 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch
new file mode 100644
index 0000000000..77bb305874
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch
@@ -0,0 +1,349 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: systemd-204/src/fsck/fsck.c
5===================================================================
6--- systemd-204.orig/src/fsck/fsck.c 2013-04-02 05:48:49.000000000 -0700
7+++ systemd-204/src/fsck/fsck.c 2013-05-23 11:26:51.776345015 -0700
8@@ -37,6 +37,8 @@
9 #include "virt.h"
10 #include "fileio.h"
11
12+#include "config.h"
13+
14 static bool arg_skip = false;
15 static bool arg_force = false;
16 static bool arg_show_progress = false;
17@@ -198,9 +200,16 @@
18 char *device;
19 double p;
20 usec_t t;
21-
22+#ifdef HAVE_MSFORMAT
23 if (fscanf(f, "%i %lu %lu %ms", &pass, &cur, &max, &device) != 4)
24- break;
25+#else
26+ device = malloc(257);
27+ if (fscanf(f, "%i %lu %lu %256s", &pass, &cur, &max, device) != 4) {
28+ free(device);
29+ }
30+
31+#endif /* HAVE_MSFORMAT */
32+ break;
33
34 /* Only show one progress counter at max */
35 if (!locked) {
36Index: systemd-204/src/core/swap.c
37===================================================================
38--- systemd-204.orig/src/core/swap.c 2013-05-06 12:06:04.000000000 -0700
39+++ systemd-204/src/core/swap.c 2013-05-23 11:26:51.780345015 -0700
40@@ -41,6 +41,8 @@
41 #include "path-util.h"
42 #include "virt.h"
43
44+#include "config.h"
45+
46 static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
47 [SWAP_DEAD] = UNIT_INACTIVE,
48 [SWAP_ACTIVATING] = UNIT_ACTIVATING,
49@@ -1055,6 +1057,7 @@
50 char *dev = NULL, *d;
51 int prio = 0, k;
52
53+#ifdef HAVE_MSFORMAT
54 k = fscanf(m->proc_swaps,
55 "%ms " /* device/file */
56 "%*s " /* type of swap */
57@@ -1062,6 +1065,16 @@
58 "%*s " /* used */
59 "%i\n", /* priority */
60 &dev, &prio);
61+#else
62+ dev = malloc(257);
63+ k = fscanf(m->proc_swaps,
64+ "%256s "/* device/file */
65+ "%*s " /* type of swap */
66+ "%*s " /* swap size */
67+ "%*s " /* used */
68+ "%i\n", /* priority */
69+ dev, &prio);
70+#endif /* HAVE_MSFORMAT */
71 if (k != 2) {
72 if (k == EOF)
73 break;
74Index: systemd-204/src/core/mount-setup.c
75===================================================================
76--- systemd-204.orig/src/core/mount-setup.c 2013-04-24 06:34:38.000000000 -0700
77+++ systemd-204/src/core/mount-setup.c 2013-05-23 11:26:51.780345015 -0700
78@@ -28,6 +28,7 @@
79 #include <assert.h>
80 #include <unistd.h>
81 #include <ftw.h>
82+#include <linux/fs.h>
83
84 #include "mount-setup.h"
85 #include "dev-setup.h"
86@@ -43,6 +44,8 @@
87 #include "virt.h"
88 #include "efivars.h"
89
90+#include "config.h"
91+
92 #ifndef TTY_GID
93 #define TTY_GID 5
94 #endif
95@@ -233,9 +236,12 @@
96 for (;;) {
97 char *controller;
98 int enabled = 0;
99-
100+#ifdef HAVE_MSFORMAT
101 if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) {
102-
103+#else
104+ controller = malloc(257);
105+ if (fscanf(f, "%256s %*i %*i %i", controller, &enabled) != 2) {
106+#endif /* HAVE_MSFORMAT */
107 if (feof(f))
108 break;
109
110Index: systemd-204/src/core/mount.c
111===================================================================
112--- systemd-204.orig/src/core/mount.c 2013-05-06 12:06:04.000000000 -0700
113+++ systemd-204/src/core/mount.c 2013-05-23 11:26:51.780345015 -0700
114@@ -43,6 +43,8 @@
115 #include "exit-status.h"
116 #include "def.h"
117
118+#include "config.h"
119+
120 static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
121 [MOUNT_DEAD] = UNIT_INACTIVE,
122 [MOUNT_MOUNTING] = UNIT_ACTIVATING,
123@@ -1626,7 +1628,7 @@
124 int k;
125
126 device = path = options = options2 = fstype = d = p = o = NULL;
127-
128+#ifdef HAVE_MSFORMAT
129 if ((k = fscanf(m->proc_self_mountinfo,
130 "%*s " /* (1) mount id */
131 "%*s " /* (2) parent id */
132@@ -1645,7 +1647,31 @@
133 &fstype,
134 &device,
135 &options2)) != 5) {
136-
137+#else
138+ path = malloc(257);
139+ options = malloc(257);
140+ fstype = malloc(257);
141+ device = malloc(257);
142+ options2 = malloc(257);
143+ if ((k = fscanf(m->proc_self_mountinfo,
144+ "%*s " /* (1) mount id */
145+ "%*s " /* (2) parent id */
146+ "%*s " /* (3) major:minor */
147+ "%*s " /* (4) root */
148+ "%256s " /* (5) mount point */
149+ "%256s" /* (6) mount options */
150+ "%*[^-]" /* (7) optional fields */
151+ "- " /* (8) separator */
152+ "%256s " /* (9) file system type */
153+ "%256s" /* (10) mount source */
154+ "%256s" /* (11) mount options 2 */
155+ "%*[^\n]", /* some rubbish at the end */
156+ path,
157+ options,
158+ fstype,
159+ device,
160+ options2)) != 5) {
161+#endif /* HAVE_MSFORMAT */
162 if (k == EOF)
163 break;
164
165Index: systemd-204/src/core/umount.c
166===================================================================
167--- systemd-204.orig/src/core/umount.c 2013-04-18 08:14:11.000000000 -0700
168+++ systemd-204/src/core/umount.c 2013-05-23 11:26:51.780345015 -0700
169@@ -36,6 +36,8 @@
170 #include "util.h"
171 #include "virt.h"
172
173+#include "config.h"
174+
175 typedef struct MountPoint {
176 char *path;
177 dev_t devnum;
178@@ -75,7 +77,7 @@
179 MountPoint *m;
180
181 path = p = NULL;
182-
183+#ifdef HAVE_MSFORMAT
184 if ((k = fscanf(proc_self_mountinfo,
185 "%*s " /* (1) mount id */
186 "%*s " /* (2) parent id */
187@@ -90,6 +92,23 @@
188 "%*s" /* (11) mount options 2 */
189 "%*[^\n]", /* some rubbish at the end */
190 &path)) != 1) {
191+#else
192+ path = malloc(257);
193+ if ((k = fscanf(proc_self_mountinfo,
194+ "%*s " /* (1) mount id */
195+ "%*s " /* (2) parent id */
196+ "%*s " /* (3) major:minor */
197+ "%*s " /* (4) root */
198+ "%256s " /* (5) mount point */
199+ "%*s" /* (6) mount options */
200+ "%*[^-]" /* (7) optional fields */
201+ "- " /* (8) separator */
202+ "%*s " /* (9) file system type */
203+ "%*s" /* (10) mount source */
204+ "%*s" /* (11) mount options 2 */
205+ "%*[^\n]", /* some rubbish at the end */
206+ path)) != 1) {
207+#endif /* HAVE_MSFORMAT */
208 if (k == EOF)
209 break;
210
211@@ -151,7 +170,7 @@
212 MountPoint *swap;
213 char *dev = NULL, *d;
214 int k;
215-
216+#ifdef HAVE_MSFORMAT
217 if ((k = fscanf(proc_swaps,
218 "%ms " /* device/file */
219 "%*s " /* type of swap */
220@@ -159,7 +178,16 @@
221 "%*s " /* used */
222 "%*s\n", /* priority */
223 &dev)) != 1) {
224-
225+#else
226+ dev = malloc(257);
227+ if ((k = fscanf(proc_swaps,
228+ "%256s " /* device/file */
229+ "%*s " /* type of swap */
230+ "%*s " /* swap size */
231+ "%*s " /* used */
232+ "%*s\n", /* priority */
233+ dev)) != 1) {
234+#endif /* HAVE_MSFORMAT */
235 if (k == EOF)
236 break;
237
238Index: systemd-204/src/shared/socket-util.c
239===================================================================
240--- systemd-204.orig/src/shared/socket-util.c 2013-04-18 08:14:11.000000000 -0700
241+++ systemd-204/src/shared/socket-util.c 2013-05-23 11:30:53.528348084 -0700
242@@ -40,6 +40,8 @@
243 #include "missing.h"
244 #include "fileio.h"
245
246+#include "config.h"
247+
248 int socket_address_parse(SocketAddress *a, const char *s) {
249 int r;
250 char *e, *n;
251@@ -203,8 +205,16 @@
252 a->type = SOCK_RAW;
253
254 errno = 0;
255+#ifdef HAVE_MSFORMAT
256 if (sscanf(s, "%ms %u", &sfamily, &group) < 1)
257- return errno > 0 ? -errno : -EINVAL;
258+ return errno ? -errno : -EINVAL;
259+#else
260+ sfamily = malloc(257);
261+ if (sscanf(s, "%256s %u", sfamily, &group) < 1) {
262+ free(sfamily);
263+ return errno ? -errno : -EINVAL;
264+ }
265+#endif /* HAVE_MSFORMAT */
266
267 family = netlink_family_from_string(sfamily);
268 if (family < 0)
269Index: systemd-204/src/tmpfiles/tmpfiles.c
270===================================================================
271--- systemd-204.orig/src/tmpfiles/tmpfiles.c 2013-04-24 06:34:38.000000000 -0700
272+++ systemd-204/src/tmpfiles/tmpfiles.c 2013-05-23 11:26:51.784345016 -0700
273@@ -52,6 +52,8 @@
274 #include "conf-files.h"
275 #include "capability.h"
276
277+#include "config.h"
278+
279 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
280 * them in the file system. This is intended to be used to create
281 * properly owned directories beneath /tmp, /var/tmp, /run, which are
282@@ -1029,6 +1031,7 @@
283 if (!i)
284 return log_oom();
285
286+#ifdef HAVE_MSFORMAT
287 r = sscanf(buffer,
288 "%c %ms %ms %ms %ms %ms %n",
289 &type,
290@@ -1038,6 +1041,29 @@
291 &group,
292 &age,
293 &n);
294+#else
295+ i->path = malloc(257);
296+ mode = malloc(257);
297+ user = malloc(257);
298+ group = malloc(257);
299+ age = malloc(257);
300+ r = sscanf(buffer,
301+ "%c "
302+ "%256s "
303+ "%256s "
304+ "%256s "
305+ "%256s "
306+ "%256s "
307+ "%n",
308+ &type,
309+ i->path,
310+ mode,
311+ user,
312+ group,
313+ age,
314+ &n);
315+#endif /* HAVE_MSFORMAT */
316+
317 if (r < 2) {
318 log_error("[%s:%u] Syntax error.", fname, line);
319 return -EIO;
320Index: systemd-204/src/cryptsetup/cryptsetup-generator.c
321===================================================================
322--- systemd-204.orig/src/cryptsetup/cryptsetup-generator.c 2013-05-06 12:06:04.000000000 -0700
323+++ systemd-204/src/cryptsetup/cryptsetup-generator.c 2013-05-23 11:26:51.784345016 -0700
324@@ -31,6 +31,8 @@
325 #include "strv.h"
326 #include "fileio.h"
327
328+#include "config.h"
329+
330 static const char *arg_dest = "/tmp";
331 static bool arg_enabled = true;
332 static bool arg_read_crypttab = true;
333@@ -398,7 +400,16 @@
334 if (*l == '#' || *l == 0)
335 continue;
336
337+#ifdef HAVE_MSFORMAT
338 k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options);
339+#else
340+ name = malloc(257);
341+ device = malloc(257);
342+ password = malloc(257);
343+ options = malloc(257);
344+ k = sscanf(l, "%256s %256s %256s %256s", name, device, password, options);
345+#endif /* HAVE_MSFORMAT */
346+
347 if (k < 2 || k > 4) {
348 log_error("Failed to parse /etc/crypttab:%u, ignoring.", n);
349 r = EXIT_FAILURE;