From bd48810a2362a88e9d4d1a1ea883ef350118321a8ceddb8ff022994d0bce8a7a Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Tue, 12 Feb 2013 09:21:01 +0000 Subject: [PATCH] Accepting request 155189 from home:rmilasan:branches:Base:System - usb_id: ensure we have a valid serial number as a string (bnc#779493). add: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch - cdrom_id: created links for the default cd/dvd drive (bnc#783054). add: 1021-create-default-links-for-primary-cd_dvd-drive.patch - Add cryptsetup-accept-read-only.patch: accept "read-only" in addition to "readonly" in crypttab - Update parse-multiline-env-file.patch to correctly handle commented lines (bnc#793411) - usb_id: ensure we have a valid serial number as a string (bnc#779493). add: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch - cdrom_id: created links for the default cd/dvd drive (bnc#783054). add: 1021-create-default-links-for-primary-cd_dvd-drive.patch OBS-URL: https://build.opensuse.org/request/show/155189 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=342 --- ...s-have-a-very-bogus-or-strage-serial.patch | 62 +++++++++++++++++++ ...fault-links-for-primary-cd_dvd-drive.patch | 15 +++++ systemd-mini.changes | 16 +++++ systemd-mini.spec | 11 +++- systemd.changes | 8 +++ systemd.spec | 6 ++ 6 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch create mode 100644 1021-create-default-links-for-primary-cd_dvd-drive.patch diff --git a/1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch b/1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch new file mode 100644 index 00000000..4832bbb5 --- /dev/null +++ b/1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch @@ -0,0 +1,62 @@ +From 2ffcfb9b45262271019d1751cafc895c3dae8f0e Mon Sep 17 00:00:00 2001 +From: Robert Milasan +Date: Sun, 10 Feb 2013 11:00:20 +0100 +Subject: [PATCH] usb_id: some strange devices have a very bogus or strange serial + numer, making a mess in /dev/disk/by-id. Let's check if the + serial number is a valid, otherwise don't use it. + +--- + src/udev/udev-builtin-usb_id.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/src/udev/udev-builtin-usb_id.c b/src/udev/udev-builtin-usb_id.c +index 7ce401d..9e407c5 100644 +--- a/src/udev/udev-builtin-usb_id.c ++++ b/src/udev/udev-builtin-usb_id.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -31,6 +32,26 @@ + + #include "udev.h" + ++static bool validate_string(const char *str) ++{ ++ const char *s; ++ ++ if (!str) ++ return false; ++ ++ for (s = str; *s != '\0'; s++) { ++ if ((*s >= 'a' && *s <= 'z') || ++ (*s >= 'A' && *s <= 'Z') || ++ (*s >= '0' && *s <= '9') || ++ *s == '-' || *s == '_') ++ continue; ++ else ++ return false; ++ } ++ ++ return true; ++} ++ + static void set_usb_iftype(char *to, int if_class_num, size_t len) + { + const char *type = "generic"; +@@ -431,6 +452,8 @@ fallback: + const char *usb_serial; + + usb_serial = udev_device_get_sysattr_value(dev_usb, "serial"); ++ if (!validate_string(usb_serial)) ++ usb_serial = NULL; + if (usb_serial) { + util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1); + util_replace_chars(serial_str, NULL); +-- +1.7.10.4 + diff --git a/1021-create-default-links-for-primary-cd_dvd-drive.patch b/1021-create-default-links-for-primary-cd_dvd-drive.patch new file mode 100644 index 00000000..d44af024 --- /dev/null +++ b/1021-create-default-links-for-primary-cd_dvd-drive.patch @@ -0,0 +1,15 @@ +Index: systemd-195/rules/60-cdrom_id.rules +=================================================================== +--- systemd-195.orig/rules/60-cdrom_id.rules ++++ systemd-195/rules/60-cdrom_id.rules +@@ -15,6 +15,9 @@ ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdr + # enable the receiving of media eject button events + IMPORT{program}="cdrom_id --lock-media $devnode" + +-KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100" ++KERNEL=="sr0", ENV{ID_CDROM}=="1", SYMLINK+="cdrom", OPTIONS+="link_priority=-100" ++KERNEL=="sr0", ENV{ID_CDROM_CD_RW}=="1", SYMLINK+="cdrw", OPTIONS+="link_priority=-100" ++KERNEL=="sr0", ENV{ID_CDROM_DVD}=="1", SYMLINK+="dvd", OPTIONS+="link_priority=-100" ++KERNEL=="sr0", ENV{ID_CDROM_DVD_RW}=="1", SYMLINK+="dvdrw", OPTIONS+="link_priority=-100" + + LABEL="cdrom_end" diff --git a/systemd-mini.changes b/systemd-mini.changes index 2d31a58c..748aea63 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Tue Feb 12 09:16:23 UTC 2013 - rmilasan@suse.com + +- usb_id: ensure we have a valid serial number as a string (bnc#779493). + add: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +- cdrom_id: created links for the default cd/dvd drive (bnc#783054). + add: 1021-create-default-links-for-primary-cd_dvd-drive.patch + +------------------------------------------------------------------- +Fri Feb 1 16:27:45 UTC 2013 - fcrozat@suse.com + +- Add cryptsetup-accept-read-only.patch: accept "read-only" in + addition to "readonly" in crypttab +- Update parse-multiline-env-file.patch to correctly handle + commented lines (bnc#793411) + ------------------------------------------------------------------- Tue Jan 29 13:32:30 UTC 2013 - rmilasan@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 2c6d46c9..701b42db 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -260,8 +260,10 @@ Patch122: improve-man-environment.patch Patch123: tmpfiles-X-type.patch # PATCH-FIX-UPSTREAM systemd-fix-merge-ignore-dependencies.patch fcrozat@suse.com bnc#800365 -- fix merging with --ignore-dependencies waiting for dependencies Patch124: systemd-fix-merge-ignore-dependencies.patch -# PATCH-FIX-UPSTREAM journalctl-require-argument-for-priority +# PATCH-FIX-UPSTREAM journalctl-require-argument-for-priority Patch125: journalctl-require-argument-for-priority +# PATCH-FIX-UPSTREAM cryptsetup-accept-read-only.patch fcrozat@suse.com -- Accept read-only as well as readonly as parameters for crypttab +Patch126: cryptsetup-accept-read-only.patch # udev patches # PATCH-FIX-OPENSUSE 1001-Reinstate-TIMEOUT-handling.patch @@ -302,6 +304,10 @@ Patch1017: 1017-udev-use-usec_t-and-now.patch Patch1018: 1018-keymap-add-aditional-support.patch # PATCH-FIX-UPSTREAM 1019-udev-Fix-device-matching-in-the-accelerometer.patch Patch1019: 1019-udev-Fix-device-matching-in-the-accelerometer.patch +# PATCH-FIX-OPENSUSE 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +Patch1020: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +# PATCH-FIX-OPENSUSE 1021-create-default-links-for-primary-cd_dvd-drive.patch +Patch1021: 1021-create-default-links-for-primary-cd_dvd-drive.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -481,6 +487,8 @@ cp %{SOURCE7} m4/ %patch1017 -p1 %patch1018 -p1 %patch1019 -p1 +%patch1020 -p1 +%patch1021 -p1 #systemd %patch1 -p1 @@ -570,6 +578,7 @@ cp %{SOURCE7} m4/ %patch123 -p1 %patch124 -p1 %patch125 -p1 +%patch126 -p1 %build autoreconf -fiv diff --git a/systemd.changes b/systemd.changes index bb00736a..748aea63 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Feb 12 09:16:23 UTC 2013 - rmilasan@suse.com + +- usb_id: ensure we have a valid serial number as a string (bnc#779493). + add: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +- cdrom_id: created links for the default cd/dvd drive (bnc#783054). + add: 1021-create-default-links-for-primary-cd_dvd-drive.patch + ------------------------------------------------------------------- Fri Feb 1 16:27:45 UTC 2013 - fcrozat@suse.com diff --git a/systemd.spec b/systemd.spec index f0731945..54acc848 100644 --- a/systemd.spec +++ b/systemd.spec @@ -299,6 +299,10 @@ Patch1017: 1017-udev-use-usec_t-and-now.patch Patch1018: 1018-keymap-add-aditional-support.patch # PATCH-FIX-UPSTREAM 1019-udev-Fix-device-matching-in-the-accelerometer.patch Patch1019: 1019-udev-Fix-device-matching-in-the-accelerometer.patch +# PATCH-FIX-OPENSUSE 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +Patch1020: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +# PATCH-FIX-OPENSUSE 1021-create-default-links-for-primary-cd_dvd-drive.patch +Patch1021: 1021-create-default-links-for-primary-cd_dvd-drive.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -478,6 +482,8 @@ cp %{SOURCE7} m4/ %patch1017 -p1 %patch1018 -p1 %patch1019 -p1 +%patch1020 -p1 +%patch1021 -p1 #systemd %patch1 -p1