From 3283fdeb6b9e08ff2cfb3d09a3f9a257b3bc733615820a4b5f3badd1f50b4d9c Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Wed, 20 Mar 2013 10:29:34 +0000 Subject: [PATCH] - udev: re-add persistent network rules (bnc#809843). add: 1026-re-add-persistent-net.patch - rebase all patches, ensure that they apply properly. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=357 --- 1026-re-add-persistent-net.patch | 428 ++++++++++++++++++ agetty-overrides-term.patch | 23 +- ...r-empty-strings-in-strto-conversions.patch | 39 +- ...-load-fragment-improve-error-message.patch | 31 +- ...tor-state-file-name-in-error-message.patch | 15 +- delta-accept-t-option.patch | 13 +- do-not-make-sockets-dependent-on-lo.patch | 13 +- fix-bad-mem-access.patch | 13 +- fix-potential-bad-mem-access.patch | 13 +- ...enerator-error-message-on-duplicates.patch | 15 +- handle-HOSTNAME.patch | 4 +- hostnamectl-fix-parsing-no-ask-password.patch | 13 +- improve-overflow-checks.patch | 88 +--- ...l-send-always-send-syslog_identifier.patch | 19 +- localectl-fix-assertion.patch | 13 +- ...pport-systems-without-locale-archive.patch | 19 +- ...d-capability-making-seats-without-fb.patch | 23 +- ...-non-tty-non-x11-session-on-shutdown.patch | 13 +- rbind-mount.patch | 23 +- ...king-ignore-exit-status-main-process.patch | 13 +- socket-improve-error-message.patch | 13 +- socket-verbose-error-message.patch | 13 +- ...ctl-no-assert-on-reboot-without-dbus.patch | 13 +- ...l-verbose-message-on-missing-install.patch | 13 +- systemd-cgls-fix-piping-output.patch | 15 +- systemd.changes | 7 + systemd.spec | 5 + var-run-lock.patch | 4 +- 28 files changed, 608 insertions(+), 306 deletions(-) create mode 100644 1026-re-add-persistent-net.patch diff --git a/1026-re-add-persistent-net.patch b/1026-re-add-persistent-net.patch new file mode 100644 index 00000000..1b05d5ee --- /dev/null +++ b/1026-re-add-persistent-net.patch @@ -0,0 +1,428 @@ +Index: systemd-195/src/udev/rule_generator/75-persistent-net-generator.rules +=================================================================== +--- /dev/null ++++ systemd-195/src/udev/rule_generator/75-persistent-net-generator.rules +@@ -0,0 +1,102 @@ ++# do not edit this file, it will be overwritten on update ++ ++# these rules generate rules for persistent network device naming ++# ++# variables used to communicate: ++# MATCHADDR MAC address used for the match ++# MATCHID bus_id used for the match ++# MATCHDRV driver name used for the match ++# MATCHIFTYPE interface type match ++# COMMENT comment to add to the generated rule ++# INTERFACE_NAME requested name supplied by external tool ++# INTERFACE_NEW new interface name returned by rule writer ++ ++ACTION!="add", GOTO="persistent_net_generator_end" ++SUBSYSTEM!="net", GOTO="persistent_net_generator_end" ++ ++# ignore the interface if a name has already been set ++NAME=="?*", GOTO="persistent_net_generator_end" ++ ++# device name whitelist ++KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end" ++ ++# ignore Xen virtual interfaces ++SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end" ++ ++# read MAC address ++ENV{MATCHADDR}="$attr{address}" ++ ++# match interface type ++ENV{MATCHIFTYPE}="$attr{type}" ++ ++# ignore KVM virtual interfaces ++ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end" ++# ignore VMWare virtual interfaces ++ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end" ++# ignore Hyper-V virtual interfaces ++ENV{MATCHADDR}=="00:15:5d:*", GOTO="persistent_net_generator_end" ++ ++# These vendors are known to violate the local MAC address assignment scheme ++# Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom ++ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist" ++# 3Com ++ENV{MATCHADDR}=="02:60:60:*", GOTO="globally_administered_whitelist" ++# 3Com IBM PC; Imagen; Valid; Cisco; Apple ++ENV{MATCHADDR}=="02:60:8c:*", GOTO="globally_administered_whitelist" ++# Intel ++ENV{MATCHADDR}=="02:a0:c9:*", GOTO="globally_administered_whitelist" ++# Olivetti ++ENV{MATCHADDR}=="02:aa:3c:*", GOTO="globally_administered_whitelist" ++# CMC Masscomp; Silicon Graphics; Prime EXL ++ENV{MATCHADDR}=="02:cf:1f:*", GOTO="globally_administered_whitelist" ++# Prominet Corporation Gigabit Ethernet Switch ++ENV{MATCHADDR}=="02:e0:3b:*", GOTO="globally_administered_whitelist" ++# BTI (Bus-Tech, Inc.) IBM Mainframes ++ENV{MATCHADDR}=="02:e6:d3:*", GOTO="globally_administered_whitelist" ++# Realtek ++ENV{MATCHADDR}=="52:54:00:*", GOTO="globally_administered_whitelist" ++# Novell 2000 ++ENV{MATCHADDR}=="52:54:4c:*", GOTO="globally_administered_whitelist" ++# Realtec ++ENV{MATCHADDR}=="52:54:ab:*", GOTO="globally_administered_whitelist" ++# Kingston Technologies ++ENV{MATCHADDR}=="e2:0c:0f:*", GOTO="globally_administered_whitelist" ++# Xensource ++ENV{MATCHADDR}=="00:16:3e:*", GOTO="globally_administered_whitelist" ++ ++# match interface dev_id ++ATTR{dev_id}=="?*", ENV{MATCHDEVID}="$attr{dev_id}" ++ ++# do not use "locally administered" MAC address ++ENV{MATCHADDR}=="?[2367abef]:*", ENV{MATCHADDR}="" ++ ++# do not use empty address ++ENV{MATCHADDR}=="00:00:00:00:00:00", ENV{MATCHADDR}="" ++ ++LABEL="globally_administered_whitelist" ++ ++# build comment line for generated rule: ++SUBSYSTEMS=="pci", ENV{COMMENT}="PCI device $attr{vendor}:$attr{device} ($driver)" ++SUBSYSTEMS=="usb", ATTRS{idVendor}=="?*", ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct} ($driver)" ++SUBSYSTEMS=="pcmcia", ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id} ($driver)" ++SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire device $attr{host_id})" ++ ++# ibmveth likes to use "locally administered" MAC addresses ++DRIVERS=="ibmveth", ENV{MATCHADDR}="$attr{address}", ENV{COMMENT}="ibmveth ($id)" ++ ++# S/390 uses id matches only, do not use MAC address match ++SUBSYSTEMS=="ccwgroup", ENV{COMMENT}="S/390 $driver device at $id", ENV{MATCHID}="$id", ENV{MATCHDRV}="$driver", ENV{MATCHADDR}="" ++ ++# see if we got enough data to create a rule ++ENV{MATCHADDR}=="", ENV{MATCHID}=="", ENV{INTERFACE_NAME}=="", GOTO="persistent_net_generator_end" ++ ++# default comment ++ENV{COMMENT}=="", ENV{COMMENT}="net device ($attr{driver})" ++ ++# write rule ++DRIVERS=="?*", IMPORT{program}="write_net_rules" ++ ++# rename interface if needed ++ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}" ++ ++LABEL="persistent_net_generator_end" +Index: systemd-195/src/udev/rule_generator/rule_generator.functions +=================================================================== +--- /dev/null ++++ systemd-195/src/udev/rule_generator/rule_generator.functions +@@ -0,0 +1,113 @@ ++# functions used by the udev rule generator ++ ++# Copyright (C) 2006 Marco d'Itri ++ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 2 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++PATH='/usr/bin:/bin:/usr/sbin:/sbin' ++ ++# Read a single line from file $1 in the $DEVPATH directory. ++# The function must not return an error even if the file does not exist. ++sysread() { ++ local file="$1" ++ [ -e "/sys$DEVPATH/$file" ] || return 0 ++ local value ++ read value < "/sys$DEVPATH/$file" || return 0 ++ echo "$value" ++} ++ ++sysreadlink() { ++ local file="$1" ++ [ -e "/sys$DEVPATH/$file" ] || return 0 ++ readlink -f /sys$DEVPATH/$file 2> /dev/null || true ++} ++ ++# Return true if a directory is writeable. ++writeable() { ++ if ln -s test-link $1/.is-writeable 2> /dev/null; then ++ rm -f $1/.is-writeable ++ return 0 ++ else ++ return 1 ++ fi ++} ++ ++# Create a lock file for the current rules file. ++lock_rules_file() { ++ RUNDIR="/run/udev" ++ [ -e "$RUNDIR" ] || return 0 ++ ++ RULES_LOCK="$RUNDIR/.lock-${RULES_FILE##*/}" ++ ++ retry=30 ++ while ! mkdir $RULES_LOCK 2> /dev/null; do ++ if [ $retry -eq 0 ]; then ++ echo "Cannot lock $RULES_FILE!" >&2 ++ exit 2 ++ fi ++ sleep 1 ++ retry=$(($retry - 1)) ++ done ++} ++ ++unlock_rules_file() { ++ [ "$RULES_LOCK" ] || return 0 ++ rmdir $RULES_LOCK || true ++} ++ ++# Choose the real rules file if it is writeable or a temporary file if not. ++# Both files should be checked later when looking for existing rules. ++choose_rules_file() { ++ RUNDIR="/run/udev" ++ local tmp_rules_file="$RUNDIR/tmp-rules--${RULES_FILE##*/}" ++ [ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1 ++ ++ if writeable ${RULES_FILE%/*}; then ++ RO_RULES_FILE='/dev/null' ++ else ++ RO_RULES_FILE=$RULES_FILE ++ RULES_FILE=$tmp_rules_file ++ fi ++} ++ ++# Return the name of the first free device. ++raw_find_next_available() { ++ local links="$1" ++ ++ local basename=${links%%[ 0-9]*} ++ local max=-1 ++ for name in $links; do ++ local num=${name#$basename} ++ [ "$num" ] || num=0 ++ [ $num -gt $max ] && max=$num ++ done ++ ++ local max=$(($max + 1)) ++ # "name0" actually is just "name" ++ [ $max -eq 0 ] && return ++ echo "$max" ++} ++ ++# Find all rules matching a key (with action) and a pattern. ++find_all_rules() { ++ local key="$1" ++ local linkre="$2" ++ local match="$3" ++ ++ local search='.*[[:space:],]'"$key"'"('"$linkre"')".*' ++ echo $(sed -n -r -e 's/^#.*//' -e "${match}s/${search}/\1/p" \ ++ $RO_RULES_FILE \ ++ $([ -e $RULES_FILE ] && echo $RULES_FILE) \ ++ 2>/dev/null) ++} +Index: systemd-195/Makefile.in +=================================================================== +--- systemd-195.orig/Makefile.in ++++ systemd-195/Makefile.in +@@ -1743,7 +1743,9 @@ am_v4l_id_OBJECTS = src/udev/v4l_id/v4l_ + v4l_id_OBJECTS = $(am_v4l_id_OBJECTS) + v4l_id_DEPENDENCIES = libudev.la + am__dist_udevhome_SCRIPTS_DIST = src/udev/keymap/findkeyboards \ +- src/udev/keymap/keyboard-force-release.sh ++ src/udev/keymap/keyboard-force-release.sh \ ++ src/udev/rule_generator/rule_generator.functions \ ++ src/udev/rule_generator/write_net_rules + SCRIPTS = $(dist_bin_SCRIPTS) $(dist_udevhome_SCRIPTS) + AM_V_P = $(am__v_P_@AM_V@) + am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +@@ -2051,7 +2053,8 @@ am__dist_udevrules_DATA_DIST = rules/99- + src/udev/keymap/95-keymap.rules \ + src/udev/keymap/95-keyboard-force-release.rules \ + rules/75-probe_mtd.rules src/login/70-uaccess.rules \ +- src/login/70-power-switch.rules ++ src/login/70-power-switch.rules \ ++ src/udev/rule_generator/75-persistent-net-generator.rules + DATA = $(dbusinterface_DATA) $(dist_bashcompletion_DATA) \ + $(dist_dbuspolicy_DATA) $(dist_dbussystemservice_DATA) \ + $(dist_doc_DATA) $(dist_gatewayddocumentroot_DATA) \ +Index: systemd-195/Makefile.am +=================================================================== +--- systemd-195.orig/Makefile.am ++++ systemd-195/Makefile.am +@@ -2179,6 +2179,14 @@ EXTRA_DIST += \ + + + # ------------------------------------------------------------------------------ ++dist_udevhome_SCRIPTS = \ ++ src/udev/rule_generator/rule_generator.functions \ ++ src/udev/rule_generator/write_net_rules ++ ++dist_udevrules_DATA += \ ++ src/udev/rule_generator/75-persistent-net-generator.rules ++ ++# ------------------------------------------------------------------------------ + if ENABLE_KEYMAP + keymap_SOURCES = \ + src/udev/keymap/keymap.c +@@ -2206,7 +2214,7 @@ dist_udevrules_DATA += \ + src/udev/keymap/95-keymap.rules \ + src/udev/keymap/95-keyboard-force-release.rules + +-dist_udevhome_SCRIPTS = \ ++dist_udevhome_SCRIPTS += \ + src/udev/keymap/findkeyboards \ + src/udev/keymap/keyboard-force-release.sh + +Index: systemd-195/src/udev/rule_generator/write_net_rules +=================================================================== +--- /dev/null ++++ systemd-195/src/udev/rule_generator/write_net_rules +@@ -0,0 +1,145 @@ ++#!/bin/sh -e ++ ++# This script is run to create persistent network device naming rules ++# based on properties of the device. ++# If the interface needs to be renamed, INTERFACE_NEW= will be printed ++# on stdout to allow udev to IMPORT it. ++ ++# variables used to communicate: ++# MATCHADDR MAC address used for the match ++# MATCHID bus_id used for the match ++# MATCHDEVID dev_id used for the match ++# MATCHDRV driver name used for the match ++# MATCHIFTYPE interface type match ++# COMMENT comment to add to the generated rule ++# INTERFACE_NAME requested name supplied by external tool ++# INTERFACE_NEW new interface name returned by rule writer ++ ++# Copyright (C) 2006 Marco d'Itri ++# Copyright (C) 2007 Kay Sievers ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# debug, if UDEV_LOG= ++if [ -n "$UDEV_LOG" ]; then ++ if [ "$UDEV_LOG" -ge 7 ]; then ++ set -x ++ fi ++fi ++ ++RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules' ++ ++if [ -e /usr/lib/udev/rule_generator.functions ]; then ++ . /usr/lib/udev/rule_generator.functions ++else ++ . /lib/udev/rule_generator.functions ++fi ++ ++interface_name_taken() { ++ local value="$(find_all_rules 'NAME=' $INTERFACE)" ++ if [ "$value" ]; then ++ return 0 ++ else ++ return 1 ++ fi ++} ++ ++find_next_available() { ++ raw_find_next_available "$(find_all_rules 'NAME=' "$1")" ++} ++ ++write_rule() { ++ local match="$1" ++ local name="$2" ++ local comment="$3" ++ ++ { ++ if [ "$PRINT_HEADER" ]; then ++ PRINT_HEADER= ++ echo "# This file was automatically generated by the $0" ++ echo "# program, run by the persistent-net-generator.rules rules file." ++ echo "#" ++ echo "# You can modify it, as long as you keep each rule on a single" ++ echo "# line, and change only the value of the NAME= key." ++ fi ++ ++ echo "" ++ [ "$comment" ] && echo "# $comment" ++ echo "SUBSYSTEM==\"net\", ACTION==\"add\"$match, NAME=\"$name\"" ++ } >> $RULES_FILE ++} ++ ++if [ -z "$INTERFACE" ]; then ++ echo "missing \$INTERFACE" >&2 ++ exit 1 ++fi ++ ++# Prevent concurrent processes from modifying the file at the same time. ++lock_rules_file ++ ++# Check if the rules file is writeable. ++choose_rules_file ++ ++# the DRIVERS key is needed to not match bridges and VLAN sub-interfaces ++if [ "$MATCHADDR" ]; then ++ match="$match, DRIVERS==\"?*\", ATTR{address}==\"$MATCHADDR\"" ++fi ++ ++if [ "$MATCHDRV" ]; then ++ match="$match, DRIVERS==\"$MATCHDRV\"" ++fi ++ ++if [ "$MATCHDEVID" ]; then ++ match="$match, ATTR{dev_id}==\"$MATCHDEVID\"" ++fi ++ ++if [ "$MATCHID" ]; then ++ match="$match, KERNELS==\"$MATCHID\"" ++fi ++ ++if [ "$MATCHIFTYPE" ]; then ++ match="$match, ATTR{type}==\"$MATCHIFTYPE\"" ++fi ++ ++if [ -z "$match" ]; then ++ echo "missing valid match" >&2 ++ unlock_rules_file ++ exit 1 ++fi ++ ++basename=${INTERFACE%%[0-9]*} ++match="$match, KERNEL==\"$basename*\"" ++ ++if [ "$INTERFACE_NAME" ]; then ++ # external tools may request a custom name ++ COMMENT="$COMMENT (custom name provided by external tool)" ++ if [ "$INTERFACE_NAME" != "$INTERFACE" ]; then ++ INTERFACE=$INTERFACE_NAME; ++ echo "INTERFACE_NEW=$INTERFACE" ++ fi ++else ++ # if a rule using the current name already exists, find a new name ++ if interface_name_taken; then ++ INTERFACE="$basename$(find_next_available "$basename[0-9]*")" ++ # prevent INTERFACE from being "eth" instead of "eth0" ++ [ "$INTERFACE" = "${INTERFACE%%[ \[\]0-9]*}" ] && INTERFACE=${INTERFACE}0 ++ echo "INTERFACE_NEW=$INTERFACE" ++ fi ++fi ++ ++write_rule "$match" "$INTERFACE" "$COMMENT" ++ ++unlock_rules_file ++ ++exit 0 diff --git a/agetty-overrides-term.patch b/agetty-overrides-term.patch index 62aee284..84f3ff26 100644 --- a/agetty-overrides-term.patch +++ b/agetty-overrides-term.patch @@ -13,11 +13,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=870622 units/serial-getty@.service.m4 | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) -diff --git a/units/getty@.service.m4 b/units/getty@.service.m4 -index b5875ce..810c23f 100644 ---- a/units/getty@.service.m4 -+++ b/units/getty@.service.m4 -@@ -43,9 +43,8 @@ IgnoreOnIsolate=yes +Index: systemd-195/units/getty@.service.m4 +=================================================================== +--- systemd-195.orig/units/getty@.service.m4 ++++ systemd-195/units/getty@.service.m4 +@@ -41,9 +41,8 @@ IgnoreOnIsolate=yes ConditionPathExists=/dev/tty0 [Service] @@ -28,11 +28,11 @@ index b5875ce..810c23f 100644 Type=idle Restart=always RestartSec=0 -diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4 -index a6bbd71..c411dc1 100644 ---- a/units/serial-getty@.service.m4 -+++ b/units/serial-getty@.service.m4 -@@ -39,8 +39,7 @@ Before=getty.target +Index: systemd-195/units/serial-getty@.service.m4 +=================================================================== +--- systemd-195.orig/units/serial-getty@.service.m4 ++++ systemd-195/units/serial-getty@.service.m4 +@@ -37,8 +37,7 @@ Before=getty.target IgnoreOnIsolate=yes [Service] @@ -42,6 +42,3 @@ index a6bbd71..c411dc1 100644 Type=idle Restart=always RestartSec=0 --- -1.7.10.4 - diff --git a/check-for-empty-strings-in-strto-conversions.patch b/check-for-empty-strings-in-strto-conversions.patch index a0aff571..ce49372e 100644 --- a/check-for-empty-strings-in-strto-conversions.patch +++ b/check-for-empty-strings-in-strto-conversions.patch @@ -15,11 +15,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=870577 src/shared/util.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) -diff --git a/src/libsystemd-daemon/sd-daemon.c b/src/libsystemd-daemon/sd-daemon.c -index 863ac75..480db3b 100644 ---- a/src/libsystemd-daemon/sd-daemon.c -+++ b/src/libsystemd-daemon/sd-daemon.c -@@ -88,7 +88,7 @@ _sd_export_ int sd_listen_fds(int unset_environment) { +Index: systemd-195/src/libsystemd-daemon/sd-daemon.c +=================================================================== +--- systemd-195.orig/src/libsystemd-daemon/sd-daemon.c ++++ systemd-195/src/libsystemd-daemon/sd-daemon.c +@@ -88,7 +88,7 @@ _sd_export_ int sd_listen_fds(int unset_ goto finish; } @@ -28,7 +28,7 @@ index 863ac75..480db3b 100644 r = -EINVAL; goto finish; } -@@ -112,7 +112,7 @@ _sd_export_ int sd_listen_fds(int unset_environment) { +@@ -112,7 +112,7 @@ _sd_export_ int sd_listen_fds(int unset_ goto finish; } @@ -37,10 +37,10 @@ index 863ac75..480db3b 100644 r = -EINVAL; goto finish; } -diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c -index 4bf3147..9f5c07c 100644 ---- a/src/shared/conf-parser.c -+++ b/src/shared/conf-parser.c +Index: systemd-195/src/shared/conf-parser.c +=================================================================== +--- systemd-195.orig/src/shared/conf-parser.c ++++ systemd-195/src/shared/conf-parser.c @@ -865,7 +865,7 @@ int config_parse_mode( errno = 0; @@ -50,11 +50,11 @@ index 4bf3147..9f5c07c 100644 log_error("[%s:%u] Failed to parse mode value, ignoring: %s", filename, line, rvalue); return 0; } -diff --git a/src/shared/util.c b/src/shared/util.c -index 8ec83e4..23832fe 100644 ---- a/src/shared/util.c -+++ b/src/shared/util.c -@@ -377,7 +377,7 @@ int safe_atou(const char *s, unsigned *ret_u) { +Index: systemd-195/src/shared/util.c +=================================================================== +--- systemd-195.orig/src/shared/util.c ++++ systemd-195/src/shared/util.c +@@ -388,7 +388,7 @@ int safe_atou(const char *s, unsigned *r errno = 0; l = strtoul(s, &x, 0); @@ -63,7 +63,7 @@ index 8ec83e4..23832fe 100644 return errno ? -errno : -EINVAL; if ((unsigned long) (unsigned) l != l) -@@ -397,7 +397,7 @@ int safe_atoi(const char *s, int *ret_i) { +@@ -408,7 +408,7 @@ int safe_atoi(const char *s, int *ret_i) errno = 0; l = strtol(s, &x, 0); @@ -72,7 +72,7 @@ index 8ec83e4..23832fe 100644 return errno ? -errno : -EINVAL; if ((long) (int) l != l) -@@ -417,7 +417,7 @@ int safe_atollu(const char *s, long long unsigned *ret_llu) { +@@ -428,7 +428,7 @@ int safe_atollu(const char *s, long long errno = 0; l = strtoull(s, &x, 0); @@ -81,7 +81,7 @@ index 8ec83e4..23832fe 100644 return errno ? -errno : -EINVAL; *ret_llu = l; -@@ -434,7 +434,7 @@ int safe_atolli(const char *s, long long int *ret_lli) { +@@ -445,7 +445,7 @@ int safe_atolli(const char *s, long long errno = 0; l = strtoll(s, &x, 0); @@ -90,6 +90,3 @@ index 8ec83e4..23832fe 100644 return errno ? -errno : -EINVAL; *ret_lli = l; --- -1.7.10.4 - diff --git a/core-load-fragment-improve-error-message.patch b/core-load-fragment-improve-error-message.patch index f860a4cb..850698dd 100644 --- a/core-load-fragment-improve-error-message.patch +++ b/core-load-fragment-improve-error-message.patch @@ -13,11 +13,11 @@ https://bugs.freedesktop.org/show_bug.cgi?id=56874 src/core/load-fragment.c | 69 +++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 38 deletions(-) -diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c -index 6759255..01f9484 100644 ---- a/src/core/load-fragment.c -+++ b/src/core/load-fragment.c -@@ -86,7 +86,7 @@ int config_parse_unit_deps( +Index: systemd-195/src/core/load-fragment.c +=================================================================== +--- systemd-195.orig/src/core/load-fragment.c ++++ systemd-195/src/core/load-fragment.c +@@ -85,7 +85,7 @@ int config_parse_unit_deps( assert(rvalue); FOREACH_WORD_QUOTED(w, l, rvalue, state) { @@ -26,7 +26,7 @@ index 6759255..01f9484 100644 int r; t = strndup(w, l); -@@ -94,15 +94,13 @@ int config_parse_unit_deps( +@@ -93,15 +93,13 @@ int config_parse_unit_deps( return -ENOMEM; k = unit_name_printf(u, t); @@ -44,7 +44,7 @@ index 6759255..01f9484 100644 } return 0; -@@ -757,22 +755,25 @@ int config_parse_exec_cpu_affinity( +@@ -739,22 +737,25 @@ int config_parse_exec_cpu_affinity( assert(data); FOREACH_WORD_QUOTED(w, l, rvalue, state) { @@ -76,7 +76,7 @@ index 6759255..01f9484 100644 return 0; } -@@ -849,7 +850,8 @@ int config_parse_exec_secure_bits( +@@ -831,7 +832,8 @@ int config_parse_exec_secure_bits( else if (first_word(w, "noroot-locked")) c->secure_bits |= SECURE_NOROOT_LOCKED; else { @@ -86,7 +86,7 @@ index 6759255..01f9484 100644 return 0; } } -@@ -890,7 +892,7 @@ int config_parse_bounding_set( +@@ -872,7 +874,7 @@ int config_parse_bounding_set( * interface. */ FOREACH_WORD_QUOTED(w, l, rvalue, state) { @@ -95,7 +95,7 @@ index 6759255..01f9484 100644 int r; cap_value_t cap; -@@ -899,10 +901,9 @@ int config_parse_bounding_set( +@@ -881,10 +883,9 @@ int config_parse_bounding_set( return -ENOMEM; r = cap_from_name(t, &cap); @@ -108,7 +108,7 @@ index 6759255..01f9484 100644 continue; } -@@ -968,7 +969,7 @@ int config_parse_unit_cgroup( +@@ -950,7 +951,7 @@ int config_parse_unit_cgroup( char *state; FOREACH_WORD_QUOTED(w, l, rvalue, state) { @@ -117,7 +117,7 @@ index 6759255..01f9484 100644 int r; t = strndup(w, l); -@@ -976,22 +977,17 @@ int config_parse_unit_cgroup( +@@ -958,22 +959,17 @@ int config_parse_unit_cgroup( return -ENOMEM; k = unit_full_printf(u, t); @@ -145,7 +145,7 @@ index 6759255..01f9484 100644 return 0; } } -@@ -1351,33 +1347,30 @@ int config_parse_service_sockets( +@@ -1333,33 +1329,30 @@ int config_parse_service_sockets( assert(data); FOREACH_WORD_QUOTED(w, l, rvalue, state) { @@ -184,7 +184,7 @@ index 6759255..01f9484 100644 } return 0; -@@ -2105,17 +2098,17 @@ int config_parse_syscall_filter( +@@ -2087,17 +2080,17 @@ int config_parse_syscall_filter( FOREACH_WORD_QUOTED(w, l, rvalue, state) { int id; @@ -205,6 +205,3 @@ index 6759255..01f9484 100644 continue; } --- -1.7.10.4 - diff --git a/crypsetup-generator-state-file-name-in-error-message.patch b/crypsetup-generator-state-file-name-in-error-message.patch index 890c6e29..ccb1c895 100644 --- a/crypsetup-generator-state-file-name-in-error-message.patch +++ b/crypsetup-generator-state-file-name-in-error-message.patch @@ -7,11 +7,11 @@ Subject: [PATCH] cryptsetup-generator: state file name in error messages 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 ef16fbc..6e7b707 100644 ---- a/src/cryptsetup/cryptsetup-generator.c -+++ b/src/cryptsetup/cryptsetup-generator.c -@@ -108,7 +108,7 @@ static int create_disk( +Index: systemd-195/src/cryptsetup/cryptsetup-generator.c +=================================================================== +--- systemd-195.orig/src/cryptsetup/cryptsetup-generator.c ++++ systemd-195/src/cryptsetup/cryptsetup-generator.c +@@ -230,7 +230,7 @@ static int create_disk( f = fopen(p, "wxe"); if (!f) { r = -errno; @@ -20,7 +20,7 @@ index ef16fbc..6e7b707 100644 goto fail; } -@@ -160,7 +160,7 @@ static int create_disk( +@@ -283,7 +283,7 @@ static int create_disk( if (ferror(f)) { r = -errno; @@ -29,6 +29,3 @@ index ef16fbc..6e7b707 100644 goto fail; } --- -1.7.10.4 - diff --git a/delta-accept-t-option.patch b/delta-accept-t-option.patch index d0554b0a..4717c018 100644 --- a/delta-accept-t-option.patch +++ b/delta-accept-t-option.patch @@ -9,11 +9,11 @@ so let's do that. src/delta/delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/delta/delta.c b/src/delta/delta.c -index cc34208..a65cea5 100644 ---- a/src/delta/delta.c -+++ b/src/delta/delta.c -@@ -352,7 +352,7 @@ static int parse_argv(int argc, char *argv[]) { +Index: systemd-195/src/delta/delta.c +=================================================================== +--- systemd-195.orig/src/delta/delta.c ++++ systemd-195/src/delta/delta.c +@@ -375,7 +375,7 @@ static int parse_argv(int argc, char *ar assert(argc >= 1); assert(argv); @@ -22,6 +22,3 @@ index cc34208..a65cea5 100644 switch (c) { --- -1.7.10.4 - diff --git a/do-not-make-sockets-dependent-on-lo.patch b/do-not-make-sockets-dependent-on-lo.patch index 247a7c80..7c5e78b8 100644 --- a/do-not-make-sockets-dependent-on-lo.patch +++ b/do-not-make-sockets-dependent-on-lo.patch @@ -9,11 +9,11 @@ with BindToDevice=lo would never be activated. src/core/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/core/socket.c b/src/core/socket.c -index fcbcdbe..d755040 100644 ---- a/src/core/socket.c -+++ b/src/core/socket.c -@@ -308,7 +308,7 @@ static int socket_add_device_link(Socket *s) { +Index: systemd-195/src/core/socket.c +=================================================================== +--- systemd-195.orig/src/core/socket.c ++++ systemd-195/src/core/socket.c +@@ -293,7 +293,7 @@ static int socket_add_device_link(Socket assert(s); @@ -22,6 +22,3 @@ index fcbcdbe..d755040 100644 return 0; if (asprintf(&t, "/sys/subsystem/net/devices/%s", s->bind_to_device) < 0) --- -1.7.10.4 - diff --git a/fix-bad-mem-access.patch b/fix-bad-mem-access.patch index 18cf4aa2..878ed0a9 100644 --- a/fix-bad-mem-access.patch +++ b/fix-bad-mem-access.patch @@ -7,11 +7,11 @@ Subject: [PATCH] util: fix bad memory access src/shared/util.c | 1 - 1 file changed, 1 deletion(-) -diff --git a/src/shared/util.c b/src/shared/util.c -index 0161f3e..8e14096 100644 ---- a/src/shared/util.c -+++ b/src/shared/util.c -@@ -439,7 +439,6 @@ int get_parent_of_pid(pid_t pid, pid_t *_ppid) { +Index: systemd-195/src/shared/util.c +=================================================================== +--- systemd-195.orig/src/shared/util.c ++++ systemd-195/src/shared/util.c +@@ -543,7 +543,6 @@ int get_parent_of_pid(pid_t pid, pid_t * if (!fgets(line, sizeof(line), f)) { r = feof(f) ? -EIO : -errno; @@ -19,6 +19,3 @@ index 0161f3e..8e14096 100644 return r; } --- -1.7.10.4 - diff --git a/fix-potential-bad-mem-access.patch b/fix-potential-bad-mem-access.patch index db90af84..3c3e0c98 100644 --- a/fix-potential-bad-mem-access.patch +++ b/fix-potential-bad-mem-access.patch @@ -11,11 +11,11 @@ If failing, print just the offending mount flag. src/core/load-fragment.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) -diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c -index 01f9484..6933e1a 100644 ---- a/src/core/load-fragment.c -+++ b/src/core/load-fragment.c -@@ -1101,15 +1101,22 @@ int config_parse_exec_mount_flags( +Index: systemd-195/src/core/load-fragment.c +=================================================================== +--- systemd-195.orig/src/core/load-fragment.c ++++ systemd-195/src/core/load-fragment.c +@@ -1083,15 +1083,22 @@ int config_parse_exec_mount_flags( assert(rvalue); assert(data); @@ -43,6 +43,3 @@ index 01f9484..6933e1a 100644 return 0; } } --- -1.7.10.4 - diff --git a/fstab-generator-error-message-on-duplicates.patch b/fstab-generator-error-message-on-duplicates.patch index ecc43782..33ec3f26 100644 --- a/fstab-generator-error-message-on-duplicates.patch +++ b/fstab-generator-error-message-on-duplicates.patch @@ -17,11 +17,11 @@ some confusion, so give a hint what migt be wrong. src/fstab-generator/fstab-generator.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c -index 7b3bf11..ba55f2c 100644 ---- a/src/fstab-generator/fstab-generator.c -+++ b/src/fstab-generator/fstab-generator.c -@@ -111,7 +111,10 @@ static int add_swap(const char *what, struct mntent *me) { +Index: systemd-195/src/fstab-generator/fstab-generator.c +=================================================================== +--- systemd-195.orig/src/fstab-generator/fstab-generator.c ++++ systemd-195/src/fstab-generator/fstab-generator.c +@@ -111,7 +111,10 @@ static int add_swap(const char *what, st f = fopen(unit, "wxe"); if (!f) { r = -errno; @@ -33,7 +33,7 @@ index 7b3bf11..ba55f2c 100644 goto finish; } -@@ -254,7 +257,10 @@ static int add_mount(const char *what, const char *where, struct mntent *me) { +@@ -262,7 +265,10 @@ static int add_mount(const char *what, c f = fopen(unit, "wxe"); if (!f) { r = -errno; @@ -45,6 +45,3 @@ index 7b3bf11..ba55f2c 100644 goto finish; } --- -1.7.10.4 - diff --git a/handle-HOSTNAME.patch b/handle-HOSTNAME.patch index b2bf4825..56aa50f3 100644 --- a/handle-HOSTNAME.patch +++ b/handle-HOSTNAME.patch @@ -13,7 +13,7 @@ Index: systemd-195/src/hostname/hostnamed.c return 0; } -@@ -203,6 +207,7 @@ static int write_data_hostname(void) { +@@ -204,6 +208,7 @@ static int write_data_hostname(void) { static int write_data_static_hostname(void) { @@ -21,7 +21,7 @@ Index: systemd-195/src/hostname/hostnamed.c if (isempty(data[PROP_STATIC_HOSTNAME])) { if (unlink("/etc/hostname") < 0) -@@ -211,7 +216,11 @@ static int write_data_static_hostname(vo +@@ -212,7 +217,11 @@ static int write_data_static_hostname(vo return 0; } diff --git a/hostnamectl-fix-parsing-no-ask-password.patch b/hostnamectl-fix-parsing-no-ask-password.patch index 490724d0..ac629848 100644 --- a/hostnamectl-fix-parsing-no-ask-password.patch +++ b/hostnamectl-fix-parsing-no-ask-password.patch @@ -7,11 +7,11 @@ Subject: [PATCH] hostnamectl: fix parsing of --no-ask-password src/hostname/hostnamectl.c | 4 ++++ 1 file changed, 4 insertions(+) -diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c -index b7ae5cc..265c7ec 100644 ---- a/src/hostname/hostnamectl.c -+++ b/src/hostname/hostnamectl.c -@@ -403,6 +403,10 @@ static int parse_argv(int argc, char *argv[]) { +Index: systemd-195/src/hostname/hostnamectl.c +=================================================================== +--- systemd-195.orig/src/hostname/hostnamectl.c ++++ systemd-195/src/hostname/hostnamectl.c +@@ -402,6 +402,10 @@ static int parse_argv(int argc, char *ar arg_set_static = true; break; @@ -22,6 +22,3 @@ index b7ae5cc..265c7ec 100644 case '?': return -EINVAL; --- -1.7.10.4 - diff --git a/improve-overflow-checks.patch b/improve-overflow-checks.patch index 7a3a1787..c4952082 100644 --- a/improve-overflow-checks.patch +++ b/improve-overflow-checks.patch @@ -7,99 +7,27 @@ Subject: [PATCH] util: fix possible integer overflows src/shared/util.c | 6 ++++++ 1 file changed, 6 insertions(+) -diff --git a/src/shared/util.c b/src/shared/util.c -index 2d4a4c1..e2f8b1f 100644 ---- a/src/shared/util.c -+++ b/src/shared/util.c -@@ -148,6 +148,9 @@ usec_t timespec_load(const struct timespec *ts) { +Index: systemd-195/src/shared/util.c +=================================================================== +--- systemd-195.orig/src/shared/util.c ++++ systemd-195/src/shared/util.c +@@ -152,6 +152,9 @@ usec_t timespec_load(const struct timesp ts->tv_nsec == (long) -1) return (usec_t) -1; -+ if (USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec)) ++ if ((usec_t) ts->tv_sec > (UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / USEC_PER_SEC) + return (usec_t) -1; + return (usec_t) ts->tv_sec * USEC_PER_SEC + (usec_t) ts->tv_nsec / NSEC_PER_USEC; -@@ -175,6 +178,9 @@ usec_t timeval_load(const struct timeval *tv) { +@@ -179,6 +182,9 @@ usec_t timeval_load(const struct timeval tv->tv_usec == (suseconds_t) -1) return (usec_t) -1; -+ if (USEC_PER_SEC > (UINT64_MAX - tv->tv_usec) / (usec_t) tv->tv_sec) ++ if ((usec_t) tv->tv_sec > (UINT64_MAX - tv->tv_usec) / USEC_PER_SEC) + return (usec_t) -1; + return (usec_t) tv->tv_sec * USEC_PER_SEC + (usec_t) tv->tv_usec; --- -1.7.10.4 - -From 49371bb50e0fe6e9e90309a20006bcfd9e2fa8f4 Mon Sep 17 00:00:00 2001 -From: Dave Reisner -Date: Mon, 29 Oct 2012 15:49:34 -0400 -Subject: [PATCH] util: avoid divide by zero FPE - -In early userspace, if kernel initialization happens extremely quickly, -a call to systemd-timestamp can potentially result in division by zero. -Ensure that the check in timespec_load, which only makes sense if tv_sec -is greater than zero, is guarded by this condition. ---- - src/shared/util.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/shared/util.c b/src/shared/util.c -index e2f8b1f..9a45e60 100644 ---- a/src/shared/util.c -+++ b/src/shared/util.c -@@ -148,7 +148,8 @@ usec_t timespec_load(const struct timespec *ts) { - ts->tv_nsec == (long) -1) - return (usec_t) -1; - -- if (USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec)) -+ if (ts->tv_sec > 0 && -+ USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec)) - return (usec_t) -1; - - return --- -1.7.10.4 - -From fd09c93de9337c3df566180d04368353bb3662e7 Mon Sep 17 00:00:00 2001 -From: Michal Schmidt -Date: Mon, 29 Oct 2012 21:04:47 +0100 -Subject: [PATCH] util: improve overflow checks - -commit 49371bb fixed the observed division by zero, but missed another -occurrence of the same bug. It was also not the optimal fix. We can -simply make the divisor a constant by swapping it with the compared -value. ---- - src/shared/util.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/src/shared/util.c b/src/shared/util.c -index 9a45e60..8ec83e4 100644 ---- a/src/shared/util.c -+++ b/src/shared/util.c -@@ -148,8 +148,7 @@ usec_t timespec_load(const struct timespec *ts) { - ts->tv_nsec == (long) -1) - return (usec_t) -1; - -- if (ts->tv_sec > 0 && -- USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec)) -+ if ((usec_t) ts->tv_sec > (UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / USEC_PER_SEC) - return (usec_t) -1; - - return -@@ -179,7 +178,7 @@ usec_t timeval_load(const struct timeval *tv) { - tv->tv_usec == (suseconds_t) -1) - return (usec_t) -1; - -- if (USEC_PER_SEC > (UINT64_MAX - tv->tv_usec) / (usec_t) tv->tv_sec) -+ if ((usec_t) tv->tv_sec > (UINT64_MAX - tv->tv_usec) / USEC_PER_SEC) - return (usec_t) -1; - - return --- -1.7.10.4 - diff --git a/journal-send-always-send-syslog_identifier.patch b/journal-send-always-send-syslog_identifier.patch index 2a29345b..37af56fd 100644 --- a/journal-send-always-send-syslog_identifier.patch +++ b/journal-send-always-send-syslog_identifier.patch @@ -8,11 +8,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=872193 src/journal/journal-send.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) -diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c -index 7a91569..bd8f887 100644 ---- a/src/journal/journal-send.c -+++ b/src/journal/journal-send.c -@@ -219,6 +219,7 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) { +Index: systemd-195/src/journal/journal-send.c +=================================================================== +--- systemd-195.orig/src/journal/journal-send.c ++++ systemd-195/src/journal/journal-send.c +@@ -208,6 +208,7 @@ _public_ int sd_journal_sendv(const stru * be a tmpfs, and one that is available from early boot on * and where unprivileged users can create files. */ char path[] = "/dev/shm/journal.XXXXXX"; @@ -20,7 +20,7 @@ index 7a91569..bd8f887 100644 if (_unlikely_(!iov)) return -EINVAL; -@@ -228,7 +229,7 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) { +@@ -217,7 +218,7 @@ _public_ int sd_journal_sendv(const stru saved_errno = errno; @@ -29,7 +29,7 @@ index 7a91569..bd8f887 100644 l = alloca(sizeof(uint64_t) * n); for (i = 0; i < n; i++) { -@@ -245,6 +246,9 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) { +@@ -234,6 +235,9 @@ _public_ int sd_journal_sendv(const stru goto finish; } @@ -39,7 +39,7 @@ index 7a91569..bd8f887 100644 nl = memchr(iov[i].iov_base, '\n', iov[i].iov_len); if (nl) { if (_unlikely_(nl < c)) { -@@ -280,6 +284,20 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) { +@@ -269,6 +273,20 @@ _public_ int sd_journal_sendv(const stru IOVEC_SET_STRING(w[j++], "\n"); } @@ -60,6 +60,3 @@ index 7a91569..bd8f887 100644 fd = journal_fd(); if (_unlikely_(fd < 0)) { r = fd; --- -1.7.10.4 - diff --git a/localectl-fix-assertion.patch b/localectl-fix-assertion.patch index 08ce257e..6b1dac55 100644 --- a/localectl-fix-assertion.patch +++ b/localectl-fix-assertion.patch @@ -9,11 +9,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=882212 src/locale/localectl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/locale/localectl.c b/src/locale/localectl.c -index fa73bca..383a17d 100644 ---- a/src/locale/localectl.c -+++ b/src/locale/localectl.c -@@ -537,7 +537,7 @@ static int set_x11_keymap(DBusConnection *bus, char **args, unsigned n) { +Index: systemd-195/src/locale/localectl.c +=================================================================== +--- systemd-195.orig/src/locale/localectl.c ++++ systemd-195/src/locale/localectl.c +@@ -535,7 +535,7 @@ static int set_x11_keymap(DBusConnection layout = args[1]; model = n > 2 ? args[2] : ""; variant = n > 3 ? args[3] : ""; @@ -22,6 +22,3 @@ index fa73bca..383a17d 100644 b = arg_convert; return bus_method_call_with_reply( --- -1.7.10.4 - diff --git a/localectl-support-systems-without-locale-archive.patch b/localectl-support-systems-without-locale-archive.patch index d5498fe9..fffba30d 100644 --- a/localectl-support-systems-without-locale-archive.patch +++ b/localectl-support-systems-without-locale-archive.patch @@ -12,11 +12,11 @@ Given that glibc supports both ways, localectl should too. src/locale/localectl.c | 101 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 16 deletions(-) -diff --git a/src/locale/localectl.c b/src/locale/localectl.c -index 5d35f9c..b3acb3e 100644 ---- a/src/locale/localectl.c -+++ b/src/locale/localectl.c -@@ -266,7 +266,7 @@ finish: +Index: systemd-195/src/locale/localectl.c +=================================================================== +--- systemd-195.orig/src/locale/localectl.c ++++ systemd-195/src/locale/localectl.c +@@ -265,7 +265,7 @@ finish: return r; } @@ -25,7 +25,7 @@ index 5d35f9c..b3acb3e 100644 /* Stolen from glibc... */ struct locarhead { -@@ -304,21 +304,15 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) { +@@ -303,21 +303,15 @@ static int list_locales(DBusConnection * const struct namehashent *e; const void *p = MAP_FAILED; _cleanup_close_ int fd = -1; @@ -49,7 +49,7 @@ index 5d35f9c..b3acb3e 100644 r = -errno; goto finish; } -@@ -380,15 +374,93 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) { +@@ -378,15 +372,93 @@ static int list_locales(DBusConnection * } } @@ -146,7 +146,7 @@ index 5d35f9c..b3acb3e 100644 strv_sort(l); pager_open_if_enabled(); -@@ -399,10 +471,7 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) { +@@ -397,10 +469,7 @@ static int list_locales(DBusConnection * r = 0; finish: @@ -158,6 +158,3 @@ index 5d35f9c..b3acb3e 100644 return r; } --- -1.7.10.4 - diff --git a/logind-capability-making-seats-without-fb.patch b/logind-capability-making-seats-without-fb.patch index 3bb260cb..a74de2a5 100644 --- a/logind-capability-making-seats-without-fb.patch +++ b/logind-capability-making-seats-without-fb.patch @@ -11,10 +11,10 @@ file 71-seat.rules.in: All framebuffer devices have this tag src/login/logind.c | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) -diff --git a/src/login/71-seat.rules.in b/src/login/71-seat.rules.in -index f554d7f..4f1a9a5 100644 ---- a/src/login/71-seat.rules.in -+++ b/src/login/71-seat.rules.in +Index: systemd-195/src/login/71-seat.rules.in +=================================================================== +--- systemd-195.orig/src/login/71-seat.rules.in ++++ systemd-195/src/login/71-seat.rules.in @@ -10,7 +10,7 @@ ACTION=="remove", GOTO="seat_end" TAG=="uaccess", SUBSYSTEM!="sound", TAG+="seat" SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat" @@ -24,11 +24,11 @@ index f554d7f..4f1a9a5 100644 SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat" # 'Plugable' USB hub, sound, network, graphics adapter -diff --git a/src/login/logind.c b/src/login/logind.c -index 6438631..6776229 100644 ---- a/src/login/logind.c -+++ b/src/login/logind.c -@@ -459,11 +459,7 @@ int manager_enumerate_devices(Manager *m) { +Index: systemd-195/src/login/logind.c +=================================================================== +--- systemd-195.orig/src/login/logind.c ++++ systemd-195/src/login/logind.c +@@ -450,11 +450,7 @@ int manager_enumerate_devices(Manager *m goto finish; } @@ -41,7 +41,7 @@ index 6438631..6776229 100644 if (r < 0) goto finish; -@@ -1295,11 +1291,7 @@ static int manager_connect_udev(Manager *m) { +@@ -1286,11 +1282,7 @@ static int manager_connect_udev(Manager if (!m->udev_seat_monitor) return -ENOMEM; @@ -54,6 +54,3 @@ index 6438631..6776229 100644 if (r < 0) return r; --- -1.7.10.4 - diff --git a/logind-ignore-non-tty-non-x11-session-on-shutdown.patch b/logind-ignore-non-tty-non-x11-session-on-shutdown.patch index 163f41d6..116d101a 100644 --- a/logind-ignore-non-tty-non-x11-session-on-shutdown.patch +++ b/logind-ignore-non-tty-non-x11-session-on-shutdown.patch @@ -9,11 +9,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=890827 src/login/logind-dbus.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c -index 77a06f2..d64debe 100644 ---- a/src/login/logind-dbus.c -+++ b/src/login/logind-dbus.c -@@ -979,9 +979,12 @@ static int have_multiple_sessions( +Index: systemd-195/src/login/logind-dbus.c +=================================================================== +--- systemd-195.orig/src/login/logind-dbus.c ++++ systemd-195/src/login/logind-dbus.c +@@ -971,9 +971,12 @@ static int have_multiple_sessions( assert(m); @@ -28,6 +28,3 @@ index 77a06f2..d64debe 100644 return true; return false; --- -1.7.10.4 - diff --git a/rbind-mount.patch b/rbind-mount.patch index c2eb6b4f..8d8bb148 100644 --- a/rbind-mount.patch +++ b/rbind-mount.patch @@ -10,11 +10,11 @@ Fixes https://bugzilla.novell.com/show_bug.cgi?id=804575. src/fstab-generator/fstab-generator.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) -diff --git a/src/core/mount.c b/src/core/mount.c -index e3d298e..419cf27 100644 ---- a/src/core/mount.c -+++ b/src/core/mount.c -@@ -329,6 +329,12 @@ static bool mount_is_bind(MountParameters *p) { +Index: systemd-195/src/core/mount.c +=================================================================== +--- systemd-195.orig/src/core/mount.c ++++ systemd-195/src/core/mount.c +@@ -320,6 +320,12 @@ static bool mount_is_bind(MountParameter if (p->fstype && streq(p->fstype, "bind")) return true; @@ -27,11 +27,11 @@ index e3d298e..419cf27 100644 return false; } -diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c -index bfedded..9db4123 100644 ---- a/src/fstab-generator/fstab-generator.c -+++ b/src/fstab-generator/fstab-generator.c -@@ -178,7 +178,9 @@ static bool mount_is_bind(struct mntent *me) { +Index: systemd-195/src/fstab-generator/fstab-generator.c +=================================================================== +--- systemd-195.orig/src/fstab-generator/fstab-generator.c ++++ systemd-195/src/fstab-generator/fstab-generator.c +@@ -199,7 +199,9 @@ static bool mount_is_bind(struct mntent return hasmntopt(me, "bind") || @@ -42,6 +42,3 @@ index bfedded..9db4123 100644 } static bool mount_is_network(struct mntent *me) { --- -1.8.1.1 - diff --git a/service-forking-ignore-exit-status-main-process.patch b/service-forking-ignore-exit-status-main-process.patch index da4c695f..b9681f3f 100644 --- a/service-forking-ignore-exit-status-main-process.patch +++ b/service-forking-ignore-exit-status-main-process.patch @@ -9,11 +9,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=860464 src/core/service.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) -diff --git a/src/core/service.c b/src/core/service.c -index 8e9e112..7eaac0d 100644 ---- a/src/core/service.c -+++ b/src/core/service.c -@@ -2926,15 +2926,25 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { +Index: systemd-195/src/core/service.c +=================================================================== +--- systemd-195.orig/src/core/service.c ++++ systemd-195/src/core/service.c +@@ -2978,15 +2978,25 @@ static void service_sigchld_event(Unit * s->main_pid = 0; exec_status_exit(&s->main_exec_status, &s->exec_context, pid, code, status); @@ -43,6 +43,3 @@ index 8e9e112..7eaac0d 100644 } log_struct(f == SERVICE_SUCCESS ? LOG_DEBUG : LOG_NOTICE, --- -1.7.10.4 - diff --git a/socket-improve-error-message.patch b/socket-improve-error-message.patch index cb0f735a..506c4dcd 100644 --- a/socket-improve-error-message.patch +++ b/socket-improve-error-message.patch @@ -8,11 +8,11 @@ Subject: [PATCH] socket: improve error message when we cannot spawn the src/core/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/core/socket.c b/src/core/socket.c -index c095981..f4f40af 100644 ---- a/src/core/socket.c -+++ b/src/core/socket.c -@@ -1542,7 +1542,7 @@ static void socket_enter_running(Socket *s, int cfd) { +Index: systemd-195/src/core/socket.c +=================================================================== +--- systemd-195.orig/src/core/socket.c ++++ systemd-195/src/core/socket.c +@@ -1510,7 +1510,7 @@ static void socket_enter_running(Socket return; fail: @@ -21,6 +21,3 @@ index c095981..f4f40af 100644 socket_enter_stop_pre(s, SOCKET_FAILURE_RESOURCES); if (cfd >= 0) --- -1.7.10.4 - diff --git a/socket-verbose-error-message.patch b/socket-verbose-error-message.patch index 6d3d6f62..6a36c5ef 100644 --- a/socket-verbose-error-message.patch +++ b/socket-verbose-error-message.patch @@ -14,11 +14,11 @@ Dimitris src/core/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/core/socket.c b/src/core/socket.c -index 9b5bcb6..49e795e 100644 ---- a/src/core/socket.c -+++ b/src/core/socket.c -@@ -1484,7 +1484,7 @@ static void socket_enter_running(Socket *s, int cfd) { +Index: systemd-195/src/core/socket.c +=================================================================== +--- systemd-195.orig/src/core/socket.c ++++ systemd-195/src/core/socket.c +@@ -1441,7 +1441,7 @@ static void socket_enter_running(Socket Service *service; if (s->n_connections >= s->max_connections) { @@ -27,6 +27,3 @@ index 9b5bcb6..49e795e 100644 close_nointr_nofail(cfd); return; } --- -1.7.10.4 - diff --git a/systemctl-no-assert-on-reboot-without-dbus.patch b/systemctl-no-assert-on-reboot-without-dbus.patch index 9b8412fb..c2f9afe6 100644 --- a/systemctl-no-assert-on-reboot-without-dbus.patch +++ b/systemctl-no-assert-on-reboot-without-dbus.patch @@ -9,11 +9,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=889624 src/systemctl/systemctl.c | 3 +++ 1 file changed, 3 insertions(+) -diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c -index 0def1a2..bfa4d45 100644 ---- a/src/systemctl/systemctl.c -+++ b/src/systemctl/systemctl.c -@@ -1738,6 +1738,9 @@ static int reboot_with_logind(DBusConnection *bus, enum action a) { +Index: systemd-195/src/systemctl/systemctl.c +=================================================================== +--- systemd-195.orig/src/systemctl/systemctl.c ++++ systemd-195/src/systemctl/systemctl.c +@@ -1744,6 +1744,9 @@ static int reboot_with_logind(DBusConnec const char *method; dbus_bool_t interactive = true; @@ -23,6 +23,3 @@ index 0def1a2..bfa4d45 100644 polkit_agent_open_if_enabled(); switch (a) { --- -1.7.10.4 - diff --git a/systemctl-verbose-message-on-missing-install.patch b/systemctl-verbose-message-on-missing-install.patch index e6e88ac1..93383820 100644 --- a/systemctl-verbose-message-on-missing-install.patch +++ b/systemctl-verbose-message-on-missing-install.patch @@ -12,11 +12,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=884438 src/systemctl/systemctl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c -index 6d01756..3abd7dc 100644 ---- a/src/systemctl/systemctl.c -+++ b/src/systemctl/systemctl.c -@@ -3782,7 +3782,16 @@ static int enable_unit(DBusConnection *bus, char **args) { +Index: systemd-195/src/systemctl/systemctl.c +=================================================================== +--- systemd-195.orig/src/systemctl/systemctl.c ++++ systemd-195/src/systemctl/systemctl.c +@@ -3783,7 +3783,16 @@ static int enable_unit(DBusConnection *b } if (carries_install_info == 0) @@ -34,6 +34,3 @@ index 6d01756..3abd7dc 100644 finish: if (m) --- -1.7.10.4 - diff --git a/systemd-cgls-fix-piping-output.patch b/systemd-cgls-fix-piping-output.patch index 8c09be4e..b7871980 100644 --- a/systemd-cgls-fix-piping-output.patch +++ b/systemd-cgls-fix-piping-output.patch @@ -10,11 +10,11 @@ https://bugs.freedesktop.org/show_bug.cgi?id=56644 src/shared/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/src/shared/util.c b/src/shared/util.c -index 4cf928f..d771d32 100644 ---- a/src/shared/util.c -+++ b/src/shared/util.c -@@ -3803,7 +3803,7 @@ int fd_columns(int fd) { +Index: systemd-195/src/shared/util.c +=================================================================== +--- systemd-195.orig/src/shared/util.c ++++ systemd-195/src/shared/util.c +@@ -3806,7 +3806,7 @@ int fd_columns(int fd) { unsigned columns(void) { const char *e; @@ -23,7 +23,7 @@ index 4cf928f..d771d32 100644 if (_likely_(cached_columns > 0)) return cached_columns; -@@ -3811,7 +3811,7 @@ unsigned columns(void) { +@@ -3814,7 +3814,7 @@ unsigned columns(void) { c = 0; e = getenv("COLUMNS"); if (e) @@ -32,6 +32,3 @@ index 4cf928f..d771d32 100644 if (c <= 0) c = fd_columns(STDOUT_FILENO); --- -1.7.10.4 - diff --git a/systemd.changes b/systemd.changes index bad5b461..83663a86 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 20 10:14:59 UTC 2013 - rmilasan@suse.com + +- udev: re-add persistent network rules (bnc#809843). + add: 1026-re-add-persistent-net.patch +- rebase all patches, ensure that they apply properly. + ------------------------------------------------------------------- Thu Feb 21 14:45:12 UTC 2013 - fcrozat@suse.com diff --git a/systemd.spec b/systemd.spec index 8ad72466..efa76c0a 100644 --- a/systemd.spec +++ b/systemd.spec @@ -329,6 +329,8 @@ Patch1023: 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch Patch1024: 1024-udev-usb_id-parse-only-size-bytes-of-the-descriptors.patch # PATCH-FIX-UPSTREAM 1025-udev-expose-new-ISO9660-properties-from-libblkid.patch Patch1025: 1025-udev-expose-new-ISO9660-properties-from-libblkid.patch +# PATCH-FIX-OPENSUSE 1026-re-add-persistent-net.patch +Patch1026: 1026-re-add-persistent-net.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -514,6 +516,7 @@ cp %{SOURCE7} m4/ %patch1023 -p1 %patch1024 -p1 %patch1025 -p1 +%patch1026 -p1 #systemd %patch1 -p1 @@ -1122,6 +1125,8 @@ fi %{_prefix}/lib/udev/scsi_id %{_prefix}/lib/udev/v4l_id %{_prefix}/lib/udev/write_dev_root_rule +%{_prefix}/lib/udev/write_net_rules +%{_prefix}/lib/udev/rule_generator.functions %dir %{_prefix}/lib/udev/keymaps %{_prefix}/lib/udev/keymaps/* %{_prefix}/lib/udev/keyboard-force-release.sh diff --git a/var-run-lock.patch b/var-run-lock.patch index 8d645de9..3f87b078 100644 --- a/var-run-lock.patch +++ b/var-run-lock.patch @@ -22,7 +22,7 @@ Index: systemd-195/Makefile.am nodist_systemunit_DATA = \ units/getty@.service \ units/serial-getty@.service \ -@@ -3864,9 +3870,11 @@ systemd-install-data-hook: +@@ -3874,9 +3880,11 @@ systemd-install-data-hook: ( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \ rm -f systemd-remount-fs.service \ systemd-fsck-root.service \ @@ -34,7 +34,7 @@ Index: systemd-195/Makefile.am $(LN_S) ../tmp.mount tmp.mount ) ( cd $(DESTDIR)$(userunitdir) && \ rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \ -@@ -3954,6 +3962,12 @@ if TARGET_MAGEIA +@@ -3964,6 +3972,12 @@ if TARGET_MAGEIA rm -f display-manager.service ) endif