Accepting request 587018 from home:fbui:systemd:Factory
- Add 0001-basic-macros-rename-noreturn-into-_noreturn_.patch This fix a build error triggered by the introduction of the new version of libgpg-error package. Patch submitted to upsream: https://github.com/systemd/systemd/pull/8456 - Turn off the IP sandboxing for systemd-logind Since v235 logind run inside an IPv4/IPv6 sandbox by default. This creates incompatibilites for systems using NIS. OBS-URL: https://build.opensuse.org/request/show/587018 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1022
This commit is contained in:
parent
76b814763c
commit
c3a3edd8e6
201
0001-basic-macros-rename-noreturn-into-_noreturn_.patch
Normal file
201
0001-basic-macros-rename-noreturn-into-_noreturn_.patch
Normal file
@ -0,0 +1,201 @@
|
||||
From 24051a17e8df0976b41180a6d50275e7edf3e461 Mon Sep 17 00:00:00 2001
|
||||
From: Franck Bui <fbui@suse.com>
|
||||
Date: Wed, 14 Mar 2018 18:00:24 +0100
|
||||
Subject: [PATCH 1/1] basic/macros: rename noreturn into _noreturn_
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
"noreturn" is reserved and can be used in other header files we include:
|
||||
|
||||
[ 16s] In file included from /usr/include/gcrypt.h:30:0,
|
||||
[ 16s] from ../src/journal/journal-file.h:26,
|
||||
[ 16s] from ../src/journal/journal-vacuum.c:31:
|
||||
[ 16s] /usr/include/gpg-error.h:1544:46: error: expected ‘,’ or ‘;’ before ‘)’ token
|
||||
[ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2);
|
||||
|
||||
Here we include grcrypt.h (which in turns include gpg-error.h) *after* we
|
||||
"noreturn" was defined in macro.h.
|
||||
---
|
||||
src/basic/log.c | 4 ++--
|
||||
src/basic/log.h | 4 ++--
|
||||
src/basic/macro.h | 19 +++++++++----------
|
||||
src/basic/process-util.c | 2 +-
|
||||
src/basic/process-util.h | 2 +-
|
||||
src/core/main.c | 4 ++--
|
||||
src/journal/test-journal-interleaving.c | 2 +-
|
||||
src/shared/pager.c | 2 +-
|
||||
src/udev/collect/collect.c | 2 +-
|
||||
9 files changed, 20 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/src/basic/log.c b/src/basic/log.c
|
||||
index 7a7f2cbec..16a2431c5 100644
|
||||
--- a/src/basic/log.c
|
||||
+++ b/src/basic/log.c
|
||||
@@ -814,7 +814,7 @@ static void log_assert(
|
||||
log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
|
||||
}
|
||||
|
||||
-noreturn void log_assert_failed_realm(
|
||||
+_noreturn_ void log_assert_failed_realm(
|
||||
LogRealm realm,
|
||||
const char *text,
|
||||
const char *file,
|
||||
@@ -826,7 +826,7 @@ noreturn void log_assert_failed_realm(
|
||||
abort();
|
||||
}
|
||||
|
||||
-noreturn void log_assert_failed_unreachable_realm(
|
||||
+_noreturn_ void log_assert_failed_unreachable_realm(
|
||||
LogRealm realm,
|
||||
const char *text,
|
||||
const char *file,
|
||||
diff --git a/src/basic/log.h b/src/basic/log.h
|
||||
index efcf0f1bf..314be128a 100644
|
||||
--- a/src/basic/log.h
|
||||
+++ b/src/basic/log.h
|
||||
@@ -186,7 +186,7 @@ int log_dump_internal(
|
||||
char *buffer);
|
||||
|
||||
/* Logging for various assertions */
|
||||
-noreturn void log_assert_failed_realm(
|
||||
+_noreturn_ void log_assert_failed_realm(
|
||||
LogRealm realm,
|
||||
const char *text,
|
||||
const char *file,
|
||||
@@ -195,7 +195,7 @@ noreturn void log_assert_failed_realm(
|
||||
#define log_assert_failed(text, ...) \
|
||||
log_assert_failed_realm(LOG_REALM, (text), __VA_ARGS__)
|
||||
|
||||
-noreturn void log_assert_failed_unreachable_realm(
|
||||
+_noreturn_ void log_assert_failed_unreachable_realm(
|
||||
LogRealm realm,
|
||||
const char *text,
|
||||
const char *file,
|
||||
diff --git a/src/basic/macro.h b/src/basic/macro.h
|
||||
index 95be63a20..d8a6432f6 100644
|
||||
--- a/src/basic/macro.h
|
||||
+++ b/src/basic/macro.h
|
||||
@@ -53,6 +53,15 @@
|
||||
#else
|
||||
#define _fallthrough_
|
||||
#endif
|
||||
+/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
|
||||
+ * compiler versions */
|
||||
+#ifndef noreturn
|
||||
+#if __STDC_VERSION__ >= 201112L
|
||||
+#define _noreturn_ _Noreturn
|
||||
+#else
|
||||
+#define _noreturn_ __attribute__((noreturn))
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
/* Temporarily disable some warnings */
|
||||
#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
|
||||
@@ -414,16 +423,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
-/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
|
||||
- * compiler versions */
|
||||
-#ifndef noreturn
|
||||
-#if __STDC_VERSION__ >= 201112L
|
||||
-#define noreturn _Noreturn
|
||||
-#else
|
||||
-#define noreturn __attribute__((noreturn))
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
|
||||
static inline void func##p(type *p) { \
|
||||
if (*p) \
|
||||
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
|
||||
index aa9846db5..e6120af5b 100644
|
||||
--- a/src/basic/process-util.c
|
||||
+++ b/src/basic/process-util.c
|
||||
@@ -987,7 +987,7 @@ bool is_main_thread(void) {
|
||||
return cached > 0;
|
||||
}
|
||||
|
||||
-noreturn void freeze(void) {
|
||||
+_noreturn_ void freeze(void) {
|
||||
|
||||
log_close();
|
||||
|
||||
diff --git a/src/basic/process-util.h b/src/basic/process-util.h
|
||||
index 93029e36e..5170adec7 100644
|
||||
--- a/src/basic/process-util.h
|
||||
+++ b/src/basic/process-util.h
|
||||
@@ -91,7 +91,7 @@ int pid_from_same_root_fs(pid_t pid);
|
||||
|
||||
bool is_main_thread(void);
|
||||
|
||||
-noreturn void freeze(void);
|
||||
+_noreturn_ void freeze(void);
|
||||
|
||||
bool oom_score_adjust_is_valid(int oa);
|
||||
|
||||
diff --git a/src/core/main.c b/src/core/main.c
|
||||
index 076846a41..4b2d14923 100644
|
||||
--- a/src/core/main.c
|
||||
+++ b/src/core/main.c
|
||||
@@ -141,7 +141,7 @@ static uint64_t arg_default_tasks_max = UINT64_MAX;
|
||||
static sd_id128_t arg_machine_id = {};
|
||||
static EmergencyAction arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
|
||||
|
||||
-noreturn static void freeze_or_reboot(void) {
|
||||
+_noreturn_ static void freeze_or_reboot(void) {
|
||||
|
||||
if (arg_crash_reboot) {
|
||||
log_notice("Rebooting in 10s...");
|
||||
@@ -156,7 +156,7 @@ noreturn static void freeze_or_reboot(void) {
|
||||
freeze();
|
||||
}
|
||||
|
||||
-noreturn static void crash(int sig) {
|
||||
+_noreturn_ static void crash(int sig) {
|
||||
struct sigaction sa;
|
||||
pid_t pid;
|
||||
|
||||
diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c
|
||||
index 5a88b2774..d87bdbdd3 100644
|
||||
--- a/src/journal/test-journal-interleaving.c
|
||||
+++ b/src/journal/test-journal-interleaving.c
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
static bool arg_keep = false;
|
||||
|
||||
-noreturn static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
|
||||
+_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
|
||||
log_internal(LOG_CRIT, error, file, line, func,
|
||||
"'%s' failed at %s:%u (%s): %m", text, file, line, func);
|
||||
abort();
|
||||
diff --git a/src/shared/pager.c b/src/shared/pager.c
|
||||
index 75db3c985..681af9c40 100644
|
||||
--- a/src/shared/pager.c
|
||||
+++ b/src/shared/pager.c
|
||||
@@ -47,7 +47,7 @@ static int stored_stderr = -1;
|
||||
static bool stdout_redirected = false;
|
||||
static bool stderr_redirected = false;
|
||||
|
||||
-noreturn static void pager_fallback(void) {
|
||||
+_noreturn_ static void pager_fallback(void) {
|
||||
int r;
|
||||
|
||||
r = copy_bytes(STDIN_FILENO, STDOUT_FILENO, (uint64_t) -1, 0);
|
||||
diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
|
||||
index 2821640e9..c8fa47b3d 100644
|
||||
--- a/src/udev/collect/collect.c
|
||||
+++ b/src/udev/collect/collect.c
|
||||
@@ -58,7 +58,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node)
|
||||
return container_of(node, struct _mate, node);
|
||||
}
|
||||
|
||||
-noreturn static void sig_alrm(int signo)
|
||||
+_noreturn_ static void sig_alrm(int signo)
|
||||
{
|
||||
exit(4);
|
||||
}
|
||||
--
|
||||
2.16.2
|
||||
|
@ -1,3 +1,20 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 14 17:22:53 UTC 2018 - fbui@suse.com
|
||||
|
||||
- Add 0001-basic-macros-rename-noreturn-into-_noreturn_.patch
|
||||
|
||||
This fix a build error triggered by the introduction of the new
|
||||
version of libgpg-error package. Patch submitted to upsream:
|
||||
https://github.com/systemd/systemd/pull/8456
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 14 08:05:07 UTC 2018 - fbui@suse.com
|
||||
|
||||
- Turn off the IP sandboxing for systemd-logind
|
||||
|
||||
Since v235 logind run inside an IPv4/IPv6 sandbox by default. This
|
||||
creates incompatibilites for systems using NIS.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 13 15:07:41 UTC 2018 - fbui@suse.com
|
||||
|
||||
|
@ -162,6 +162,7 @@ Source1002: 99-wakeup-from-idle.rules
|
||||
# broken in upstream and need an urgent fix. Even in this case, the
|
||||
# patches are temporary and should be removed as soon as a fix is
|
||||
# merged by upstream.
|
||||
Patch1: 0001-basic-macros-rename-noreturn-into-_noreturn_.patch
|
||||
|
||||
%description
|
||||
Systemd is a system and service manager, compatible with SysV and LSB
|
||||
@ -420,7 +421,7 @@ Some systemd commands offer bash completion, but it is an optional dependency.
|
||||
|
||||
%prep
|
||||
%setup -q -n systemd-%{version}
|
||||
# %autopatch -p1
|
||||
%autopatch -p1
|
||||
|
||||
%build
|
||||
opensuse_ntp_servers=({0..3}.opensuse.pool.ntp.org)
|
||||
@ -606,13 +607,24 @@ mkdir -p %{buildroot}%{_systemd_system_env_generator_dir}
|
||||
mkdir -p %{buildroot}%{_systemd_user_env_generator_dir}
|
||||
|
||||
# create drop-in to prevent tty1 to be cleared (bnc#804158)
|
||||
mkdir -p %{buildroot}%{_unitdir}/getty@tty1.service.d/
|
||||
cat << EOF > %{buildroot}%{_unitdir}/getty@tty1.service.d/noclear.conf
|
||||
mkdir %{buildroot}%{_unitdir}/getty@tty1.service.d/
|
||||
cat >%{buildroot}%{_unitdir}/getty@tty1.service.d/noclear.conf <<EOF
|
||||
[Service]
|
||||
# ensure tty1 isn't cleared (bnc#804158)
|
||||
TTYVTDisallocate=no
|
||||
EOF
|
||||
|
||||
# Since v235 logind run inside an IPv4/IPv6 sandbox by default. This
|
||||
# creates incompatibilites for systems using NIS. Turn off the IP
|
||||
# sandboxing.
|
||||
mkdir %{buildroot}%{_unitdir}/systemd-logind.service.d/
|
||||
cat >%{buildroot}%{_unitdir}/systemd-logind.service.d/nosandbox.conf <<EOF
|
||||
# To keep backward compat with system using NIS, turn off the
|
||||
# IP sandboxing.
|
||||
[Service]
|
||||
IPAddressDeny=
|
||||
EOF
|
||||
|
||||
# ensure after.local wrapper is called
|
||||
install -m 644 %{S:11} %{buildroot}%{_unitdir}/
|
||||
ln -s ../after-local.service %{buildroot}%{_unitdir}/multi-user.target.wants/
|
||||
@ -960,8 +972,10 @@ fi
|
||||
%dir %{_ntpunitsdir}
|
||||
%dir %{_prefix}/lib/systemd/system-shutdown/
|
||||
%dir %{_prefix}/lib/systemd/system-sleep/
|
||||
%dir %{_unitdir}/getty@tty1.service.d
|
||||
%{_unitdir}/getty@tty1.service.d/noclear.conf
|
||||
|
||||
%{_unitdir}/getty@tty1.service.d
|
||||
%{_unitdir}/systemd-logind.service.d
|
||||
|
||||
/%{_lib}/security/pam_systemd.so
|
||||
|
||||
%if %{with gnuefi}
|
||||
|
@ -1,3 +1,20 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 14 17:22:53 UTC 2018 - fbui@suse.com
|
||||
|
||||
- Add 0001-basic-macros-rename-noreturn-into-_noreturn_.patch
|
||||
|
||||
This fix a build error triggered by the introduction of the new
|
||||
version of libgpg-error package. Patch submitted to upsream:
|
||||
https://github.com/systemd/systemd/pull/8456
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 14 08:05:07 UTC 2018 - fbui@suse.com
|
||||
|
||||
- Turn off the IP sandboxing for systemd-logind
|
||||
|
||||
Since v235 logind run inside an IPv4/IPv6 sandbox by default. This
|
||||
creates incompatibilites for systems using NIS.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 13 15:07:41 UTC 2018 - fbui@suse.com
|
||||
|
||||
|
24
systemd.spec
24
systemd.spec
@ -160,6 +160,7 @@ Source1002: 99-wakeup-from-idle.rules
|
||||
# broken in upstream and need an urgent fix. Even in this case, the
|
||||
# patches are temporary and should be removed as soon as a fix is
|
||||
# merged by upstream.
|
||||
Patch1: 0001-basic-macros-rename-noreturn-into-_noreturn_.patch
|
||||
|
||||
%description
|
||||
Systemd is a system and service manager, compatible with SysV and LSB
|
||||
@ -418,7 +419,7 @@ Some systemd commands offer bash completion, but it is an optional dependency.
|
||||
|
||||
%prep
|
||||
%setup -q -n systemd-%{version}
|
||||
# %autopatch -p1
|
||||
%autopatch -p1
|
||||
|
||||
%build
|
||||
opensuse_ntp_servers=({0..3}.opensuse.pool.ntp.org)
|
||||
@ -604,13 +605,24 @@ mkdir -p %{buildroot}%{_systemd_system_env_generator_dir}
|
||||
mkdir -p %{buildroot}%{_systemd_user_env_generator_dir}
|
||||
|
||||
# create drop-in to prevent tty1 to be cleared (bnc#804158)
|
||||
mkdir -p %{buildroot}%{_unitdir}/getty@tty1.service.d/
|
||||
cat << EOF > %{buildroot}%{_unitdir}/getty@tty1.service.d/noclear.conf
|
||||
mkdir %{buildroot}%{_unitdir}/getty@tty1.service.d/
|
||||
cat >%{buildroot}%{_unitdir}/getty@tty1.service.d/noclear.conf <<EOF
|
||||
[Service]
|
||||
# ensure tty1 isn't cleared (bnc#804158)
|
||||
TTYVTDisallocate=no
|
||||
EOF
|
||||
|
||||
# Since v235 logind run inside an IPv4/IPv6 sandbox by default. This
|
||||
# creates incompatibilites for systems using NIS. Turn off the IP
|
||||
# sandboxing.
|
||||
mkdir %{buildroot}%{_unitdir}/systemd-logind.service.d/
|
||||
cat >%{buildroot}%{_unitdir}/systemd-logind.service.d/nosandbox.conf <<EOF
|
||||
# To keep backward compat with system using NIS, turn off the
|
||||
# IP sandboxing.
|
||||
[Service]
|
||||
IPAddressDeny=
|
||||
EOF
|
||||
|
||||
# ensure after.local wrapper is called
|
||||
install -m 644 %{S:11} %{buildroot}%{_unitdir}/
|
||||
ln -s ../after-local.service %{buildroot}%{_unitdir}/multi-user.target.wants/
|
||||
@ -958,8 +970,10 @@ fi
|
||||
%dir %{_ntpunitsdir}
|
||||
%dir %{_prefix}/lib/systemd/system-shutdown/
|
||||
%dir %{_prefix}/lib/systemd/system-sleep/
|
||||
%dir %{_unitdir}/getty@tty1.service.d
|
||||
%{_unitdir}/getty@tty1.service.d/noclear.conf
|
||||
|
||||
%{_unitdir}/getty@tty1.service.d
|
||||
%{_unitdir}/systemd-logind.service.d
|
||||
|
||||
/%{_lib}/security/pam_systemd.so
|
||||
|
||||
%if %{with gnuefi}
|
||||
|
Loading…
Reference in New Issue
Block a user