Hello community, here is the log from the commit of package systemd for openSUSE:Factory checked in at 2017-07-17 09:07:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/systemd (Old) and /work/SRC/openSUSE:Factory/.systemd.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "systemd" Mon Jul 17 09:07:55 2017 rev:256 rq:508718 version:233 Changes: -------- --- /work/SRC/openSUSE:Factory/systemd/systemd-mini.changes 2017-06-20 09:33:37.457349207 +0200 +++ /work/SRC/openSUSE:Factory/.systemd.new/systemd-mini.changes 2017-07-17 09:07:57.490979694 +0200 @@ -1,0 +2,66 @@ +Fri Jul 7 08:19:41 UTC 2017 - jeng...@inai.de + +- Edit pkgconfig(liblz4) dependency: liblz4 now uses 1.x *again* + +------------------------------------------------------------------- +Thu Jul 6 14:12:34 UTC 2017 - f...@suse.com + +- Added 0001-core-disable-session-keyring-per-system-sevice-entir.patch (bnc#1045886) + + Temporary patch to disable the session keyring stuff as it's + currently broken and may introduce some security holes. + +------------------------------------------------------------------- +Thu Jul 6 12:57:06 UTC 2017 - f...@suse.com + +- Import commit 21827ea0875ff197e16e72003b2bfaa1c6e8daad + + 1ad06735f core: fail when syntactically invalid values for User=/Group= fields are detected (bsc#1047023) + d563972e2 timesyncd: don't use compiled-in list if FallbackNTP has been configured explicitly + f4e0c16f5 gpt-auto-generator: fix the handling of the value returned by fstab_has_fstype() in add_swap() (#6280) + e1345aac5 fix add_esp() in the gpt-auto-generator.c (#6251) + c591ece9a automount: don't lstat(2) upon umount request (#6086) (bsc#1040968) + 643ab2eea gpt-auto-generator: disable gpt auto logic for swaps if at least one is defined in fstab + f07d2022f fstab-util: introduce fstab_has_fstype() helper + bf735bb35 fstab-util: don't eat up errors in fstab_is_mount_point() + a4b40fbed resolved: simplify alloc size calculation (bsc#1045290 CVE-2017-9445) + 8b960bec0 only check signature job error if signature job exists (#6118) (boo#1043758) + 1418bfb5b job: Ensure JobRunningTimeoutSec= survives serialization (#6128) (bsc#1004995) + 19b6d5f08 udev: turn off -Wformat-nonliteral for one safe case + 717ace439 udev: net_id add support for platform bus (ACPI, mostly arm64) devices (#5933) + a3bf2e6b5 core/mount: pass "-c" flag to /bin/umount (#6093) + +------------------------------------------------------------------- +Wed Jul 5 07:15:17 UTC 2017 - f...@suse.com + +- Add minimal support for boot.d/* scripts in systemd-sysv-convert (boo#1046750) + + While at it, the handling of the symlink priorities is also removed + since it doesn't appear to be used at all. + +------------------------------------------------------------------- +Thu Jun 22 15:24:22 UTC 2017 - f...@suse.com + +- Don't try to restart networkd/resolved if they're disabled (boo#1045521) + + "systemctl try-restart/preset" wants the unit files exist. + +------------------------------------------------------------------- +Thu Jun 22 13:50:46 UTC 2017 - f...@suse.com + +- Stop shipping /usr/lib/sysusers.d/basic.conf (bsc#1006978) + + Ok looks like the previous change was the right thing to do and we + continue to follow this path by relying on the new user/group scheme + + Therefore the basic system user/group are now managed and created by + system-sysusers and udev also relies on this for the groups it uses + in its rule files. + + Ideally we should have listed all of the groups in the deps (with + "Requires: group(disk)" but the list of the groups is rather long + and the risk for those groups to be re-organized is probably low, so + currently we simply use "Requires: system-group-hardware" as a + shortcut. + +------------------------------------------------------------------- @@ -14 +80 @@ - "Requires: group(post)". + "Requires: group(lock)". systemd.changes: same change New: ---- 0001-core-disable-session-keyring-per-system-sevice-entir.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ systemd-mini.spec ++++++ --- /var/tmp/diff_new_pack.RlXZN8/_old 2017-07-17 09:07:58.494838312 +0200 +++ /var/tmp/diff_new_pack.RlXZN8/_new 2017-07-17 09:07:58.498837748 +0200 @@ -83,7 +83,7 @@ BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(blkid) >= 2.26 BuildRequires: pkgconfig(libkmod) >= 15 -BuildRequires: pkgconfig(liblz4) >= 125 +BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(libpci) >= 3 BuildRequires: pkgconfig(libpcre) @@ -155,6 +155,14 @@ Source1065: udev-remount-tmpfs +# Patches listed in here are really special cases. Normally all +# changes must go to upstream first and then are cherry-picked in the +# SUSE git repository. But in very few cases, some stuff might be +# 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-core-disable-session-keyring-per-system-sevice-entir.patch + %description Systemd is a system and service manager, compatible with SysV and LSB init scripts for Linux. systemd provides aggressive parallelization @@ -225,9 +233,8 @@ License: GPL-2.0 Group: System/Kernel Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html +Requires: system-group-hardware Requires(pre): /usr/bin/stat -Requires(pre): /usr/sbin/groupadd -Requires(pre): /usr/bin/getent Requires(post): sed Requires(post): /usr/bin/systemctl @@ -399,6 +406,7 @@ %prep %setup -q -n systemd-%{version} +%autopatch -p1 # only needed for bootstrap %if 0%{?bootstrap} @@ -530,6 +538,10 @@ # aaa_base (in procps for now) rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-default.conf +# The definition of the basic users/groups are defined by system-user +# on SUSE (bsc#1006978). +rm -f %{buildroot}%{_prefix}/lib/sysusers.d/basic.conf + # Remove README file in init.d as (SUSE) rpm requires executable files # in this directory... oh well. rm -f %{buildroot}/etc/init.d/README @@ -682,10 +694,14 @@ # unit. systemctl preset remote-fs.target || : systemctl preset getty@.service || : + systemctl preset systemd-timesyncd.service || : +%if %{with networkd} systemctl preset systemd-networkd.service || : systemctl preset systemd-networkd-wait-online.service || : - systemctl preset systemd-timesyncd.service || : +%endif +%if %{with resolved} systemctl preset systemd-resolved.service || : +%endif fi >/dev/null # since v207 /etc/sysctl.conf is no longer parsed, however @@ -745,9 +761,13 @@ %systemd_postun # Avoid restarting logind until fixed upstream (issue #1163) %systemd_postun_with_restart systemd-journald.service -%systemd_postun_with_restart systemd-networkd.service %systemd_postun_with_restart systemd-timesyncd.service +%if %{with networkd} +%systemd_postun_with_restart systemd-networkd.service +%endif +%if %{with resolved} %systemd_postun_with_restart systemd-resolved.service +%endif %pretrans -n udev%{?mini} -p <lua> if posix.stat("/lib/udev") and not posix.stat("/usr/lib/udev") then @@ -773,12 +793,6 @@ echo "COMPAT_SYMLINK_GENERATION=2">/usr/lib/udev/compat-symlink-generation fi -# Create "tape"/"input" group which is referenced by some udev rules -# that we're shipping. FIXME: maybe we should consider using -# "sysusers_create basic.conf" instead ? -getent group tape >/dev/null || groupadd -r tape || : -getent group input >/dev/null || groupadd -r input || : - %post -n udev%{?mini} %udev_hwdb_update ++++++ systemd.spec ++++++ --- /var/tmp/diff_new_pack.RlXZN8/_old 2017-07-17 09:07:58.538832115 +0200 +++ /var/tmp/diff_new_pack.RlXZN8/_new 2017-07-17 09:07:58.546830989 +0200 @@ -81,7 +81,7 @@ BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(blkid) >= 2.26 BuildRequires: pkgconfig(libkmod) >= 15 -BuildRequires: pkgconfig(liblz4) >= 125 +BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(libpci) >= 3 BuildRequires: pkgconfig(libpcre) @@ -153,6 +153,14 @@ Source1065: udev-remount-tmpfs +# Patches listed in here are really special cases. Normally all +# changes must go to upstream first and then are cherry-picked in the +# SUSE git repository. But in very few cases, some stuff might be +# 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-core-disable-session-keyring-per-system-sevice-entir.patch + %description Systemd is a system and service manager, compatible with SysV and LSB init scripts for Linux. systemd provides aggressive parallelization @@ -223,9 +231,8 @@ License: GPL-2.0 Group: System/Kernel Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html +Requires: system-group-hardware Requires(pre): /usr/bin/stat -Requires(pre): /usr/sbin/groupadd -Requires(pre): /usr/bin/getent Requires(post): sed Requires(post): /usr/bin/systemctl @@ -397,6 +404,7 @@ %prep %setup -q -n systemd-%{version} +%autopatch -p1 # only needed for bootstrap %if 0%{?bootstrap} @@ -528,6 +536,10 @@ # aaa_base (in procps for now) rm -f %{buildroot}%{_prefix}/lib/sysctl.d/50-default.conf +# The definition of the basic users/groups are defined by system-user +# on SUSE (bsc#1006978). +rm -f %{buildroot}%{_prefix}/lib/sysusers.d/basic.conf + # Remove README file in init.d as (SUSE) rpm requires executable files # in this directory... oh well. rm -f %{buildroot}/etc/init.d/README @@ -680,10 +692,14 @@ # unit. systemctl preset remote-fs.target || : systemctl preset getty@.service || : + systemctl preset systemd-timesyncd.service || : +%if %{with networkd} systemctl preset systemd-networkd.service || : systemctl preset systemd-networkd-wait-online.service || : - systemctl preset systemd-timesyncd.service || : +%endif +%if %{with resolved} systemctl preset systemd-resolved.service || : +%endif fi >/dev/null # since v207 /etc/sysctl.conf is no longer parsed, however @@ -743,9 +759,13 @@ %systemd_postun # Avoid restarting logind until fixed upstream (issue #1163) %systemd_postun_with_restart systemd-journald.service -%systemd_postun_with_restart systemd-networkd.service %systemd_postun_with_restart systemd-timesyncd.service +%if %{with networkd} +%systemd_postun_with_restart systemd-networkd.service +%endif +%if %{with resolved} %systemd_postun_with_restart systemd-resolved.service +%endif %pretrans -n udev%{?mini} -p <lua> if posix.stat("/lib/udev") and not posix.stat("/usr/lib/udev") then @@ -771,12 +791,6 @@ echo "COMPAT_SYMLINK_GENERATION=2">/usr/lib/udev/compat-symlink-generation fi -# Create "tape"/"input" group which is referenced by some udev rules -# that we're shipping. FIXME: maybe we should consider using -# "sysusers_create basic.conf" instead ? -getent group tape >/dev/null || groupadd -r tape || : -getent group input >/dev/null || groupadd -r input || : - %post -n udev%{?mini} %udev_hwdb_update ++++++ 0001-core-disable-session-keyring-per-system-sevice-entir.patch ++++++ >From 30cceac444bcc67896611154b051669225abaa93 Mon Sep 17 00:00:00 2001 From: Franck Bui <f...@suse.com> Date: Thu, 6 Jul 2017 15:48:10 +0200 Subject: [PATCH] core: disable session keyring per system sevice entirely for now It seems that this stuff needs more thoughts... See also: https://github.com/systemd/systemd/pull/6286 [fbui: fixes bnc#1045886] --- src/core/service.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/service.c b/src/core/service.c index 74054887b..874f2be93 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1341,7 +1341,6 @@ static int service_spawn( } else path = UNIT(s)->cgroup_path; - exec_params.flags |= MANAGER_IS_SYSTEM(UNIT(s)->manager) ? EXEC_NEW_KEYRING : 0; exec_params.argv = c->argv; exec_params.environment = final_env; exec_params.fds = fds; -- 2.13.1 ++++++ systemd-233.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/core/automount.c new/systemd-233/src/core/automount.c --- old/systemd-233/src/core/automount.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/core/automount.c 2017-07-06 14:54:34.000000000 +0200 @@ -970,7 +970,6 @@ _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; union autofs_v5_packet_union packet; Automount *a = AUTOMOUNT(userdata); - struct stat st; Unit *trigger; int r; @@ -1032,18 +1031,6 @@ goto fail; } - /* Before we do anything, let's see if somebody is playing games with us? */ - if (lstat(a->where, &st) < 0) { - log_unit_warning_errno(UNIT(a), errno, "Failed to stat automount point: %m"); - goto fail; - } - - if (!S_ISDIR(st.st_mode) || st.st_dev == a->dev_id) { - log_unit_info(UNIT(a), "Automount point already unmounted?"); - automount_send_ready(a, a->expire_tokens, 0); - break; - } - trigger = UNIT_TRIGGER(UNIT(a)); if (!trigger) { log_unit_error(UNIT(a), "Unit to trigger vanished."); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/core/job.c new/systemd-233/src/core/job.c --- old/systemd-233/src/core/job.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/core/job.c 2017-07-06 14:54:34.000000000 +0200 @@ -952,14 +952,15 @@ int job_start_timer(Job *j, bool job_running) { int r; - usec_t run_begin, timeout_time, old_timeout_time; + usec_t timeout_time, old_timeout_time; if (job_running) { + j->begin_running_usec = now(CLOCK_MONOTONIC); + if (j->unit->job_running_timeout == USEC_INFINITY) return 0; - run_begin = now(CLOCK_MONOTONIC); - timeout_time = usec_add(run_begin, j->unit->job_running_timeout); + timeout_time = usec_add(j->begin_running_usec, j->unit->job_running_timeout); if (j->timer_event_source) { /* Update only if JobRunningTimeoutSec= results in earlier timeout */ @@ -1051,6 +1052,8 @@ if (j->begin_usec > 0) fprintf(f, "job-begin="USEC_FMT"\n", j->begin_usec); + if (j->begin_running_usec > 0) + fprintf(f, "job-begin-running="USEC_FMT"\n", j->begin_running_usec); bus_track_serialize(j->bus_track, f, "subscribed"); @@ -1148,6 +1151,14 @@ else j->begin_usec = ull; + } else if (streq(l, "job-begin-running")) { + unsigned long long ull; + + if (sscanf(v, "%llu", &ull) != 1) + log_debug("Failed to parse job-begin-running value %s", v); + else + j->begin_running_usec = ull; + } else if (streq(l, "subscribed")) { if (strv_extend(&j->deserialized_clients, v) < 0) @@ -1158,6 +1169,7 @@ int job_coldplug(Job *j) { int r; + usec_t timeout_time = USEC_INFINITY; assert(j); @@ -1171,7 +1183,18 @@ /* Maybe due to new dependencies we don't actually need this job anymore? */ job_add_to_gc_queue(j); - if (j->begin_usec == 0 || j->unit->job_timeout == USEC_INFINITY) + /* Create timer only when job began or began running and the respective timeout is finite. + * Follow logic of job_start_timer() if both timeouts are finite */ + if (j->begin_usec == 0) + return 0; + + if (j->unit->job_timeout != USEC_INFINITY) + timeout_time = usec_add(j->begin_usec, j->unit->job_timeout); + + if (j->begin_running_usec > 0 && j->unit->job_running_timeout != USEC_INFINITY) + timeout_time = MIN(timeout_time, usec_add(j->begin_running_usec, j->unit->job_running_timeout)); + + if (timeout_time == USEC_INFINITY) return 0; j->timer_event_source = sd_event_source_unref(j->timer_event_source); @@ -1180,7 +1203,7 @@ j->manager->event, &j->timer_event_source, CLOCK_MONOTONIC, - usec_add(j->begin_usec, j->unit->job_timeout), 0, + timeout_time, 0, job_dispatch_timer, j); if (r < 0) log_debug_errno(r, "Failed to restart timeout for job: %m"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/core/job.h new/systemd-233/src/core/job.h --- old/systemd-233/src/core/job.h 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/core/job.h 2017-07-06 14:54:34.000000000 +0200 @@ -150,6 +150,7 @@ sd_event_source *timer_event_source; usec_t begin_usec; + usec_t begin_running_usec; /* * This tracks where to send signals, and also which clients diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/core/load-fragment.c new/systemd-233/src/core/load-fragment.c --- old/systemd-233/src/core/load-fragment.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/core/load-fragment.c 2017-07-06 14:54:34.000000000 +0200 @@ -1908,13 +1908,13 @@ r = unit_full_printf(u, rvalue, &k); if (r < 0) { - log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s, ignoring: %m", rvalue); - return 0; + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s: %m", rvalue); + return r; } if (!valid_user_group_name_or_id(k)) { - log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID, ignoring: %s", k); - return 0; + log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID: %s", k); + return -EINVAL; } n = k; @@ -1972,19 +1972,19 @@ if (r == -ENOMEM) return log_oom(); if (r < 0) { - log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue); - break; + log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax: %s", rvalue); + return r; } r = unit_full_printf(u, word, &k); if (r < 0) { - log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s, ignoring: %m", word); - continue; + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers in %s: %m", word); + return r; } if (!valid_user_group_name_or_id(k)) { - log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID, ignoring: %s", k); - continue; + log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid user/group name or numeric ID: %s", k); + return -EINVAL; } r = strv_push(users, k); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/core/mount.c new/systemd-233/src/core/mount.c --- old/systemd-233/src/core/mount.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/core/mount.c 2017-07-06 14:54:34.000000000 +0200 @@ -886,7 +886,7 @@ m->control_command_id = MOUNT_EXEC_UNMOUNT; m->control_command = m->exec_command + MOUNT_EXEC_UNMOUNT; - r = exec_command_set(m->control_command, UMOUNT_PATH, m->where, NULL); + r = exec_command_set(m->control_command, UMOUNT_PATH, m->where, "-c", NULL); if (r >= 0 && m->lazy_unmount) r = exec_command_append(m->control_command, "-l", NULL); if (r >= 0 && m->force_unmount) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/gpt-auto-generator/gpt-auto-generator.c new/systemd-233/src/gpt-auto-generator/gpt-auto-generator.c --- old/systemd-233/src/gpt-auto-generator/gpt-auto-generator.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/gpt-auto-generator/gpt-auto-generator.c 2017-07-06 14:54:34.000000000 +0200 @@ -305,6 +305,15 @@ assert(path); + /* Disable the swap auto logic if at least one swap is defined in /etc/fstab, see #6192. */ + r = fstab_has_fstype("swap"); + if (r < 0) + return log_error_errno(r, "Failed to parse fstab: %m"); + if (r > 0) { + log_debug("swap specified in fstab, ignoring."); + return 0; + } + log_debug("Adding swap: %s", path); r = unit_name_from_path(path, ".swap", &name); @@ -435,7 +444,10 @@ esp = access("/efi/", F_OK) >= 0 ? "/efi" : "/boot"; /* We create an .automount which is not overridden by the .mount from the fstab generator. */ - if (fstab_is_mount_point(esp)) { + r = fstab_is_mount_point(esp); + if (r < 0) + return log_error_errno(r, "Failed to parse fstab: %m"); + if (r > 0) { log_debug("%s specified in fstab, ignoring.", esp); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/import/pull-raw.c new/systemd-233/src/import/pull-raw.c --- old/systemd-233/src/import/pull-raw.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/import/pull-raw.c 2017-07-06 14:54:34.000000000 +0200 @@ -498,7 +498,7 @@ if (!raw_pull_is_done(i)) return; - if (i->checksum_job->style == VERIFICATION_PER_DIRECTORY && i->signature_job->error != 0) { + if (i->signature_job && i->checksum_job->style == VERIFICATION_PER_DIRECTORY && i->signature_job->error != 0) { log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)"); r = i->signature_job->error; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/import/pull-tar.c new/systemd-233/src/import/pull-tar.c --- old/systemd-233/src/import/pull-tar.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/import/pull-tar.c 2017-07-06 14:54:34.000000000 +0200 @@ -315,7 +315,7 @@ if (!tar_pull_is_done(i)) return; - if (i->checksum_job->style == VERIFICATION_PER_DIRECTORY && i->signature_job->error != 0) { + if (i->signature_job && i->checksum_job->style == VERIFICATION_PER_DIRECTORY && i->signature_job->error != 0) { log_error_errno(j->error, "Failed to retrieve signature file, cannot verify. (Try --verify=no?)"); r = i->signature_job->error; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/resolve/resolved-dns-packet.c new/systemd-233/src/resolve/resolved-dns-packet.c --- old/systemd-233/src/resolve/resolved-dns-packet.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/resolve/resolved-dns-packet.c 2017-07-06 14:54:34.000000000 +0200 @@ -47,13 +47,7 @@ assert(ret); - if (mtu <= UDP_PACKET_HEADER_SIZE) - a = DNS_PACKET_SIZE_START; - else - a = mtu - UDP_PACKET_HEADER_SIZE; - - if (a < DNS_PACKET_HEADER_SIZE) - a = DNS_PACKET_HEADER_SIZE; + a = MAX(mtu, DNS_PACKET_HEADER_SIZE); /* round up to next page size */ a = PAGE_ALIGN(ALIGN(sizeof(DnsPacket)) + a) - ALIGN(sizeof(DnsPacket)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/resolve/resolved-dns-packet.h new/systemd-233/src/resolve/resolved-dns-packet.h --- old/systemd-233/src/resolve/resolved-dns-packet.h 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/resolve/resolved-dns-packet.h 2017-07-06 14:54:34.000000000 +0200 @@ -66,8 +66,6 @@ /* With EDNS0 we can use larger packets, default to 4096, which is what is commonly used */ #define DNS_PACKET_UNICAST_SIZE_LARGE_MAX 4096 -#define DNS_PACKET_SIZE_START 512 - struct DnsPacket { int n_ref; DnsProtocol protocol; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/shared/fstab-util.c new/systemd-233/src/shared/fstab-util.c --- old/systemd-233/src/shared/fstab-util.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/shared/fstab-util.c 2017-07-06 14:54:34.000000000 +0200 @@ -34,18 +34,43 @@ #include "strv.h" #include "util.h" -bool fstab_is_mount_point(const char *mount) { +int fstab_has_fstype(const char *fstype) { _cleanup_endmntent_ FILE *f = NULL; struct mntent *m; f = setmntent("/etc/fstab", "re"); if (!f) - return false; + return errno == ENOENT ? false : -errno; - while ((m = getmntent(f))) - if (path_equal(m->mnt_dir, mount)) + for (;;) { + errno = 0; + m = getmntent(f); + if (!m) + return errno != 0 ? -errno : false; + + if (streq(m->mnt_type, fstype)) return true; + } + return false; +} + +int fstab_is_mount_point(const char *mount) { + _cleanup_endmntent_ FILE *f = NULL; + struct mntent *m; + f = setmntent("/etc/fstab", "re"); + if (!f) + return errno == ENOENT ? false : -errno; + + for (;;) { + errno = 0; + m = getmntent(f); + if (!m) + return errno != 0 ? -errno : false; + + if (path_equal(m->mnt_dir, mount)) + return true; + } return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/shared/fstab-util.h new/systemd-233/src/shared/fstab-util.h --- old/systemd-233/src/shared/fstab-util.h 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/shared/fstab-util.h 2017-07-06 14:54:34.000000000 +0200 @@ -24,7 +24,8 @@ #include "macro.h" -bool fstab_is_mount_point(const char *mount); +int fstab_is_mount_point(const char *mount); +int fstab_has_fstype(const char *fstype); int fstab_filter_options(const char *opts, const char *names, const char **namefound, char **value, char **filtered); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/timesync/timesyncd-conf.c new/systemd-233/src/timesync/timesyncd-conf.c --- old/systemd-233/src/timesync/timesyncd-conf.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/timesync/timesyncd-conf.c 2017-07-06 14:54:34.000000000 +0200 @@ -34,6 +34,9 @@ first = type == SERVER_FALLBACK ? m->fallback_servers : m->system_servers; + if (type == SERVER_FALLBACK) + m->have_fallbacks = true; + for (;;) { _cleanup_free_ char *word = NULL; bool found = false; @@ -63,6 +66,13 @@ return 0; } +int manager_parse_fallback_string(Manager *m, const char *string) { + if (m->have_fallbacks) + return 0; + + return manager_parse_server_string(m, SERVER_FALLBACK, string); +} + int config_parse_servers( const char *unit, const char *filename, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/timesync/timesyncd-conf.h new/systemd-233/src/timesync/timesyncd-conf.h --- old/systemd-233/src/timesync/timesyncd-conf.h 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/timesync/timesyncd-conf.h 2017-07-06 14:54:34.000000000 +0200 @@ -29,3 +29,4 @@ int config_parse_servers(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); int manager_parse_config_file(Manager *m); +int manager_parse_fallback_string(Manager *m, const char *string); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/timesync/timesyncd-manager.c new/systemd-233/src/timesync/timesyncd-manager.c --- old/systemd-233/src/timesync/timesyncd-manager.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/timesync/timesyncd-manager.c 2017-07-06 14:54:34.000000000 +0200 @@ -1124,10 +1124,6 @@ RATELIMIT_INIT(m->ratelimit, RATELIMIT_INTERVAL_USEC, RATELIMIT_BURST); - r = manager_parse_server_string(m, SERVER_FALLBACK, NTP_SERVERS); - if (r < 0) - return r; - r = sd_event_default(&m->event); if (r < 0) return r; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/timesync/timesyncd-manager.h new/systemd-233/src/timesync/timesyncd-manager.h --- old/systemd-233/src/timesync/timesyncd-manager.h 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/timesync/timesyncd-manager.h 2017-07-06 14:54:34.000000000 +0200 @@ -38,6 +38,8 @@ LIST_HEAD(ServerName, link_servers); LIST_HEAD(ServerName, fallback_servers); + bool have_fallbacks:1; + RateLimit ratelimit; bool exhausted_servers; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/timesync/timesyncd.c new/systemd-233/src/timesync/timesyncd.c --- old/systemd-233/src/timesync/timesyncd.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/timesync/timesyncd.c 2017-07-06 14:54:34.000000000 +0200 @@ -132,6 +132,8 @@ if (r < 0) log_warning_errno(r, "Failed to parse configuration file: %m"); + assert_se(manager_parse_fallback_string(m, NTP_SERVERS) >= 0); + log_debug("systemd-timesyncd running as pid " PID_FMT, getpid()); sd_notify(false, "READY=1\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/systemd-233/src/udev/udev-builtin-net_id.c new/systemd-233/src/udev/udev-builtin-net_id.c --- old/systemd-233/src/udev/udev-builtin-net_id.c 2017-06-06 13:55:50.000000000 +0200 +++ new/systemd-233/src/udev/udev-builtin-net_id.c 2017-07-06 14:54:34.000000000 +0200 @@ -46,6 +46,7 @@ * [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>] * — USB port number chain * v<slot> - VIO slot number (IBM PowerVM) + * a<vendor><model>i<instance> — Platform bus ACPI instance id * * All multi-function PCI devices will carry the [f<function>] number in the * device name, including the function 0 device. @@ -124,6 +125,7 @@ NET_VIRTIO, NET_CCW, NET_VIO, + NET_PLATFORM, }; struct netnames { @@ -142,6 +144,7 @@ char bcma_core[IFNAMSIZ]; char ccw_busid[IFNAMSIZ]; char vio_slot[IFNAMSIZ]; + char platform_path[IFNAMSIZ]; }; /* skip intermediate virtio devices */ @@ -349,6 +352,60 @@ return 0; } +#define _PLATFORM_TEST "/sys/devices/platform/vvvvPPPP" +#define _PLATFORM_PATTERN4 "/sys/devices/platform/%4s%4x:%2x/net/eth%u" +#define _PLATFORM_PATTERN3 "/sys/devices/platform/%3s%4x:%2x/net/eth%u" + +static int names_platform(struct udev_device *dev, struct netnames *names, bool test) { + struct udev_device *parent; + char vendor[5]; + unsigned model, instance, ethid; + const char *syspath, *pattern, *validchars; + + /* check if our direct parent is a platform device with no other bus in-between */ + parent = udev_device_get_parent(dev); + if (!parent) + return -ENOENT; + + if (!streq_ptr("platform", udev_device_get_subsystem(parent))) + return -ENOENT; + + syspath = udev_device_get_syspath(dev); + + /* syspath is too short, to have a valid ACPI instance */ + if (strlen(syspath) < sizeof _PLATFORM_TEST) + return -EINVAL; + + /* Vendor ID can be either PNP ID (3 chars A-Z) or ACPI ID (4 chars A-Z and numerals) */ + if (syspath[sizeof _PLATFORM_TEST - 1] == ':') { + pattern = _PLATFORM_PATTERN4; + validchars = UPPERCASE_LETTERS DIGITS; + } else { + pattern = _PLATFORM_PATTERN3; + validchars = UPPERCASE_LETTERS; + } + + /* Platform devices are named after ACPI table match, and instance id + * eg. "/sys/devices/platform/HISI00C2:00"); + * The Vendor (3 or 4 char), followed by hexdecimal model number : instance id. + */ + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + if (sscanf(syspath, pattern, vendor, &model, &instance, ðid) != 4) + return -EINVAL; +#pragma GCC diagnostic pop + + if (!in_charset(vendor, validchars)) + return -ENOENT; + + ascii_strlower(vendor); + + xsprintf(names->platform_path, "a%s%xi%u", vendor, model, instance); + names->type = NET_PLATFORM; + return 0; +} + static int names_pci(struct udev_device *dev, struct netnames *names) { struct udev_device *parent; @@ -631,6 +688,16 @@ goto out; } + /* get ACPI path names for ARM64 platform devices */ + err = names_platform(dev, &names, test); + if (err >= 0 && names.type == NET_PLATFORM) { + char str[IFNAMSIZ]; + + if (snprintf(str, sizeof(str), "%s%s", prefix, names.platform_path) < (int)sizeof(str)) + udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str); + goto out; + } + /* get PCI based path names, we compose only PCI based paths */ err = names_pci(dev, &names); if (err < 0) ++++++ systemd-sysv-convert ++++++ --- /var/tmp/diff_new_pack.RlXZN8/_old 2017-07-17 09:08:01.730382620 +0200 +++ /var/tmp/diff_new_pack.RlXZN8/_new 2017-07-17 09:08:01.734382057 +0200 @@ -5,8 +5,7 @@ exit 1 fi -declare -A results_runlevel -declare -A results_priority +declare -A results_target usage() { cat << EOF @@ -33,75 +32,30 @@ } find_service() { - local service - local runlevel - declare -i priority + local service=$1 + local rcnd=$2 - service=$1 - runlevel=$2 - priority=-1 - - for l in $(ls /etc/rc.d/rc$runlevel.d/) ; do - initscript=$(basename $l) - if [ ${initscript:0:1} != "S" -o ${initscript:3} != "$service" ]; then - continue - fi - if [ ${initscript:1:2} -ge 0 -a ${initscript:1:2} -le 99 -a ${initscript:1:2} -ge $priority ]; then - if [ ${initscript:1:1} == 0 ]; then - priority=${initscript:2:1} - else - priority=${initscript:1:2} - fi - fi - done - if [ $priority -ge 0 ]; then - return $priority - fi - return 255 + case $rcnd in + boot.d) [ -L /etc/rc.d/$rcnd/S??boot.$service ] ;; + *) [ -L /etc/rc.d/$rcnd/S??$service ] + esac } lookup_database() { - local services + local services=$@ local service - local service_file local runlevel local priority - local -i k - declare -a parsed - services=$@ - k=0 - results_runlevel=() - results_priority=() - - while read line ; do - k+=1 - parsed=($line) - service=${parsed[0]} - runlevel=${parsed[1]} - priority=${parsed[2]} - if [ $runlevel -lt 2 -o $runlevel -gt 5 ]; then - echo "Runlevel out of bounds in database line $k. Ignoring" >/dev/stderr - continue - fi - if [ $priority -lt 0 -o $priority -gt 99 ]; then - echo "Priority out of bounds in database line $k. Ignoring" >/dev/stderr - continue - fi - - declare -i found - found=0 + # 'priority' field is not used but is kept for backward compat + # reason. + while read service runlevel priority; do for s in $services ; do if [ $s == $service ]; then - found=1 - continue + results_target[$service]+=" runlevel$runlevel.target" + break fi done - if [ $found -eq 0 ]; then - continue - fi - results_runlevel[$service]+=" $runlevel" - results_priority[$service]+=" $priority" done < /var/lib/systemd/sysv-convert/database } @@ -114,16 +68,19 @@ --save) shift for service in $@ ; do - if [ ! -r "/etc/init.d/$service" ]; then + if [ ! -r /etc/init.d/$service ] && [ ! -r /etc/init.d/boot.$service ]; then echo "SysV service $service does not exist, skipping" continue fi - for runlevel in 2 3 4 5; do - find_service $service $runlevel - priority=$? - if [ $priority -lt 255 ]; then - echo "$service $runlevel $priority" >>/var/lib/systemd/sysv-convert/database - fi + for rcnd in rc2.d rc3.d rc4.d rc5.d boot.d; do + case $rcnd in + rc*.d) runlevel=${rcnd:2:1} ;; + boot.d) runlevel=3 ;; + esac + + # Write a dumb priority as it is not used. + find_service $service $rcnd && + echo "$service $runlevel 50" >>/var/lib/systemd/sysv-convert/database done done ;; @@ -132,17 +89,13 @@ services=$@ lookup_database $services for service in $services; do - if [ -z "${results_runlevel[$service]}" ]; then - echo No information found about service $service found. >/dev/stderr + if [ -z "${results_target[$service]}" ]; then + echo "No information about service $service found." >/dev/stderr let fail++ continue fi - declare -i count - count=0 - priority=(${results_priority[$service]}) - for runlevel in ${results_runlevel[$service]}; do - echo SysV service $service enabled in runlevel $runlevel at priority ${priority[$count]} - count+=1 + for target in ${results_target[$service]}; do + echo "SysV service '$service' is pulled by $target" done done ;; @@ -170,16 +123,16 @@ if [ -e /var/lib/systemd/sysv-convert/database ]; then lookup_database $services for service in $services; do - [ -f "/lib/systemd/system/$service.service" ] && service_file="/lib/systemd/system/$service.service" - [ -f "/usr/lib/systemd/system/$service.service" ] && service_file="/usr/lib/systemd/system/$service.service" + [ -f "/lib/systemd/system/$service.service" ] && unit="/lib/systemd/system/$service.service" + [ -f "/usr/lib/systemd/system/$service.service" ] && unit="/usr/lib/systemd/system/$service.service" # If $service is not present in the database, # then it simply means that the sysv init # service was not enabled at all. - for runlevel in ${results_runlevel[$service]}; do - echo ln -sf $service_file /etc/systemd/system/runlevel$runlevel.target.wants/$service.service >/dev/stderr - mkdir -p "/etc/systemd/system/runlevel$runlevel.target.wants" - /bin/ln -sf $service_file /etc/systemd/system/runlevel$runlevel.target.wants/$service.service + for target in ${results_target[$service]}; do + echo ln -sf $unit /etc/systemd/system/$target.wants/$service.service >/dev/stderr + mkdir -p "/etc/systemd/system/$target.wants" + /bin/ln -sf $unit /etc/systemd/system/$target.wants/$service.service done done fi