systemd-202-3

- fix ENOENT for getaddrinfo
Resolves: rhbz#954012 rhbz#956035
- crypt-setup-generator: correctly check return of strdup
- logind-dbus: initialize result variable
- prevent library underlinking
This commit is contained in:
Harald Hoyer 2013-04-24 14:45:56 +02:00
parent 18ef92b879
commit 5f4d81a301
5 changed files with 133 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 5a8e21785907df7466fef5e1cb54ce3bf99e5362 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Fri, 19 Apr 2013 13:58:57 +0200
Subject: [PATCH] crypt-setup-generator: correctly check return of strdup
---
src/cryptsetup/cryptsetup-generator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index ac0ed58..b31329d 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -302,7 +302,7 @@ static int parse_proc_cmdline(char ***arg_proc_cmdline_disks, char **arg_proc_cm
} else if (startswith(word, "luks.key=")) {
*arg_proc_cmdline_keyfile = strdup(word + 9);
- if (! arg_proc_cmdline_keyfile)
+ if (!*arg_proc_cmdline_keyfile)
return log_oom();
} else if (startswith(word, "rd.luks.key=")) {
@@ -311,7 +311,7 @@ static int parse_proc_cmdline(char ***arg_proc_cmdline_disks, char **arg_proc_cm
if (*arg_proc_cmdline_keyfile)
free(*arg_proc_cmdline_keyfile);
*arg_proc_cmdline_keyfile = strdup(word + 12);
- if (!arg_proc_cmdline_keyfile)
+ if (!*arg_proc_cmdline_keyfile)
return log_oom();
}
--
1.8.2.1

View File

@ -0,0 +1,25 @@
From 7f6437976d31fa772ccef9abedd152d6f5372303 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Fri, 19 Apr 2013 13:58:58 +0200
Subject: [PATCH] logind-dbus: initialize result variable
---
src/login/logind-dbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 4176902..05cc1fd 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1137,7 +1137,7 @@ static int bus_manager_can_shutdown_or_sleep(
DBusMessage **_reply) {
bool multiple_sessions, challenge, blocked, b;
- const char *result;
+ const char *result = NULL;
_cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
int r;
unsigned long ul;
--
1.8.2.1

View File

@ -0,0 +1,36 @@
From 1e335af70f29d1a1e9c132338aa35b8971934441 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Fri, 19 Apr 2013 16:31:25 -0400
Subject: [PATCH] nss-myhostname: ensure that glibc's assert is used
---
src/nss-myhostname/nss-myhostname.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index 16ccb3e..8699098 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -25,7 +25,6 @@
#include <netdb.h>
#include <errno.h>
#include <string.h>
-#include <assert.h>
#include <unistd.h>
#include <net/if.h>
#include <stdlib.h>
@@ -35,6 +34,11 @@
#include "macro.h"
#include "util.h"
+/* Ensure that glibc's assert is used. We cannot use assert from macro.h, as
+ * libnss_myhostname will be linked into arbitrary programs which will, in turn
+ * attempt to write to the journal via log_dispatch() */
+#include <assert.h>
+
/* We use 127.0.0.2 as IPv4 address. This has the advantage over
* 127.0.0.1 that it can be translated back to the local hostname. For
* IPv6 we use ::1 which unfortunately will not translate back to the
--
1.8.2.1

View File

@ -0,0 +1,26 @@
From 9d2d0fe1e3f28a639c26b62391f79cfd1450d91b Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Sat, 20 Apr 2013 00:17:08 +0300
Subject: [PATCH] build-sys: prevent library underlinking
Underlinking can cause subtle bugs like the recent issue with
libnss_myhostname (which was fixed in commit 1e335af7).
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 5173783..ce02ff6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,6 +144,7 @@ AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
-Wl,--as-needed \
+ -Wl,--no-undefined \
-Wl,--gc-sections \
-Wl,-z,relro \
-Wl,-z,now])
--
1.8.2.1

View File

@ -13,7 +13,7 @@
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 202
Release: 2%{?gitcommit:.git%{gitcommit}}%{?dist}
Release: 3%{?gitcommit:.git%{gitcommit}}%{?dist}
# For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager
@ -38,6 +38,10 @@ Patch1: 0001-nspawn-create-empty-etc-resolv.conf-if-necessary.patch
Patch2: 0002-systemd-python-wrap-sd_journal_add_conjunction.patch
Patch3: 0003-Update-NEWS.patch
Patch4: 0004-Reintroduce-f_type-comparison-macro.patch
Patch6: 0006-crypt-setup-generator-correctly-check-return-of-strd.patch
Patch7: 0007-logind-dbus-initialize-result-variable.patch
Patch8: 0008-nss-myhostname-ensure-that-glibc-s-assert-is-used.patch
Patch9: 0009-build-sys-prevent-library-underlinking.patch
# kernel-install patch for grubby, drop if grubby is obsolete
Patch1000: kernel-install-grubby.patch
@ -754,6 +758,13 @@ fi
%{_libdir}/pkgconfig/gudev-1.0*
%changelog
* Wed Apr 24 2013 Harald Hoyer <harald@redhat.com> 202-3
- fix ENOENT for getaddrinfo
Resolves: rhbz#954012 rhbz#956035
- crypt-setup-generator: correctly check return of strdup
- logind-dbus: initialize result variable
- prevent library underlinking
* Fri Apr 19 2013 Harald Hoyer <harald@redhat.com> 202-2
- nspawn create empty /etc/resolv.conf if necessary
- python wrapper: add sd_journal_add_conjunction()