From 019d0db4dc39acdd3b07620cc1c8dffa817a3d9b Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 10 Apr 2013 11:04:37 +0200 Subject: [PATCH 1/5] ship "udevadm" bash completion --- systemd.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/systemd.spec b/systemd.spec index 7631f41..40ac3d0 100644 --- a/systemd.spec +++ b/systemd.spec @@ -295,10 +295,6 @@ rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-coredump.conf # logging yet. rm -f %{buildroot}%{_localstatedir}/log/README -# bash-completion ships udevadm too, so let's remove ours until this gets fixed -# https://bugzilla.redhat.com/show_bug.cgi?id=919246 -rm -f %{buildroot}%{_datadir}/bash-completion/completions/udevadm - %pre getent group cdrom >/dev/null 2>&1 || groupadd -r -g 11 cdrom >/dev/null 2>&1 || : getent group tape >/dev/null 2>&1 || groupadd -r -g 33 tape >/dev/null 2>&1 || : From 14f69d384b8a23969f8a176e89b7405071e914d1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Apr 2013 01:43:01 +0200 Subject: [PATCH 2/5] New upstream release --- sources | 2 +- systemd.spec | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 28cb7ae..d637d52 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3e758392ff0e9206b3f7ee252b4a654b systemd-201.tar.xz +3136c6912d3ee1f6d4deb16234783731 systemd-202.tar.xz diff --git a/systemd.spec b/systemd.spec index 40ac3d0..4a90724 100644 --- a/systemd.spec +++ b/systemd.spec @@ -12,8 +12,8 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd -Version: 201 -Release: 2%{?gitcommit:.git%{gitcommit}}%{?dist} +Version: 202 +Release: 1%{?gitcommit:.git%{gitcommit}}%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -749,6 +749,9 @@ fi %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Apr 18 2013 Lennart Poettering - 202-1 +- New upstream release + * Tue Apr 09 2013 Michal Schmidt - 201-2 - Automatically discover whether to run autoreconf and add autotools and git BuildRequires based on the presence of patches to be applied. From a72a35790db3083b794efa0303205f5cdd75ee25 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Apr 2013 14:39:16 +0200 Subject: [PATCH 3/5] systemd-202-2 - nspawn create empty /etc/resolv.conf if necessary - python wrapper: add sd_journal_add_conjunction() - fix s390 booting Resolves: rhbz#953217 --- ...e-empty-etc-resolv.conf-if-necessary.patch | 58 +++++++++ ...thon-wrap-sd_journal_add_conjunction.patch | 60 +++++++++ 0003-Update-NEWS.patch | 30 +++++ ...-Reintroduce-f_type-comparison-macro.patch | 118 ++++++++++++++++++ systemd.spec | 15 ++- 5 files changed, 279 insertions(+), 2 deletions(-) create mode 100644 0001-nspawn-create-empty-etc-resolv.conf-if-necessary.patch create mode 100644 0002-systemd-python-wrap-sd_journal_add_conjunction.patch create mode 100644 0003-Update-NEWS.patch create mode 100644 0004-Reintroduce-f_type-comparison-macro.patch diff --git a/0001-nspawn-create-empty-etc-resolv.conf-if-necessary.patch b/0001-nspawn-create-empty-etc-resolv.conf-if-necessary.patch new file mode 100644 index 0000000..6f9d99a --- /dev/null +++ b/0001-nspawn-create-empty-etc-resolv.conf-if-necessary.patch @@ -0,0 +1,58 @@ +From f333fbb1efc2f32527f78cbdb003d59bae01aa07 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Wed, 17 Apr 2013 14:13:09 -0400 +Subject: [PATCH] nspawn: create empty /etc/resolv.conf if necessary + +nspawn will overmount resolv.conf if it exists. Since e.g. +default install with yum doesn't create /etc/resolv.conf, +a container created with yum will not have network. This +seems undesirable, and since we overmount the file anyway, +let's create it too. + +Also, mounting a read-write /etc/resolv.conf in the container +is treated as a failure, since it makes it possible to +modify hosts /etc/resolv.conf from inside the container. +--- + src/nspawn/nspawn.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index f57c75f..5a43d5e 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -492,7 +492,8 @@ static int setup_timezone(const char *dest) { + } + + static int setup_resolv_conf(const char *dest) { +- char *where; ++ char _cleanup_free_ *where = NULL; ++ _cleanup_close_ int fd = -1; + + assert(dest); + +@@ -504,12 +505,18 @@ static int setup_resolv_conf(const char *dest) { + if (!where) + return log_oom(); + ++ fd = open(where, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW, 0644); ++ + /* We don't really care for the results of this really. If it + * fails, it fails, but meh... */ +- if (mount("/etc/resolv.conf", where, "bind", MS_BIND, NULL) >= 0) +- mount("/etc/resolv.conf", where, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL); +- +- free(where); ++ if (mount("/etc/resolv.conf", where, "bind", MS_BIND, NULL) < 0) ++ log_warning("Failed to bind mount /etc/resolv.conf: %m"); ++ else ++ if (mount("/etc/resolv.conf", where, "bind", ++ MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) { ++ log_error("Failed to remount /etc/resolv.conf readonly: %m"); ++ return -errno; ++ } + + return 0; + } +-- +1.8.2 + diff --git a/0002-systemd-python-wrap-sd_journal_add_conjunction.patch b/0002-systemd-python-wrap-sd_journal_add_conjunction.patch new file mode 100644 index 0000000..96ea821 --- /dev/null +++ b/0002-systemd-python-wrap-sd_journal_add_conjunction.patch @@ -0,0 +1,60 @@ +From 7f876bc4281145e6c74e98de07c6648a5b51ed90 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Thu, 18 Apr 2013 19:37:26 -0400 +Subject: [PATCH] systemd-python: wrap sd_journal_add_conjunction + +--- + src/python-systemd/_reader.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c +index 05993b3..b836597 100644 +--- a/src/python-systemd/_reader.c ++++ b/src/python-systemd/_reader.c +@@ -567,7 +567,10 @@ static PyObject* Reader_add_match(Reader *self, PyObject *args, PyObject *keywds + + PyDoc_STRVAR(Reader_add_disjunction__doc__, + "add_disjunction() -> None\n\n" +- "Inserts a logical OR between matches added before and afterwards."); ++ "Inserts a logical OR between matches added since previous\n" ++ "add_disjunction() or add_conjunction() and the next\n" ++ "add_disjunction() or add_conjunction().\n\n" ++ "See man:sd_journal_add_disjunction(3) for explanation."); + static PyObject* Reader_add_disjunction(Reader *self, PyObject *args) + { + int r; +@@ -579,6 +582,23 @@ static PyObject* Reader_add_disjunction(Reader *self, PyObject *args) + } + + ++PyDoc_STRVAR(Reader_add_conjunction__doc__, ++ "add_conjunction() -> None\n\n" ++ "Inserts a logical AND between matches added since previous\n" ++ "add_disjunction() or add_conjunction() and the next\n" ++ "add_disjunction() or add_conjunction().\n\n" ++ "See man:sd_journal_add_disjunction(3) for explanation."); ++static PyObject* Reader_add_conjunction(Reader *self, PyObject *args) ++{ ++ int r; ++ r = sd_journal_add_conjunction(self->j); ++ set_error(r, NULL, NULL); ++ if (r < 0) ++ return NULL; ++ Py_RETURN_NONE; ++} ++ ++ + PyDoc_STRVAR(Reader_flush_matches__doc__, + "flush_matches() -> None\n\n" + "Clear all current match filters."); +@@ -980,6 +1000,7 @@ static PyMethodDef Reader_methods[] = { + {"_get_monotonic", (PyCFunction) Reader_get_monotonic, METH_NOARGS, Reader_get_monotonic__doc__}, + {"add_match", (PyCFunction) Reader_add_match, METH_VARARGS|METH_KEYWORDS, Reader_add_match__doc__}, + {"add_disjunction", (PyCFunction) Reader_add_disjunction, METH_NOARGS, Reader_add_disjunction__doc__}, ++ {"add_conjunction", (PyCFunction) Reader_add_conjunction, METH_NOARGS, Reader_add_conjunction__doc__}, + {"flush_matches", (PyCFunction) Reader_flush_matches, METH_NOARGS, Reader_flush_matches__doc__}, + {"seek_head", (PyCFunction) Reader_seek_head, METH_NOARGS, Reader_seek_head__doc__}, + {"seek_tail", (PyCFunction) Reader_seek_tail, METH_NOARGS, Reader_seek_tail__doc__}, +-- +1.8.2 + diff --git a/0003-Update-NEWS.patch b/0003-Update-NEWS.patch new file mode 100644 index 0000000..5b8a85e --- /dev/null +++ b/0003-Update-NEWS.patch @@ -0,0 +1,30 @@ +From cbeabcfbc5a5fa27385e5794780e8f034e090606 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Thu, 18 Apr 2013 19:59:12 -0400 +Subject: [PATCH] Update NEWS + +--- + NEWS | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/NEWS b/NEWS +index 2b46246..afaadf3 100644 +--- a/NEWS ++++ b/NEWS +@@ -53,6 +53,13 @@ CHANGES WITH 202: + found the tool will now automatically fall back to prompting + the user. + ++ * Python systemd.journal module was updated to wrap recently ++ added functions from libsystemd-journal. The interface was ++ changed to bring the low level interface in s.j._Reader ++ closer to the C API, and the high level interface in ++ s.j.Reader was updated to wrap and convert all data about ++ an entry. ++ + Contributions from: Anatol Pomozov, Auke Kok, Harald Hoyer, + Henrik Grindal Bakken, Josh Triplett, Kay Sievers, Lennart + Poettering, Lukas Nykryn, Mantas Mikulėnas Marius Vollmer, +-- +1.8.2 + diff --git a/0004-Reintroduce-f_type-comparison-macro.patch b/0004-Reintroduce-f_type-comparison-macro.patch new file mode 100644 index 0000000..7741a67 --- /dev/null +++ b/0004-Reintroduce-f_type-comparison-macro.patch @@ -0,0 +1,118 @@ +From bdd29249a882e599e5e365536372d08dee398cd4 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 19 Apr 2013 13:44:56 +0200 +Subject: [PATCH] Reintroduce f_type comparison macro + +This reverts commit 4826f0b7b5c0aefa08b8cc7ef64d69027f84da2c. + +Because statfs.t_type can be int on some architecures, we have to cast +the const magic to the type, otherwise the compiler warns about +signed/unsigned comparison, because the magic can be 32 bit unsigned. + +statfs(2) man page is also wrong on some systems, because +f_type is not __SWORD_TYPE on some architecures. + +The following program: + +int main(int argc, char**argv) +{ + struct statfs s; + statfs(argv[1], &s); + + printf("sizeof(f_type) = %d\n", sizeof(s.f_type)); + printf("sizeof(__SWORD_TYPE) = %d\n", sizeof(__SWORD_TYPE)); + printf("sizeof(long) = %d\n", sizeof(long)); + printf("sizeof(int) = %d\n", sizeof(int)); + if (sizeof(s.f_type) == sizeof(int)) { + printf("f_type = 0x%x\n", s.f_type); + } else { + printf("f_type = 0x%lx\n", s.f_type); + } + return 0; +} + +executed on s390x gives for a btrfs: + +sizeof(f_type) = 4 +sizeof(__SWORD_TYPE) = 8 +sizeof(long) = 8 +sizeof(int) = 4 +f_type = 0x9123683e +--- + src/journal/sd-journal.c | 10 +++++----- + src/readahead/readahead-collect.c | 2 +- + src/shared/macro.h | 7 +++++++ + src/shared/util.c | 5 +++-- + 4 files changed, 16 insertions(+), 8 deletions(-) + +diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c +index e021d98..15239b5 100644 +--- a/src/journal/sd-journal.c ++++ b/src/journal/sd-journal.c +@@ -1251,11 +1251,11 @@ static void check_network(sd_journal *j, int fd) { + return; + + j->on_network = +- sfs.f_type == (__SWORD_TYPE) CIFS_MAGIC_NUMBER || +- sfs.f_type == (__SWORD_TYPE) CODA_SUPER_MAGIC || +- sfs.f_type == (__SWORD_TYPE) NCP_SUPER_MAGIC || +- sfs.f_type == (__SWORD_TYPE) NFS_SUPER_MAGIC || +- sfs.f_type == (__SWORD_TYPE) SMB_SUPER_MAGIC; ++ F_TYPE_CMP(sfs.f_type, CIFS_MAGIC_NUMBER) || ++ F_TYPE_CMP(sfs.f_type, CODA_SUPER_MAGIC) || ++ F_TYPE_CMP(sfs.f_type, NCP_SUPER_MAGIC) || ++ F_TYPE_CMP(sfs.f_type, NFS_SUPER_MAGIC) || ++ F_TYPE_CMP(sfs.f_type, SMB_SUPER_MAGIC); + } + + static int add_file(sd_journal *j, const char *prefix, const char *filename) { +diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c +index 02ecbe5..75ec5b7 100644 +--- a/src/readahead/readahead-collect.c ++++ b/src/readahead/readahead-collect.c +@@ -505,7 +505,7 @@ done: + on_ssd = fs_on_ssd(root) > 0; + log_debug("On SSD: %s", yes_no(on_ssd)); + +- on_btrfs = statfs(root, &sfs) >= 0 && sfs.f_type == (__SWORD_TYPE) BTRFS_SUPER_MAGIC; ++ on_btrfs = statfs(root, &sfs) >= 0 && F_TYPE_CMP(sfs.f_type, BTRFS_SUPER_MAGIC); + log_debug("On btrfs: %s", yes_no(on_btrfs)); + + if (asprintf(&pack_fn_new, "%s/.readahead.new", root) < 0) { +diff --git a/src/shared/macro.h b/src/shared/macro.h +index 9bf81dc..ac61b49 100644 +--- a/src/shared/macro.h ++++ b/src/shared/macro.h +@@ -264,6 +264,13 @@ do { \ + } \ + } while(false) + ++ /* Because statfs.t_type can be int on some architecures, we have to cast ++ * the const magic to the type, otherwise the compiler warns about ++ * signed/unsigned comparison, because the magic can be 32 bit unsigned. ++ */ ++#define F_TYPE_CMP(a, b) (a == (typeof(a)) b) ++ ++ + /* Returns the number of chars needed to format variables of the + * specified type as a decimal string. Adds in extra space for a + * negative '-' prefix. */ +diff --git a/src/shared/util.c b/src/shared/util.c +index 5d03272..1fc6c5a 100644 +--- a/src/shared/util.c ++++ b/src/shared/util.c +@@ -2779,8 +2779,9 @@ int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, struct + + static int is_temporary_fs(struct statfs *s) { + assert(s); +- return s->f_type == (__SWORD_TYPE) TMPFS_MAGIC || +- s->f_type == (__SWORD_TYPE) RAMFS_MAGIC; ++ return ++ F_TYPE_CMP(s->f_type, TMPFS_MAGIC) || ++ F_TYPE_CMP(s->f_type, RAMFS_MAGIC); + } + + int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev) { +-- +1.8.2 + diff --git a/systemd.spec b/systemd.spec index 4a90724..50bdfd6 100644 --- a/systemd.spec +++ b/systemd.spec @@ -13,7 +13,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 202 -Release: 1%{?gitcommit:.git%{gitcommit}}%{?dist} +Release: 2%{?gitcommit:.git%{gitcommit}}%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -34,6 +34,11 @@ Source4: listen.conf # Prevent accidental removal of the systemd package Source6: yum-protect-systemd.conf +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 + # kernel-install patch for grubby, drop if grubby is obsolete Patch1000: kernel-install-grubby.patch @@ -749,6 +754,12 @@ fi %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Apr 19 2013 Harald Hoyer 202-2 +- nspawn create empty /etc/resolv.conf if necessary +- python wrapper: add sd_journal_add_conjunction() +- fix s390 booting +Resolves: rhbz#953217 + * Thu Apr 18 2013 Lennart Poettering - 202-1 - New upstream release @@ -1393,7 +1404,7 @@ fi * Mon Jun 14 2010 Rahul Sundaram - 0-0.4.20100614git393024 - Pull the latest snapshot that fixes a segfault. Resolves rhbz#603231 -* Thu Jun 11 2010 Rahul Sundaram - 0-0.3.20100610git2f198e +* Fri Jun 11 2010 Rahul Sundaram - 0-0.3.20100610git2f198e - More minor fixes as per review * Thu Jun 10 2010 Rahul Sundaram - 0-0.2.20100610git2f198e From 18ef92b879474ad1fa9a67a9f689249de7d4dead Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Apr 2013 14:57:39 +0200 Subject: [PATCH 4/5] add udevadm bash completion --- systemd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd.spec b/systemd.spec index 50bdfd6..ccd5f99 100644 --- a/systemd.spec +++ b/systemd.spec @@ -680,7 +680,7 @@ fi %{_datadir}/bash-completion/completions/systemctl %{_datadir}/bash-completion/completions/systemd-coredumpctl %{_datadir}/bash-completion/completions/timedatectl -#%{_datadir}/bash-completion/completions/udevadm +%{_datadir}/bash-completion/completions/udevadm # Make sure we don't remove runlevel targets from F14 alpha installs, # but make sure we don't create then anew. From 5f4d81a30142de3b7ec374a7f4cd3d2153b16317 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 24 Apr 2013 14:45:56 +0200 Subject: [PATCH 5/5] 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 --- ...rator-correctly-check-return-of-strd.patch | 34 ++++++++++++++++++ ...gind-dbus-initialize-result-variable.patch | 25 +++++++++++++ ...e-ensure-that-glibc-s-assert-is-used.patch | 36 +++++++++++++++++++ ...ild-sys-prevent-library-underlinking.patch | 26 ++++++++++++++ systemd.spec | 13 ++++++- 5 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 0006-crypt-setup-generator-correctly-check-return-of-strd.patch create mode 100644 0007-logind-dbus-initialize-result-variable.patch create mode 100644 0008-nss-myhostname-ensure-that-glibc-s-assert-is-used.patch create mode 100644 0009-build-sys-prevent-library-underlinking.patch diff --git a/0006-crypt-setup-generator-correctly-check-return-of-strd.patch b/0006-crypt-setup-generator-correctly-check-return-of-strd.patch new file mode 100644 index 0000000..4d5fa76 --- /dev/null +++ b/0006-crypt-setup-generator-correctly-check-return-of-strd.patch @@ -0,0 +1,34 @@ +From 5a8e21785907df7466fef5e1cb54ce3bf99e5362 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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 + diff --git a/0007-logind-dbus-initialize-result-variable.patch b/0007-logind-dbus-initialize-result-variable.patch new file mode 100644 index 0000000..b9096d8 --- /dev/null +++ b/0007-logind-dbus-initialize-result-variable.patch @@ -0,0 +1,25 @@ +From 7f6437976d31fa772ccef9abedd152d6f5372303 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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 + diff --git a/0008-nss-myhostname-ensure-that-glibc-s-assert-is-used.patch b/0008-nss-myhostname-ensure-that-glibc-s-assert-is-used.patch new file mode 100644 index 0000000..24dd6d7 --- /dev/null +++ b/0008-nss-myhostname-ensure-that-glibc-s-assert-is-used.patch @@ -0,0 +1,36 @@ +From 1e335af70f29d1a1e9c132338aa35b8971934441 Mon Sep 17 00:00:00 2001 +From: Dave Reisner +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 + #include + #include +-#include + #include + #include + #include +@@ -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 ++ + /* 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 + diff --git a/0009-build-sys-prevent-library-underlinking.patch b/0009-build-sys-prevent-library-underlinking.patch new file mode 100644 index 0000000..924e443 --- /dev/null +++ b/0009-build-sys-prevent-library-underlinking.patch @@ -0,0 +1,26 @@ +From 9d2d0fe1e3f28a639c26b62391f79cfd1450d91b Mon Sep 17 00:00:00 2001 +From: Evangelos Foutras +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 + diff --git a/systemd.spec b/systemd.spec index ccd5f99..808b1e7 100644 --- a/systemd.spec +++ b/systemd.spec @@ -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 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 202-2 - nspawn create empty /etc/resolv.conf if necessary - python wrapper: add sd_journal_add_conjunction()