SHA256
1
0
forked from pool/systemd

Accepting request 160211 from Base:System

Please checkin also to openSUSE 12.3

- 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/request/show/160211
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=134
This commit is contained in:
Stephan Kulow 2013-03-22 11:08:23 +00:00 committed by Git OBS Bridge
commit 781828a4c2
28 changed files with 608 additions and 306 deletions

View File

@ -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 <md@Linux.IT>
+
+# 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 <http://www.gnu.org/licenses/>.
+
+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=<name> 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 <md@Linux.IT>
+# Copyright (C) 2007 Kay Sievers <kay.sievers@vrfy.org>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+# debug, if UDEV_LOG=<debug>
+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

View File

@ -13,11 +13,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=870622
units/serial-getty@.service.m4 | 3 +-- units/serial-getty@.service.m4 | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-) 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/units/getty@.service.m4 b/units/getty@.service.m4 Index: systemd-195/units/getty@.service.m4
index b5875ce..810c23f 100644 ===================================================================
--- a/units/getty@.service.m4 --- systemd-195.orig/units/getty@.service.m4
+++ b/units/getty@.service.m4 +++ systemd-195/units/getty@.service.m4
@@ -43,9 +43,8 @@ IgnoreOnIsolate=yes @@ -41,9 +41,8 @@ IgnoreOnIsolate=yes
ConditionPathExists=/dev/tty0 ConditionPathExists=/dev/tty0
[Service] [Service]
@ -28,11 +28,11 @@ index b5875ce..810c23f 100644
Type=idle Type=idle
Restart=always Restart=always
RestartSec=0 RestartSec=0
diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4 Index: systemd-195/units/serial-getty@.service.m4
index a6bbd71..c411dc1 100644 ===================================================================
--- a/units/serial-getty@.service.m4 --- systemd-195.orig/units/serial-getty@.service.m4
+++ b/units/serial-getty@.service.m4 +++ systemd-195/units/serial-getty@.service.m4
@@ -39,8 +39,7 @@ Before=getty.target @@ -37,8 +37,7 @@ Before=getty.target
IgnoreOnIsolate=yes IgnoreOnIsolate=yes
[Service] [Service]
@ -42,6 +42,3 @@ index a6bbd71..c411dc1 100644
Type=idle Type=idle
Restart=always Restart=always
RestartSec=0 RestartSec=0
--
1.7.10.4

View File

@ -15,11 +15,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=870577
src/shared/util.c | 8 ++++---- src/shared/util.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-) 3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/libsystemd-daemon/sd-daemon.c b/src/libsystemd-daemon/sd-daemon.c Index: systemd-195/src/libsystemd-daemon/sd-daemon.c
index 863ac75..480db3b 100644 ===================================================================
--- a/src/libsystemd-daemon/sd-daemon.c --- systemd-195.orig/src/libsystemd-daemon/sd-daemon.c
+++ b/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_environment) { @@ -88,7 +88,7 @@ _sd_export_ int sd_listen_fds(int unset_
goto finish; goto finish;
} }
@ -28,7 +28,7 @@ index 863ac75..480db3b 100644
r = -EINVAL; r = -EINVAL;
goto finish; 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; goto finish;
} }
@ -37,10 +37,10 @@ index 863ac75..480db3b 100644
r = -EINVAL; r = -EINVAL;
goto finish; goto finish;
} }
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c Index: systemd-195/src/shared/conf-parser.c
index 4bf3147..9f5c07c 100644 ===================================================================
--- a/src/shared/conf-parser.c --- systemd-195.orig/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c +++ systemd-195/src/shared/conf-parser.c
@@ -865,7 +865,7 @@ int config_parse_mode( @@ -865,7 +865,7 @@ int config_parse_mode(
errno = 0; errno = 0;
@ -50,11 +50,11 @@ index 4bf3147..9f5c07c 100644
log_error("[%s:%u] Failed to parse mode value, ignoring: %s", filename, line, rvalue); log_error("[%s:%u] Failed to parse mode value, ignoring: %s", filename, line, rvalue);
return 0; return 0;
} }
diff --git a/src/shared/util.c b/src/shared/util.c Index: systemd-195/src/shared/util.c
index 8ec83e4..23832fe 100644 ===================================================================
--- a/src/shared/util.c --- systemd-195.orig/src/shared/util.c
+++ b/src/shared/util.c +++ systemd-195/src/shared/util.c
@@ -377,7 +377,7 @@ int safe_atou(const char *s, unsigned *ret_u) { @@ -388,7 +388,7 @@ int safe_atou(const char *s, unsigned *r
errno = 0; errno = 0;
l = strtoul(s, &x, 0); l = strtoul(s, &x, 0);
@ -63,7 +63,7 @@ index 8ec83e4..23832fe 100644
return errno ? -errno : -EINVAL; return errno ? -errno : -EINVAL;
if ((unsigned long) (unsigned) l != l) 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; errno = 0;
l = strtol(s, &x, 0); l = strtol(s, &x, 0);
@ -72,7 +72,7 @@ index 8ec83e4..23832fe 100644
return errno ? -errno : -EINVAL; return errno ? -errno : -EINVAL;
if ((long) (int) l != l) 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; errno = 0;
l = strtoull(s, &x, 0); l = strtoull(s, &x, 0);
@ -81,7 +81,7 @@ index 8ec83e4..23832fe 100644
return errno ? -errno : -EINVAL; return errno ? -errno : -EINVAL;
*ret_llu = l; *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; errno = 0;
l = strtoll(s, &x, 0); l = strtoll(s, &x, 0);
@ -90,6 +90,3 @@ index 8ec83e4..23832fe 100644
return errno ? -errno : -EINVAL; return errno ? -errno : -EINVAL;
*ret_lli = l; *ret_lli = l;
--
1.7.10.4

View File

@ -13,11 +13,11 @@ https://bugs.freedesktop.org/show_bug.cgi?id=56874
src/core/load-fragment.c | 69 +++++++++++++++++++++------------------------- src/core/load-fragment.c | 69 +++++++++++++++++++++-------------------------
1 file changed, 31 insertions(+), 38 deletions(-) 1 file changed, 31 insertions(+), 38 deletions(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c Index: systemd-195/src/core/load-fragment.c
index 6759255..01f9484 100644 ===================================================================
--- a/src/core/load-fragment.c --- systemd-195.orig/src/core/load-fragment.c
+++ b/src/core/load-fragment.c +++ systemd-195/src/core/load-fragment.c
@@ -86,7 +86,7 @@ int config_parse_unit_deps( @@ -85,7 +85,7 @@ int config_parse_unit_deps(
assert(rvalue); assert(rvalue);
FOREACH_WORD_QUOTED(w, l, rvalue, state) { FOREACH_WORD_QUOTED(w, l, rvalue, state) {
@ -26,7 +26,7 @@ index 6759255..01f9484 100644
int r; int r;
t = strndup(w, l); t = strndup(w, l);
@@ -94,15 +94,13 @@ int config_parse_unit_deps( @@ -93,15 +93,13 @@ int config_parse_unit_deps(
return -ENOMEM; return -ENOMEM;
k = unit_name_printf(u, t); k = unit_name_printf(u, t);
@ -44,7 +44,7 @@ index 6759255..01f9484 100644
} }
return 0; return 0;
@@ -757,22 +755,25 @@ int config_parse_exec_cpu_affinity( @@ -739,22 +737,25 @@ int config_parse_exec_cpu_affinity(
assert(data); assert(data);
FOREACH_WORD_QUOTED(w, l, rvalue, state) { FOREACH_WORD_QUOTED(w, l, rvalue, state) {
@ -76,7 +76,7 @@ index 6759255..01f9484 100644
return 0; 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")) else if (first_word(w, "noroot-locked"))
c->secure_bits |= SECURE_NOROOT_LOCKED; c->secure_bits |= SECURE_NOROOT_LOCKED;
else { else {
@ -86,7 +86,7 @@ index 6759255..01f9484 100644
return 0; return 0;
} }
} }
@@ -890,7 +892,7 @@ int config_parse_bounding_set( @@ -872,7 +874,7 @@ int config_parse_bounding_set(
* interface. */ * interface. */
FOREACH_WORD_QUOTED(w, l, rvalue, state) { FOREACH_WORD_QUOTED(w, l, rvalue, state) {
@ -95,7 +95,7 @@ index 6759255..01f9484 100644
int r; int r;
cap_value_t cap; cap_value_t cap;
@@ -899,10 +901,9 @@ int config_parse_bounding_set( @@ -881,10 +883,9 @@ int config_parse_bounding_set(
return -ENOMEM; return -ENOMEM;
r = cap_from_name(t, &cap); r = cap_from_name(t, &cap);
@ -108,7 +108,7 @@ index 6759255..01f9484 100644
continue; continue;
} }
@@ -968,7 +969,7 @@ int config_parse_unit_cgroup( @@ -950,7 +951,7 @@ int config_parse_unit_cgroup(
char *state; char *state;
FOREACH_WORD_QUOTED(w, l, rvalue, state) { FOREACH_WORD_QUOTED(w, l, rvalue, state) {
@ -117,7 +117,7 @@ index 6759255..01f9484 100644
int r; int r;
t = strndup(w, l); t = strndup(w, l);
@@ -976,22 +977,17 @@ int config_parse_unit_cgroup( @@ -958,22 +959,17 @@ int config_parse_unit_cgroup(
return -ENOMEM; return -ENOMEM;
k = unit_full_printf(u, t); k = unit_full_printf(u, t);
@ -145,7 +145,7 @@ index 6759255..01f9484 100644
return 0; return 0;
} }
} }
@@ -1351,33 +1347,30 @@ int config_parse_service_sockets( @@ -1333,33 +1329,30 @@ int config_parse_service_sockets(
assert(data); assert(data);
FOREACH_WORD_QUOTED(w, l, rvalue, state) { FOREACH_WORD_QUOTED(w, l, rvalue, state) {
@ -184,7 +184,7 @@ index 6759255..01f9484 100644
} }
return 0; 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) { FOREACH_WORD_QUOTED(w, l, rvalue, state) {
int id; int id;
@ -205,6 +205,3 @@ index 6759255..01f9484 100644
continue; continue;
} }
--
1.7.10.4

View File

@ -7,11 +7,11 @@ Subject: [PATCH] cryptsetup-generator: state file name in error messages
src/cryptsetup/cryptsetup-generator.c | 4 ++-- src/cryptsetup/cryptsetup-generator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c Index: systemd-195/src/cryptsetup/cryptsetup-generator.c
index ef16fbc..6e7b707 100644 ===================================================================
--- a/src/cryptsetup/cryptsetup-generator.c --- systemd-195.orig/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c +++ systemd-195/src/cryptsetup/cryptsetup-generator.c
@@ -108,7 +108,7 @@ static int create_disk( @@ -230,7 +230,7 @@ static int create_disk(
f = fopen(p, "wxe"); f = fopen(p, "wxe");
if (!f) { if (!f) {
r = -errno; r = -errno;
@ -20,7 +20,7 @@ index ef16fbc..6e7b707 100644
goto fail; goto fail;
} }
@@ -160,7 +160,7 @@ static int create_disk( @@ -283,7 +283,7 @@ static int create_disk(
if (ferror(f)) { if (ferror(f)) {
r = -errno; r = -errno;
@ -29,6 +29,3 @@ index ef16fbc..6e7b707 100644
goto fail; goto fail;
} }
--
1.7.10.4

View File

@ -9,11 +9,11 @@ so let's do that.
src/delta/delta.c | 2 +- src/delta/delta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/delta/delta.c b/src/delta/delta.c Index: systemd-195/src/delta/delta.c
index cc34208..a65cea5 100644 ===================================================================
--- a/src/delta/delta.c --- systemd-195.orig/src/delta/delta.c
+++ b/src/delta/delta.c +++ systemd-195/src/delta/delta.c
@@ -352,7 +352,7 @@ static int parse_argv(int argc, char *argv[]) { @@ -375,7 +375,7 @@ static int parse_argv(int argc, char *ar
assert(argc >= 1); assert(argc >= 1);
assert(argv); assert(argv);
@ -22,6 +22,3 @@ index cc34208..a65cea5 100644
switch (c) { switch (c) {
--
1.7.10.4

View File

@ -9,11 +9,11 @@ with BindToDevice=lo would never be activated.
src/core/socket.c | 2 +- src/core/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/socket.c b/src/core/socket.c Index: systemd-195/src/core/socket.c
index fcbcdbe..d755040 100644 ===================================================================
--- a/src/core/socket.c --- systemd-195.orig/src/core/socket.c
+++ b/src/core/socket.c +++ systemd-195/src/core/socket.c
@@ -308,7 +308,7 @@ static int socket_add_device_link(Socket *s) { @@ -293,7 +293,7 @@ static int socket_add_device_link(Socket
assert(s); assert(s);
@ -22,6 +22,3 @@ index fcbcdbe..d755040 100644
return 0; return 0;
if (asprintf(&t, "/sys/subsystem/net/devices/%s", s->bind_to_device) < 0) if (asprintf(&t, "/sys/subsystem/net/devices/%s", s->bind_to_device) < 0)
--
1.7.10.4

View File

@ -7,11 +7,11 @@ Subject: [PATCH] util: fix bad memory access
src/shared/util.c | 1 - src/shared/util.c | 1 -
1 file changed, 1 deletion(-) 1 file changed, 1 deletion(-)
diff --git a/src/shared/util.c b/src/shared/util.c Index: systemd-195/src/shared/util.c
index 0161f3e..8e14096 100644 ===================================================================
--- a/src/shared/util.c --- systemd-195.orig/src/shared/util.c
+++ b/src/shared/util.c +++ systemd-195/src/shared/util.c
@@ -439,7 +439,6 @@ int get_parent_of_pid(pid_t pid, pid_t *_ppid) { @@ -543,7 +543,6 @@ int get_parent_of_pid(pid_t pid, pid_t *
if (!fgets(line, sizeof(line), f)) { if (!fgets(line, sizeof(line), f)) {
r = feof(f) ? -EIO : -errno; r = feof(f) ? -EIO : -errno;
@ -19,6 +19,3 @@ index 0161f3e..8e14096 100644
return r; return r;
} }
--
1.7.10.4

View File

@ -11,11 +11,11 @@ If failing, print just the offending mount flag.
src/core/load-fragment.c | 17 ++++++++++++----- src/core/load-fragment.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-) 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c Index: systemd-195/src/core/load-fragment.c
index 01f9484..6933e1a 100644 ===================================================================
--- a/src/core/load-fragment.c --- systemd-195.orig/src/core/load-fragment.c
+++ b/src/core/load-fragment.c +++ systemd-195/src/core/load-fragment.c
@@ -1101,15 +1101,22 @@ int config_parse_exec_mount_flags( @@ -1083,15 +1083,22 @@ int config_parse_exec_mount_flags(
assert(rvalue); assert(rvalue);
assert(data); assert(data);
@ -43,6 +43,3 @@ index 01f9484..6933e1a 100644
return 0; return 0;
} }
} }
--
1.7.10.4

View File

@ -17,11 +17,11 @@ some confusion, so give a hint what migt be wrong.
src/fstab-generator/fstab-generator.c | 10 ++++++++-- src/fstab-generator/fstab-generator.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-) 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c Index: systemd-195/src/fstab-generator/fstab-generator.c
index 7b3bf11..ba55f2c 100644 ===================================================================
--- a/src/fstab-generator/fstab-generator.c --- systemd-195.orig/src/fstab-generator/fstab-generator.c
+++ b/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, struct mntent *me) { @@ -111,7 +111,10 @@ static int add_swap(const char *what, st
f = fopen(unit, "wxe"); f = fopen(unit, "wxe");
if (!f) { if (!f) {
r = -errno; r = -errno;
@ -33,7 +33,7 @@ index 7b3bf11..ba55f2c 100644
goto finish; 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"); f = fopen(unit, "wxe");
if (!f) { if (!f) {
r = -errno; r = -errno;
@ -45,6 +45,3 @@ index 7b3bf11..ba55f2c 100644
goto finish; goto finish;
} }
--
1.7.10.4

View File

@ -13,7 +13,7 @@ Index: systemd-195/src/hostname/hostnamed.c
return 0; 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) { 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 (isempty(data[PROP_STATIC_HOSTNAME])) {
if (unlink("/etc/hostname") < 0) 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; return 0;
} }

View File

@ -7,11 +7,11 @@ Subject: [PATCH] hostnamectl: fix parsing of --no-ask-password
src/hostname/hostnamectl.c | 4 ++++ src/hostname/hostnamectl.c | 4 ++++
1 file changed, 4 insertions(+) 1 file changed, 4 insertions(+)
diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c Index: systemd-195/src/hostname/hostnamectl.c
index b7ae5cc..265c7ec 100644 ===================================================================
--- a/src/hostname/hostnamectl.c --- systemd-195.orig/src/hostname/hostnamectl.c
+++ b/src/hostname/hostnamectl.c +++ systemd-195/src/hostname/hostnamectl.c
@@ -403,6 +403,10 @@ static int parse_argv(int argc, char *argv[]) { @@ -402,6 +402,10 @@ static int parse_argv(int argc, char *ar
arg_set_static = true; arg_set_static = true;
break; break;
@ -22,6 +22,3 @@ index b7ae5cc..265c7ec 100644
case '?': case '?':
return -EINVAL; return -EINVAL;
--
1.7.10.4

View File

@ -7,99 +7,27 @@ Subject: [PATCH] util: fix possible integer overflows
src/shared/util.c | 6 ++++++ src/shared/util.c | 6 ++++++
1 file changed, 6 insertions(+) 1 file changed, 6 insertions(+)
diff --git a/src/shared/util.c b/src/shared/util.c Index: systemd-195/src/shared/util.c
index 2d4a4c1..e2f8b1f 100644 ===================================================================
--- a/src/shared/util.c --- systemd-195.orig/src/shared/util.c
+++ b/src/shared/util.c +++ systemd-195/src/shared/util.c
@@ -148,6 +148,9 @@ usec_t timespec_load(const struct timespec *ts) { @@ -152,6 +152,9 @@ usec_t timespec_load(const struct timesp
ts->tv_nsec == (long) -1) ts->tv_nsec == (long) -1)
return (usec_t) -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) -1;
+ +
return return
(usec_t) ts->tv_sec * USEC_PER_SEC + (usec_t) ts->tv_sec * USEC_PER_SEC +
(usec_t) ts->tv_nsec / NSEC_PER_USEC; (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) tv->tv_usec == (suseconds_t) -1)
return (usec_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) -1;
+ +
return return
(usec_t) tv->tv_sec * USEC_PER_SEC + (usec_t) tv->tv_sec * USEC_PER_SEC +
(usec_t) tv->tv_usec; (usec_t) tv->tv_usec;
--
1.7.10.4
From 49371bb50e0fe6e9e90309a20006bcfd9e2fa8f4 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
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 <mschmidt@redhat.com>
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

View File

@ -8,11 +8,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=872193
src/journal/journal-send.c | 20 +++++++++++++++++++- src/journal/journal-send.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-) 1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c Index: systemd-195/src/journal/journal-send.c
index 7a91569..bd8f887 100644 ===================================================================
--- a/src/journal/journal-send.c --- systemd-195.orig/src/journal/journal-send.c
+++ b/src/journal/journal-send.c +++ systemd-195/src/journal/journal-send.c
@@ -219,6 +219,7 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) { @@ -208,6 +208,7 @@ _public_ int sd_journal_sendv(const stru
* be a tmpfs, and one that is available from early boot on * be a tmpfs, and one that is available from early boot on
* and where unprivileged users can create files. */ * and where unprivileged users can create files. */
char path[] = "/dev/shm/journal.XXXXXX"; char path[] = "/dev/shm/journal.XXXXXX";
@ -20,7 +20,7 @@ index 7a91569..bd8f887 100644
if (_unlikely_(!iov)) if (_unlikely_(!iov))
return -EINVAL; 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; saved_errno = errno;
@ -29,7 +29,7 @@ index 7a91569..bd8f887 100644
l = alloca(sizeof(uint64_t) * n); l = alloca(sizeof(uint64_t) * n);
for (i = 0; i < n; i++) { 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; goto finish;
} }
@ -39,7 +39,7 @@ index 7a91569..bd8f887 100644
nl = memchr(iov[i].iov_base, '\n', iov[i].iov_len); nl = memchr(iov[i].iov_base, '\n', iov[i].iov_len);
if (nl) { if (nl) {
if (_unlikely_(nl < c)) { 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"); IOVEC_SET_STRING(w[j++], "\n");
} }
@ -60,6 +60,3 @@ index 7a91569..bd8f887 100644
fd = journal_fd(); fd = journal_fd();
if (_unlikely_(fd < 0)) { if (_unlikely_(fd < 0)) {
r = fd; r = fd;
--
1.7.10.4

View File

@ -9,11 +9,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=882212
src/locale/localectl.c | 2 +- src/locale/localectl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/locale/localectl.c b/src/locale/localectl.c Index: systemd-195/src/locale/localectl.c
index fa73bca..383a17d 100644 ===================================================================
--- a/src/locale/localectl.c --- systemd-195.orig/src/locale/localectl.c
+++ b/src/locale/localectl.c +++ systemd-195/src/locale/localectl.c
@@ -537,7 +537,7 @@ static int set_x11_keymap(DBusConnection *bus, char **args, unsigned n) { @@ -535,7 +535,7 @@ static int set_x11_keymap(DBusConnection
layout = args[1]; layout = args[1];
model = n > 2 ? args[2] : ""; model = n > 2 ? args[2] : "";
variant = n > 3 ? args[3] : ""; variant = n > 3 ? args[3] : "";
@ -22,6 +22,3 @@ index fa73bca..383a17d 100644
b = arg_convert; b = arg_convert;
return bus_method_call_with_reply( return bus_method_call_with_reply(
--
1.7.10.4

View File

@ -12,11 +12,11 @@ Given that glibc supports both ways, localectl should too.
src/locale/localectl.c | 101 ++++++++++++++++++++++++++++++++++++++++-------- src/locale/localectl.c | 101 ++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 85 insertions(+), 16 deletions(-) 1 file changed, 85 insertions(+), 16 deletions(-)
diff --git a/src/locale/localectl.c b/src/locale/localectl.c Index: systemd-195/src/locale/localectl.c
index 5d35f9c..b3acb3e 100644 ===================================================================
--- a/src/locale/localectl.c --- systemd-195.orig/src/locale/localectl.c
+++ b/src/locale/localectl.c +++ systemd-195/src/locale/localectl.c
@@ -266,7 +266,7 @@ finish: @@ -265,7 +265,7 @@ finish:
return r; return r;
} }
@ -25,7 +25,7 @@ index 5d35f9c..b3acb3e 100644
/* Stolen from glibc... */ /* Stolen from glibc... */
struct locarhead { 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 struct namehashent *e;
const void *p = MAP_FAILED; const void *p = MAP_FAILED;
_cleanup_close_ int fd = -1; _cleanup_close_ int fd = -1;
@ -49,7 +49,7 @@ index 5d35f9c..b3acb3e 100644
r = -errno; r = -errno;
goto finish; 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); strv_sort(l);
pager_open_if_enabled(); 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; r = 0;
finish: finish:
@ -158,6 +158,3 @@ index 5d35f9c..b3acb3e 100644
return r; return r;
} }
--
1.7.10.4

View File

@ -11,10 +11,10 @@ file 71-seat.rules.in: All framebuffer devices have this tag
src/login/logind.c | 12 ++---------- src/login/logind.c | 12 ++----------
2 files changed, 3 insertions(+), 11 deletions(-) 2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/src/login/71-seat.rules.in b/src/login/71-seat.rules.in Index: systemd-195/src/login/71-seat.rules.in
index f554d7f..4f1a9a5 100644 ===================================================================
--- a/src/login/71-seat.rules.in --- systemd-195.orig/src/login/71-seat.rules.in
+++ b/src/login/71-seat.rules.in +++ systemd-195/src/login/71-seat.rules.in
@@ -10,7 +10,7 @@ ACTION=="remove", GOTO="seat_end" @@ -10,7 +10,7 @@ ACTION=="remove", GOTO="seat_end"
TAG=="uaccess", SUBSYSTEM!="sound", TAG+="seat" TAG=="uaccess", SUBSYSTEM!="sound", TAG+="seat"
SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat" SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat"
@ -24,11 +24,11 @@ index f554d7f..4f1a9a5 100644
SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat" SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat"
# 'Plugable' USB hub, sound, network, graphics adapter # 'Plugable' USB hub, sound, network, graphics adapter
diff --git a/src/login/logind.c b/src/login/logind.c Index: systemd-195/src/login/logind.c
index 6438631..6776229 100644 ===================================================================
--- a/src/login/logind.c --- systemd-195.orig/src/login/logind.c
+++ b/src/login/logind.c +++ systemd-195/src/login/logind.c
@@ -459,11 +459,7 @@ int manager_enumerate_devices(Manager *m) { @@ -450,11 +450,7 @@ int manager_enumerate_devices(Manager *m
goto finish; goto finish;
} }
@ -41,7 +41,7 @@ index 6438631..6776229 100644
if (r < 0) if (r < 0)
goto finish; 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) if (!m->udev_seat_monitor)
return -ENOMEM; return -ENOMEM;
@ -54,6 +54,3 @@ index 6438631..6776229 100644
if (r < 0) if (r < 0)
return r; return r;
--
1.7.10.4

View File

@ -9,11 +9,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=890827
src/login/logind-dbus.c | 7 +++++-- src/login/logind-dbus.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-) 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c Index: systemd-195/src/login/logind-dbus.c
index 77a06f2..d64debe 100644 ===================================================================
--- a/src/login/logind-dbus.c --- systemd-195.orig/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c +++ systemd-195/src/login/logind-dbus.c
@@ -979,9 +979,12 @@ static int have_multiple_sessions( @@ -971,9 +971,12 @@ static int have_multiple_sessions(
assert(m); assert(m);
@ -28,6 +28,3 @@ index 77a06f2..d64debe 100644
return true; return true;
return false; return false;
--
1.7.10.4

View File

@ -10,11 +10,11 @@ Fixes https://bugzilla.novell.com/show_bug.cgi?id=804575.
src/fstab-generator/fstab-generator.c | 4 +++- src/fstab-generator/fstab-generator.c | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-) 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/core/mount.c b/src/core/mount.c Index: systemd-195/src/core/mount.c
index e3d298e..419cf27 100644 ===================================================================
--- a/src/core/mount.c --- systemd-195.orig/src/core/mount.c
+++ b/src/core/mount.c +++ systemd-195/src/core/mount.c
@@ -329,6 +329,12 @@ static bool mount_is_bind(MountParameters *p) { @@ -320,6 +320,12 @@ static bool mount_is_bind(MountParameter
if (p->fstype && streq(p->fstype, "bind")) if (p->fstype && streq(p->fstype, "bind"))
return true; return true;
@ -27,11 +27,11 @@ index e3d298e..419cf27 100644
return false; return false;
} }
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c Index: systemd-195/src/fstab-generator/fstab-generator.c
index bfedded..9db4123 100644 ===================================================================
--- a/src/fstab-generator/fstab-generator.c --- systemd-195.orig/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c +++ systemd-195/src/fstab-generator/fstab-generator.c
@@ -178,7 +178,9 @@ static bool mount_is_bind(struct mntent *me) { @@ -199,7 +199,9 @@ static bool mount_is_bind(struct mntent
return return
hasmntopt(me, "bind") || hasmntopt(me, "bind") ||
@ -42,6 +42,3 @@ index bfedded..9db4123 100644
} }
static bool mount_is_network(struct mntent *me) { static bool mount_is_network(struct mntent *me) {
--
1.8.1.1

View File

@ -9,11 +9,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=860464
src/core/service.c | 18 ++++++++++++++---- src/core/service.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-) 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/core/service.c b/src/core/service.c Index: systemd-195/src/core/service.c
index 8e9e112..7eaac0d 100644 ===================================================================
--- a/src/core/service.c --- systemd-195.orig/src/core/service.c
+++ b/src/core/service.c +++ systemd-195/src/core/service.c
@@ -2926,15 +2926,25 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { @@ -2978,15 +2978,25 @@ static void service_sigchld_event(Unit *
s->main_pid = 0; s->main_pid = 0;
exec_status_exit(&s->main_exec_status, &s->exec_context, pid, code, status); 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, log_struct(f == SERVICE_SUCCESS ? LOG_DEBUG : LOG_NOTICE,
--
1.7.10.4

View File

@ -8,11 +8,11 @@ Subject: [PATCH] socket: improve error message when we cannot spawn the
src/core/socket.c | 2 +- src/core/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/socket.c b/src/core/socket.c Index: systemd-195/src/core/socket.c
index c095981..f4f40af 100644 ===================================================================
--- a/src/core/socket.c --- systemd-195.orig/src/core/socket.c
+++ b/src/core/socket.c +++ systemd-195/src/core/socket.c
@@ -1542,7 +1542,7 @@ static void socket_enter_running(Socket *s, int cfd) { @@ -1510,7 +1510,7 @@ static void socket_enter_running(Socket
return; return;
fail: fail:
@ -21,6 +21,3 @@ index c095981..f4f40af 100644
socket_enter_stop_pre(s, SOCKET_FAILURE_RESOURCES); socket_enter_stop_pre(s, SOCKET_FAILURE_RESOURCES);
if (cfd >= 0) if (cfd >= 0)
--
1.7.10.4

View File

@ -14,11 +14,11 @@ Dimitris
src/core/socket.c | 2 +- src/core/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/socket.c b/src/core/socket.c Index: systemd-195/src/core/socket.c
index 9b5bcb6..49e795e 100644 ===================================================================
--- a/src/core/socket.c --- systemd-195.orig/src/core/socket.c
+++ b/src/core/socket.c +++ systemd-195/src/core/socket.c
@@ -1484,7 +1484,7 @@ static void socket_enter_running(Socket *s, int cfd) { @@ -1441,7 +1441,7 @@ static void socket_enter_running(Socket
Service *service; Service *service;
if (s->n_connections >= s->max_connections) { if (s->n_connections >= s->max_connections) {
@ -27,6 +27,3 @@ index 9b5bcb6..49e795e 100644
close_nointr_nofail(cfd); close_nointr_nofail(cfd);
return; return;
} }
--
1.7.10.4

View File

@ -9,11 +9,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=889624
src/systemctl/systemctl.c | 3 +++ src/systemctl/systemctl.c | 3 +++
1 file changed, 3 insertions(+) 1 file changed, 3 insertions(+)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c Index: systemd-195/src/systemctl/systemctl.c
index 0def1a2..bfa4d45 100644 ===================================================================
--- a/src/systemctl/systemctl.c --- systemd-195.orig/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c +++ systemd-195/src/systemctl/systemctl.c
@@ -1738,6 +1738,9 @@ static int reboot_with_logind(DBusConnection *bus, enum action a) { @@ -1744,6 +1744,9 @@ static int reboot_with_logind(DBusConnec
const char *method; const char *method;
dbus_bool_t interactive = true; dbus_bool_t interactive = true;
@ -23,6 +23,3 @@ index 0def1a2..bfa4d45 100644
polkit_agent_open_if_enabled(); polkit_agent_open_if_enabled();
switch (a) { switch (a) {
--
1.7.10.4

View File

@ -12,11 +12,11 @@ https://bugzilla.redhat.com/show_bug.cgi?id=884438
src/systemctl/systemctl.c | 11 ++++++++++- src/systemctl/systemctl.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-) 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c Index: systemd-195/src/systemctl/systemctl.c
index 6d01756..3abd7dc 100644 ===================================================================
--- a/src/systemctl/systemctl.c --- systemd-195.orig/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c +++ systemd-195/src/systemctl/systemctl.c
@@ -3782,7 +3782,16 @@ static int enable_unit(DBusConnection *bus, char **args) { @@ -3783,7 +3783,16 @@ static int enable_unit(DBusConnection *b
} }
if (carries_install_info == 0) if (carries_install_info == 0)
@ -34,6 +34,3 @@ index 6d01756..3abd7dc 100644
finish: finish:
if (m) if (m)
--
1.7.10.4

View File

@ -10,11 +10,11 @@ https://bugs.freedesktop.org/show_bug.cgi?id=56644
src/shared/util.c | 4 ++-- src/shared/util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/shared/util.c b/src/shared/util.c Index: systemd-195/src/shared/util.c
index 4cf928f..d771d32 100644 ===================================================================
--- a/src/shared/util.c --- systemd-195.orig/src/shared/util.c
+++ b/src/shared/util.c +++ systemd-195/src/shared/util.c
@@ -3803,7 +3803,7 @@ int fd_columns(int fd) { @@ -3806,7 +3806,7 @@ int fd_columns(int fd) {
unsigned columns(void) { unsigned columns(void) {
const char *e; const char *e;
@ -23,7 +23,7 @@ index 4cf928f..d771d32 100644
if (_likely_(cached_columns > 0)) if (_likely_(cached_columns > 0))
return cached_columns; return cached_columns;
@@ -3811,7 +3811,7 @@ unsigned columns(void) { @@ -3814,7 +3814,7 @@ unsigned columns(void) {
c = 0; c = 0;
e = getenv("COLUMNS"); e = getenv("COLUMNS");
if (e) if (e)
@ -32,6 +32,3 @@ index 4cf928f..d771d32 100644
if (c <= 0) if (c <= 0)
c = fd_columns(STDOUT_FILENO); c = fd_columns(STDOUT_FILENO);
--
1.7.10.4

View File

@ -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 Thu Feb 21 14:45:12 UTC 2013 - fcrozat@suse.com

View File

@ -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 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 # PATCH-FIX-UPSTREAM 1025-udev-expose-new-ISO9660-properties-from-libblkid.patch
Patch1025: 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 %description
Systemd is a system and service manager, compatible with SysV and LSB Systemd is a system and service manager, compatible with SysV and LSB
@ -514,6 +516,7 @@ cp %{SOURCE7} m4/
%patch1023 -p1 %patch1023 -p1
%patch1024 -p1 %patch1024 -p1
%patch1025 -p1 %patch1025 -p1
%patch1026 -p1
#systemd #systemd
%patch1 -p1 %patch1 -p1
@ -1122,6 +1125,8 @@ fi
%{_prefix}/lib/udev/scsi_id %{_prefix}/lib/udev/scsi_id
%{_prefix}/lib/udev/v4l_id %{_prefix}/lib/udev/v4l_id
%{_prefix}/lib/udev/write_dev_root_rule %{_prefix}/lib/udev/write_dev_root_rule
%{_prefix}/lib/udev/write_net_rules
%{_prefix}/lib/udev/rule_generator.functions
%dir %{_prefix}/lib/udev/keymaps %dir %{_prefix}/lib/udev/keymaps
%{_prefix}/lib/udev/keymaps/* %{_prefix}/lib/udev/keymaps/*
%{_prefix}/lib/udev/keyboard-force-release.sh %{_prefix}/lib/udev/keyboard-force-release.sh

View File

@ -22,7 +22,7 @@ Index: systemd-195/Makefile.am
nodist_systemunit_DATA = \ nodist_systemunit_DATA = \
units/getty@.service \ units/getty@.service \
units/serial-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 && \ ( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
rm -f systemd-remount-fs.service \ rm -f systemd-remount-fs.service \
systemd-fsck-root.service \ systemd-fsck-root.service \
@ -34,7 +34,7 @@ Index: systemd-195/Makefile.am
$(LN_S) ../tmp.mount tmp.mount ) $(LN_S) ../tmp.mount tmp.mount )
( cd $(DESTDIR)$(userunitdir) && \ ( cd $(DESTDIR)$(userunitdir) && \
rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \ 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 ) rm -f display-manager.service )
endif endif