Fixes for localed, resume, headers, udev

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-05-29 23:56:33 -04:00
parent fa28e232ce
commit c2ed70225d
15 changed files with 587 additions and 42 deletions

View File

@ -1,9 +1,11 @@
From 15b947fb798cd131355ba9935802d58e92bdba6e Mon Sep 17 00:00:00 2001
From f4bb8c3a9aed5ddefb66380c818d04aa0b663693 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 4 Mar 2016 21:46:47 -0500
Subject: [PATCH] test-compress-benchmark: skip loop iteration if size is 0
Otherwise we would hit an assert in the compression code.
(cherry picked from commit 15b947fb798cd131355ba9935802d58e92bdba6e)
---
src/journal/test-compress-benchmark.c | 2 ++
1 file changed, 2 insertions(+)

View File

@ -0,0 +1,38 @@
From c411521802d5e89eeb5cdf39cdd7b9538a3a3a08 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Tue, 15 Mar 2016 12:43:33 +0100
Subject: [PATCH] time-util: fall back to CLOCK_MONOTONIC if CLOCK_BOOTTIME
unsupported
It was added in 2.6.39, and causes an assertion to fail when running in mock
hosted on 2.6.23-based RHEL-6:
Assertion 'clock_gettime(map_clock_id(clock_id), &ts) == 0' failed at systemd/src/basic/time-util.c:70, function now(). Aborting.
(cherry picked from commit 2abd5b5a49ae368b258ffc7257ab703bccda67dd)
---
src/basic/time-util.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index 510f018d9b..ec112e23e2 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -47,12 +47,15 @@ static clockid_t map_clock_id(clockid_t c) {
/* Some more exotic archs (s390, ppc, …) lack the "ALARM" flavour of the clocks. Thus, clock_gettime() will
* fail for them. Since they are essentially the same as their non-ALARM pendants (their only difference is
* when timers are set on them), let's just map them accordingly. This way, we can get the correct time even on
- * those archs. */
+ * those archs.
+ *
+ * Also, older kernels don't support CLOCK_BOOTTIME: fall back to CLOCK_MONOTONIC. */
switch (c) {
+ case CLOCK_BOOTTIME:
case CLOCK_BOOTTIME_ALARM:
- return CLOCK_BOOTTIME;
+ return clock_boottime_or_monotonic ();
case CLOCK_REALTIME_ALARM:
return CLOCK_REALTIME;

View File

@ -0,0 +1,47 @@
From b1ab67134c28ade32eab8fde37840efac789affc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 11 Mar 2016 13:41:49 -0500
Subject: [PATCH] headers: use __inline__ instead of inline
https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Alternate-Keywords.html#Alternate-Keywords
recommends __inline__ over inline in ANSI C compatible headers.
Tested with gcc-5.3 and clang-3.7.
https://bugzilla.redhat.com/show_bug.cgi?id=1316964
(cherry picked from commit 0cb27225e9c658d80538ace7a267ba0a2d2f44f2)
---
src/systemd/_sd-common.h | 2 +-
src/systemd/sd-id128.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/systemd/_sd-common.h b/src/systemd/_sd-common.h
index 2d4e1f26e1..3bb886be75 100644
--- a/src/systemd/_sd-common.h
+++ b/src/systemd/_sd-common.h
@@ -74,7 +74,7 @@
#endif
#define _SD_DEFINE_POINTER_CLEANUP_FUNC(type, func) \
- static inline void func##p(type **p) { \
+ static __inline__ void func##p(type **p) { \
if (*p) \
func(*p); \
} \
diff --git a/src/systemd/sd-id128.h b/src/systemd/sd-id128.h
index a3bf5897b8..4dff0b9b81 100644
--- a/src/systemd/sd-id128.h
+++ b/src/systemd/sd-id128.h
@@ -100,11 +100,11 @@ int sd_id128_get_boot(sd_id128_t *ret);
((x).bytes[15] & 15) >= 10 ? 'a' + ((x).bytes[15] & 15) - 10 : '0' + ((x).bytes[15] & 15), \
0 })
-_sd_pure_ static inline int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
+_sd_pure_ static __inline__ int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
return memcmp(&a, &b, 16) == 0;
}
-_sd_pure_ static inline int sd_id128_is_null(sd_id128_t a) {
+_sd_pure_ static __inline__ int sd_id128_is_null(sd_id128_t a) {
return a.qwords[0] == 0 && a.qwords[1] == 0;
}

View File

@ -0,0 +1,47 @@
From 641a7f0c61ff42ea55ad7152e7f874ea5d680a2d Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@redhat.com>
Date: Wed, 9 Mar 2016 09:29:25 -0500
Subject: [PATCH] /dev/console must be labeled with SELinux label
If the user specifies an selinux_apifs_context all content created in
the container including /dev/console should use this label.
Currently when this uses the default label it gets labeled user_devpts_t,
which would require us to write a policy allowing container processes to
manage user_devpts_t. This means that an escaped process would be allowed
to attack all users terminals as well as other container terminals. Changing
the label to match the apifs_context, means the processes would only be allowed
to manage their specific tty.
This change fixes a problem preventing RKT containers from working with systemd-nspawn.
(cherry picked from commit 68b020494d1ff085281061413d9236b5865ef238)
---
src/nspawn/nspawn.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index ef348c335b..8c06f6ef75 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -87,6 +87,7 @@
#ifdef HAVE_SECCOMP
#include "seccomp-util.h"
#endif
+#include "selinux-util.h"
#include "signal-util.h"
#include "socket-util.h"
#include "stat-util.h"
@@ -3286,6 +3287,12 @@ int main(int argc, char *argv[]) {
goto finish;
}
+ if (arg_selinux_apifs_context) {
+ r = mac_selinux_apply(console, arg_selinux_apifs_context);
+ if (r < 0)
+ goto finish;
+ }
+
if (unlockpt(master) < 0) {
r = log_error_errno(errno, "Failed to unlock tty: %m");
goto finish;

View File

@ -0,0 +1,90 @@
From 1b8bdd05fcecd83cc8c8269f06a50ced055ab864 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Tue, 1 Dec 2015 18:01:44 +0100
Subject: [PATCH] fstab-generator: fix automount option and don't start
associated mount unit at boot
Without this patch applied the mount unit with 'automount' option was still
pulled by local-fs.target and thus was activated during the boot process which
defeats the purpose of the 'automount' option:
$ grep /mnt /etc/fstab
/dev/vdb1 /mnt ext2 defaults,x-systemd.automount 0 0
$ reboot
...
$ mount | grep mnt
systemd-1 on /mnt type autofs (rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
/dev/vdb1 on /mnt type ext2 (rw,relatime)
$ systemctl status mnt.mount | grep Active
Active: active (mounted) since Thu 2016-03-03 21:36:22 CET; 42s ago
With the patch applied:
$ reboot
...
$ mount | grep mnt
systemd-1 on /mnt type autofs (rw,relatime,fd=22,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
$ systemctl status mnt.mount | grep Active
Active: inactive (dead)
$ ls /mnt
lost+found
$ systemctl status mnt.mount | grep Active
Active: active (mounted) since Thu 2016-03-03 21:47:32 CET; 4s ago
(cherry picked from commit 2b14df4a9ae92623b584e61db6b5b37accd832c1)
---
src/core/mount.c | 11 ++++++++++-
src/fstab-generator/fstab-generator.c | 4 ++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index de1075d3a0..cfe4b0f517 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -104,6 +104,14 @@ static bool mount_is_auto(const MountParameters *p) {
return !fstab_test_option(p->options, "noauto\0");
}
+static bool mount_is_automount(const MountParameters *p) {
+ assert(p);
+
+ return fstab_test_option(p->options,
+ "comment=systemd.automount\0"
+ "x-systemd.automount\0");
+}
+
static bool needs_quota(const MountParameters *p) {
assert(p);
@@ -328,7 +336,8 @@ static int mount_add_device_links(Mount *m) {
if (path_equal(m->where, "/"))
return 0;
- if (mount_is_auto(p) && UNIT(m)->manager->running_as == MANAGER_SYSTEM)
+ if (mount_is_auto(p) && !mount_is_automount(p) &&
+ UNIT(m)->manager->running_as == MANAGER_SYSTEM)
device_wants_mount = true;
r = unit_add_node_link(UNIT(m), p->what, device_wants_mount, m->from_fragment ? UNIT_BINDS_TO : UNIT_REQUIRES);
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 97a48764ae..6f576b5ecf 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -336,8 +336,8 @@ static int add_mount(
if (r < 0)
return log_error_errno(r, "Failed to write unit file %s: %m", unit);
- if (!noauto) {
- lnk = strjoin(arg_dest, "/", post, nofail || automount ? ".wants/" : ".requires/", name, NULL);
+ if (!noauto && !automount) {
+ lnk = strjoin(arg_dest, "/", post, nofail ? ".wants/" : ".requires/", name, NULL);
if (!lnk)
return log_oom();

View File

@ -0,0 +1,41 @@
From d5d78852bac634317639e87868647548c586b15a Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 5 Apr 2016 19:30:31 +0200
Subject: [PATCH] shared: add a temporary work-around for kernel header
inclusion fuck-up
See: #2864
---
src/shared/firewall-util.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c
index 0d3da2e6d2..ade2de7727 100644
--- a/src/shared/firewall-util.c
+++ b/src/shared/firewall-util.c
@@ -17,14 +17,24 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#warning "Temporary work-around for broken glibc vs. linux kernel header definitions"
+#warning "This really should be removed sooner rather than later, when this is fixed upstream"
+#define _NET_IF_H 1
+
#include <alloca.h>
#include <arpa/inet.h>
#include <endian.h>
#include <errno.h>
-#include <net/if.h>
#include <stddef.h>
#include <string.h>
#include <sys/socket.h>
+#include <net/if.h>
+#include <linux/if.h>
+#ifndef IFNAMSIZ
+#undef _NET_IF_H
+/* Let's make sure to include this one, too, if IFNAMSIZ isn't defined yet, as it is for kernels <= 4.2 */
+#include <net/if.h>
+#endif
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter/nf_nat.h>
#include <linux/netfilter/xt_addrtype.h>

View File

@ -0,0 +1,45 @@
From 8becf310b0b72abe8e0bd9707fc8064636609e30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 20 May 2016 09:12:42 -0400
Subject: [PATCH] Make the fix for net/if.h fuckup even worse (#3287)
The original conflict is fixed in the kernel in v4.6-rc7-40-g4a91cb61bb,
but now our work-around causes a compilation failure.
Keep the workaround to support 4.5 kernels for now, and layer
more ugliness on top.
Tested with:
kernel-headers-4.6.0-1.fc25.x86_64
glibc-devel-2.23.90-18.fc25.x86_64
kernel-headers-4.5.4-300.fc24.x86_64
glibc-devel-2.23.1-7.fc24.x86_64
kernel-headers-4.4.9-300.fc23.x86_64
glibc-devel-2.22-16.fc23.x86_64
kernel-headers-4.1.13-100.fc21.x86_64
glibc-devel-2.20-8.fc21.x86_64
---
src/shared/firewall-util.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c
index ade2de7727..efcde9563d 100644
--- a/src/shared/firewall-util.c
+++ b/src/shared/firewall-util.c
@@ -29,12 +29,10 @@
#include <string.h>
#include <sys/socket.h>
#include <net/if.h>
-#include <linux/if.h>
#ifndef IFNAMSIZ
-#undef _NET_IF_H
-/* Let's make sure to include this one, too, if IFNAMSIZ isn't defined yet, as it is for kernels <= 4.2 */
-#include <net/if.h>
+#define IFNAMSIZ 16
#endif
+#include <linux/if.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter/nf_nat.h>
#include <linux/netfilter/xt_addrtype.h>

View File

@ -0,0 +1,86 @@
From 313f86d98c7232354d1d877f94f263dfcbcb7dd4 Mon Sep 17 00:00:00 2001
From: James Hogarth <james.hogarth@gmail.com>
Date: Tue, 17 May 2016 11:33:33 +0100
Subject: [PATCH] check for valid resume= in order to allow a hibernate
---
src/shared/sleep-config.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 53 insertions(+), 1 deletion(-)
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index a0aef66bc8..c516a6dc8a 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -36,6 +36,10 @@
#include "sleep-config.h"
#include "string-util.h"
#include "strv.h"
+#include "proc-cmdline.h"
+#include "fstab-util.h"
+
+static char *arg_resume_dev = NULL;
#define USE(x, y) do{ (x) = (y); (y) = NULL; } while(0)
@@ -255,6 +259,51 @@ static bool enough_memory_for_hibernation(void) {
return r;
}
+static int parse_proc_cmdline_item(const char *key, const char *value) {
+
+ assert(key);
+
+ if (streq(key, "resume") && value) {
+ free(arg_resume_dev);
+ arg_resume_dev = fstab_node_to_udev_node(value);
+ if (!arg_resume_dev)
+ return log_oom();
+ }
+
+ return 0;
+
+}
+
+static bool resume_passed_to_kernel(void) {
+ int r = 0;
+ struct stat rd;
+
+ r = parse_proc_cmdline(parse_proc_cmdline_item);
+ if (r < 0) {
+ log_warning("Failed to parse kernel command line, disabling hibernation.");
+ return false;
+ }
+
+ if (arg_resume_dev == NULL) {
+ log_warning("No resume= argument specified in the kernel command line, disabling hibernation.");
+ return false;
+ }
+
+ if (stat(arg_resume_dev, &rd) < 0) {
+ log_warning("Could not stat device %s specified in resume=, disabling hibernation.",
+ arg_resume_dev);
+ return false;
+ }
+
+ if (!S_ISBLK(rd.st_mode)) {
+ log_warning("Device %s specified in resume= is not a block device, disabling hibernation.",
+ arg_resume_dev);
+ return false;
+ }
+
+ return true;
+}
+
int can_sleep(const char *verb) {
_cleanup_strv_free_ char **modes = NULL, **states = NULL;
int r;
@@ -270,5 +319,8 @@ int can_sleep(const char *verb) {
if (!can_sleep_state(states) || !can_sleep_disk(modes))
return false;
- return streq(verb, "suspend") || enough_memory_for_hibernation();
+ if (streq(verb, "suspend"))
+ return true;
+
+ return enough_memory_for_hibernation() && resume_passed_to_kernel();
}

View File

@ -0,0 +1,59 @@
From e8acb2eb8186d0c46059c0a18d328839886ccd36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 29 May 2016 23:36:44 -0400
Subject: [PATCH] keymap-util: also "convert" 'ru' to 'ru'
As discovered by Adam Williamson in
https://bugzilla.redhat.com/show_bug.cgi?id=1333998#c32, after the changes in
81fd105a5f9 we would only match compound layouts, i.e. a comma would be
required after 'ru' to match. This seems wrong, and we should match single
layouts like too. So 'ru', 'ru,us' now both match.
startswith_comma is changed to not require a comma, i.e. check that the prefix
matches until a comma or the end of the string. Note that startswith_comma is
called twice. At the first site, we check that strings are not equal
beforehand, so this change to startswith_comma has no effect. At the second
site, it does have an effect, as described above.
(This commit is cherry-picked from
https://github.com/systemd/systemd/pull/3384.)
---
src/locale/localed.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/locale/localed.c b/src/locale/localed.c
index a2fc6af4c9..62f8341cb9 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -101,9 +101,11 @@ static const char* nonempty(const char *s) {
}
static bool startswith_comma(const char *s, const char *prefix) {
- const char *t;
+ s = startswith(s, prefix);
+ if (!s)
+ return false;
- return s && (t = startswith(s, prefix)) && (*t == ',');
+ return *s == ',' || *s == '\0';
}
static void context_free_x11(Context *c) {
@@ -681,6 +683,8 @@ static int find_legacy_keymap(Context *c, char **new_keymap) {
unsigned best_matching = 0;
int r;
+ assert(c->x11_layout);
+
f = fopen(SYSTEMD_KBD_MODEL_MAP, "re");
if (!f)
return -errno;
@@ -696,7 +700,7 @@ static int find_legacy_keymap(Context *c, char **new_keymap) {
break;
/* Determine how well matching this entry is */
- if (streq_ptr(c->x11_layout, a[1]))
+ if (streq(c->x11_layout, a[1]))
/* If we got an exact match, this is best */
matching = 10;
else {

View File

@ -0,0 +1,54 @@
From b9da815deb890443e80e11c73b5084dcfb75ad4f Mon Sep 17 00:00:00 2001
From: Evgeny Vereshchagin <evvers@ya.ru>
Date: Mon, 23 May 2016 11:19:14 +0300
Subject: [PATCH] resolved: don't stop handle messages after receiving a zero
length UDP packet (#3323)
Fixes:
-bash-4.3# ss --udp -l -p
State Recv-Q Send-Q Local Address:Port Peer Address:Port
UNCONN 0 0 *:5355 *:* users:(("systemd-resolve",pid=601,fd=12))
UNCONN 0 0 :::5355 :::* users:(("systemd-resolve",pid=601,fd=14))
-bash-4.3# nping --udp -p 5355 --data-length 0 -c 1 localhost
-bash-4.3# journalctl -u systemd-resolved -b --no-hostname
...
May 21 14:59:22 systemd-resolved[601]: Event source llmnr-ipv4-udp (type io) returned error, disabling: Input/output error
...
-bash-4.3# nping --udp -p 5355 --data-length 1000 -c 1 localhost
-bash-4.3# ss --udp -l
State Recv-Q Send-Q Local Address:Port Peer Address:Port
UNCONN 2304 0 *:5355 *:*
UNCONN 0 0 :::5355 :::*
(cherry picked from commit f134289ac59560946e6559d9487e60c7690396ba)
---
src/resolve/resolved-manager.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index 7f9073448a..aeb2b78523 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -643,6 +643,8 @@ int manager_recv(Manager *m, int fd, DnsProtocol protocol, DnsPacket **ret) {
mh.msg_controllen = sizeof(control);
l = recvmsg(fd, &mh, 0);
+ if (l == 0)
+ return 0;
if (l < 0) {
if (errno == EAGAIN || errno == EINTR)
return 0;
@@ -650,9 +652,6 @@ int manager_recv(Manager *m, int fd, DnsProtocol protocol, DnsPacket **ret) {
return -errno;
}
- if (l <= 0)
- return -EIO;
-
assert(!(mh.msg_flags & MSG_CTRUNC));
assert(!(mh.msg_flags & MSG_TRUNC));

View File

@ -0,0 +1,31 @@
From 17f18346b4158098adaaf7044660124418bca8c3 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Tue, 24 May 2016 01:34:29 +0200
Subject: [PATCH] sd-device: udev-db - handle properties with empty value
(#3330)
The statemachine was unable to parse properties with empty values,
reported in [0].
When reaching the start of the KEY, we would unconditionally read
one more character before starting to look for the end-of-line.
Simply look for the end-of-line from the first character.
[0]: <https://bugzilla.redhat.com/show_bug.cgi?id=1338823>
(cherry picked from commit bee26651fc3ca2fe6bed00cb0d9c91c429e9bb57)
---
src/libsystemd/sd-device/sd-device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index 9633e46ce0..dfa1731b30 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -561,7 +561,6 @@ int device_read_uevent_file(sd_device *device) {
state = VALUE;
- break;
case VALUE:
if (strchr(NEWLINE, uevent[i])) {
uevent[i] = '\0';

View File

@ -0,0 +1,27 @@
From d43288b418d8dfc6f2e5ef7ac7048f0af593b70e Mon Sep 17 00:00:00 2001
From: Tejun Heo <htejun@fb.com>
Date: Mon, 23 May 2016 16:48:46 -0400
Subject: [PATCH] core: fix the reversed sanity check when setting
StartupBlockIOWeight over dbus
bus_cgroup_set_property() was rejecting if the input value was in range.
Reverse it.
(cherry picked from commit 6fb09269769634df1096663ce90fac47585eb63a)
---
src/core/dbus-cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
index 859d155ec1..0dbb355a8a 100644
--- a/src/core/dbus-cgroup.c
+++ b/src/core/dbus-cgroup.c
@@ -325,7 +325,7 @@ int bus_cgroup_set_property(
if (r < 0)
return r;
- if (CGROUP_BLKIO_WEIGHT_IS_OK(weight))
+ if (!CGROUP_BLKIO_WEIGHT_IS_OK(weight))
return sd_bus_error_set_errnof(error, EINVAL, "StartupBlockIOWeight value out of range");
if (mode != UNIT_CHECK) {

View File

@ -1,37 +0,0 @@
From d9e075d88e7d9d82464147d8283771d709c14ef8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 9 Feb 2016 15:13:33 -0500
Subject: [PATCH] Add a workaround for {linux/net}/if.h conflict
Include linux/if.h and make sure we don't include the other file.
https://bugzilla.redhat.com/show_bug.cgi?id=1300256
---
src/shared/firewall-util.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c
index 0d3da2e..c38f9cc 100644
--- a/src/shared/firewall-util.c
+++ b/src/shared/firewall-util.c
@@ -16,15 +16,16 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#define _NET_IF_H 1
#include <alloca.h>
#include <arpa/inet.h>
#include <endian.h>
#include <errno.h>
-#include <net/if.h>
#include <stddef.h>
#include <string.h>
#include <sys/socket.h>
+#include <linux/if.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter/nf_nat.h>
#include <linux/netfilter/xt_addrtype.h>
--
2.5.0

View File

@ -13,7 +13,7 @@
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 229
Release: 7%{?gitcommit:.git%{gitcommitshort}}%{?dist}
Release: 8%{?gitcommit:.git%{gitcommitshort}}%{?dist}
# For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager
@ -53,10 +53,20 @@ Patch0016: 0016-hashmap-use-void-and-uint8_t-for-generic-pointers.patch
Patch0017: 0017-resolved-fix-notification-iteration-logic-when-trans.patch
Patch0018: 0018-selinux-always-try-to-load-the-full-selinux-db.patch
Patch0019: 0019-selinux-use-raw-variants-of-security_compute_create-.patch
Patch0020: 0020-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
Patch0021: 0021-test-compress-benchmark-skip-loop-iteration-if-size-.patch
Patch0020: 0020-test-compress-benchmark-skip-loop-iteration-if-size-.patch
Patch0021: 0021-time-util-fall-back-to-CLOCK_MONOTONIC-if-CLOCK_BOOT.patch
Patch0022: 0022-headers-use-__inline__-instead-of-inline.patch
Patch0023: 0023-dev-console-must-be-labeled-with-SELinux-label.patch
Patch0024: 0024-fstab-generator-fix-automount-option-and-don-t-start.patch
Patch0025: 0025-shared-add-a-temporary-work-around-for-kernel-header.patch
Patch0026: 0026-Make-the-fix-for-net-if.h-fuckup-even-worse-3287.patch
Patch0027: 0027-check-for-valid-resume-in-order-to-allow-a-hibernate.patch
Patch0028: 0028-keymap-util-also-convert-ru-to-ru.patch
Patch0029: 0029-resolved-don-t-stop-handle-messages-after-receiving-.patch
Patch0030: 0030-sd-device-udev-db-handle-properties-with-empty-value.patch
Patch0031: 0031-core-fix-the-reversed-sanity-check-when-setting-Star.patch
Patch0999: 0999-Add-a-workaround-for-linux-net-if.h-conflict.patch
Patch0999: 0999-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
# kernel-install patch for grubby, drop if grubby is obsolete
Patch1000: kernel-install-grubby.patch
@ -936,6 +946,11 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd
/usr/lib/firewalld/services/*
%changelog
* Mon May 30 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@bupkis> - 229-8
- Patches for #1316964, #1317928, #1338823
- Make localed convert X11 'ru' layout to 'ru' console keymap (#1333998)
- Don't advertise hibernation if resume= is not specified (#1206936)
* Tue Mar 22 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 229-7
- Add myhostname to /etc/nsswitch.conf (#1318303)