diff --git a/1050-hwdb-add-ACCEL_LOCATION-property-to-parse_hwdb.py.patch b/1050-hwdb-add-ACCEL_LOCATION-property-to-parse_hwdb.py.patch new file mode 100644 index 0000000..4d69f92 --- /dev/null +++ b/1050-hwdb-add-ACCEL_LOCATION-property-to-parse_hwdb.py.patch @@ -0,0 +1,48 @@ +From fea96208a7fbe748e2aefbf0c52dafcbf691f05f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lu=C3=ADs=20Ferreira?= +Date: Sat, 13 Apr 2019 19:12:51 +0100 +Subject: [PATCH] hwdb: add ACCEL_LOCATION property to parse_hwdb.py +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Luís Ferreira +(cherry picked from commit ccf478417455ab1191571923fa640363d4c4b7a6) + +Related: RHEL-130979 +--- + hwdb/parse_hwdb.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py +index 4900a25778..6943c688eb 100755 +--- a/hwdb/parse_hwdb.py ++++ b/hwdb/parse_hwdb.py +@@ -128,6 +128,7 @@ def property_grammar(): + ('KEYBOARD_LED_NUMLOCK', Literal('0')), + ('KEYBOARD_LED_CAPSLOCK', Literal('0')), + ('ACCEL_MOUNT_MATRIX', mount_matrix), ++ ('ACCEL_LOCATION', STRING), + ) + fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE') + for name, val in props] +@@ -179,6 +180,10 @@ def check_one_default(prop, settings): + if len(defaults) > 1: + error('More than one star entry: {!r}', prop) + ++def check_one_accel_location(prop, value): ++ if value not in ['base', 'display']: ++ error('Wrong accel location: {!r}', prop) ++ + def check_one_mount_matrix(prop, value): + numbers = [s for s in value if s not in {';', ','}] + if len(numbers) != 9: +@@ -221,6 +226,8 @@ def check_properties(groups): + check_one_default(prop, parsed.VALUE.SETTINGS) + elif parsed.NAME == 'ACCEL_MOUNT_MATRIX': + check_one_mount_matrix(prop, parsed.VALUE) ++ elif parsed.NAME == 'ACCEL_LOCATION': ++ check_one_accel_location(prop, parsed.VALUE) + elif parsed.NAME.startswith('KEYBOARD_KEY_'): + check_one_keycode(prop, parsed.VALUE) + diff --git a/1051-hwdb-update-ACCEL_LOCATION-property-to-use-Or-instea.patch b/1051-hwdb-update-ACCEL_LOCATION-property-to-use-Or-instea.patch new file mode 100644 index 0000000..9292114 --- /dev/null +++ b/1051-hwdb-update-ACCEL_LOCATION-property-to-use-Or-instea.patch @@ -0,0 +1,46 @@ +From 36167a7b6617b0c8e1e15a91eccf5cdb19f0ee1b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lu=C3=ADs=20Ferreira?= +Date: Sun, 19 May 2019 19:22:41 +0100 +Subject: [PATCH] hwdb: update ACCEL_LOCATION property to use Or instead of + QuotedString + +(cherry picked from commit 331e34fe1db427127aefa3b5ca6d5b568ecf86d2) + +Related: RHEL-130979 +--- + hwdb/parse_hwdb.py | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py +index 6943c688eb..99fb5b1438 100755 +--- a/hwdb/parse_hwdb.py ++++ b/hwdb/parse_hwdb.py +@@ -128,7 +128,7 @@ def property_grammar(): + ('KEYBOARD_LED_NUMLOCK', Literal('0')), + ('KEYBOARD_LED_CAPSLOCK', Literal('0')), + ('ACCEL_MOUNT_MATRIX', mount_matrix), +- ('ACCEL_LOCATION', STRING), ++ ('ACCEL_LOCATION', Or(('display', 'base'))), + ) + fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE') + for name, val in props] +@@ -180,10 +180,6 @@ def check_one_default(prop, settings): + if len(defaults) > 1: + error('More than one star entry: {!r}', prop) + +-def check_one_accel_location(prop, value): +- if value not in ['base', 'display']: +- error('Wrong accel location: {!r}', prop) +- + def check_one_mount_matrix(prop, value): + numbers = [s for s in value if s not in {';', ','}] + if len(numbers) != 9: +@@ -226,8 +222,6 @@ def check_properties(groups): + check_one_default(prop, parsed.VALUE.SETTINGS) + elif parsed.NAME == 'ACCEL_MOUNT_MATRIX': + check_one_mount_matrix(prop, parsed.VALUE) +- elif parsed.NAME == 'ACCEL_LOCATION': +- check_one_accel_location(prop, parsed.VALUE) + elif parsed.NAME.startswith('KEYBOARD_KEY_'): + check_one_keycode(prop, parsed.VALUE) + diff --git a/1052-test-support-general-properties-in-hwdb-files.patch b/1052-test-support-general-properties-in-hwdb-files.patch new file mode 100644 index 0000000..592555a --- /dev/null +++ b/1052-test-support-general-properties-in-hwdb-files.patch @@ -0,0 +1,55 @@ +From 1c772da6f3e7a588e8a73af4e26947d25c3053a8 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Tue, 25 Nov 2025 17:45:27 +0100 +Subject: [PATCH] test: support general properties in hwdb files + +Loosely cherry-picked from aa549ff3972b067c4225db0a845f5c638842fba3. + +rhel-only +Related: RHEL-130979 +--- + hwdb/parse_hwdb.py | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py +index 99fb5b1438..c94ad9bea6 100755 +--- a/hwdb/parse_hwdb.py ++++ b/hwdb/parse_hwdb.py +@@ -70,13 +70,28 @@ TYPES = {'mouse': ('usb', 'bluetooth', 'ps2', '*'), + 'sensor': ('modalias', ), + } + ++# Patterns that are used to set general properties on a device ++GENERAL_MATCHES = {'acpi', ++ 'bluetooth', ++ 'usb', ++ 'pci', ++ 'sdio', ++ 'vmbus', ++ 'OUI', ++ } ++ ++ + @lru_cache() + def hwdb_grammar(): + ParserElement.setDefaultWhitespaceChars('') + + prefix = Or(category + ':' + Or(conn) + ':' + for category, conn in TYPES.items()) +- matchline = Combine(prefix + Word(printables + ' ' + '®')) + EOL ++ ++ matchline_typed = Combine(prefix + Word(printables + ' ' + '®')) ++ matchline_general = Combine(Or(GENERAL_MATCHES) + ':' + Word(printables)) ++ matchline = (matchline_typed | matchline_general) + EOL ++ + propertyline = (White(' ', exact=1).suppress() + + Combine(UDEV_TAG - '=' - Word(alphanums + '_=:@*.!-;, "') - Optional(pythonStyleComment)) + + EOL) +@@ -104,6 +119,7 @@ def property_grammar(): + ('MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL', INTEGER), + ('MOUSE_WHEEL_CLICK_COUNT', INTEGER), + ('MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL', INTEGER), ++ ('ID_AUTOSUSPEND', Literal('1')), + ('ID_INPUT', Literal('1')), + ('ID_INPUT_ACCELEROMETER', Literal('1')), + ('ID_INPUT_JOYSTICK', Literal('1')), diff --git a/1053-hwdb-Relax-parsing-script-to-allow-0-and-1-for-all-I.patch b/1053-hwdb-Relax-parsing-script-to-allow-0-and-1-for-all-I.patch new file mode 100644 index 0000000..78971fc --- /dev/null +++ b/1053-hwdb-Relax-parsing-script-to-allow-0-and-1-for-all-I.patch @@ -0,0 +1,56 @@ +From 77fec6b9de7ae11fe69d0ff48cfd4406345be3f9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Daase?= +Date: Fri, 8 Jan 2021 10:32:36 +0100 +Subject: [PATCH] hwdb: Relax parsing script to allow 0 and 1 for all ID_* + properties + +(cherry picked from commit ad0d9c0109d45c12c6517684d84ea033cf8d54a7) + +Related: RHEL-130979 +--- + hwdb/parse_hwdb.py | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py +index c94ad9bea6..d15ae0470c 100755 +--- a/hwdb/parse_hwdb.py ++++ b/hwdb/parse_hwdb.py +@@ -119,22 +119,22 @@ def property_grammar(): + ('MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL', INTEGER), + ('MOUSE_WHEEL_CLICK_COUNT', INTEGER), + ('MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL', INTEGER), +- ('ID_AUTOSUSPEND', Literal('1')), +- ('ID_INPUT', Literal('1')), +- ('ID_INPUT_ACCELEROMETER', Literal('1')), +- ('ID_INPUT_JOYSTICK', Literal('1')), +- ('ID_INPUT_KEY', Literal('1')), +- ('ID_INPUT_KEYBOARD', Literal('1')), +- ('ID_INPUT_MOUSE', Literal('1')), +- ('ID_INPUT_POINTINGSTICK', Literal('1')), +- ('ID_INPUT_SWITCH', Literal('1')), +- ('ID_INPUT_TABLET', Literal('1')), +- ('ID_INPUT_TABLET_PAD', Literal('1')), +- ('ID_INPUT_TOUCHPAD', Literal('1')), +- ('ID_INPUT_TOUCHSCREEN', Literal('1')), +- ('ID_INPUT_TRACKBALL', Literal('1')), +- ('MOUSE_WHEEL_TILT_HORIZONTAL', Literal('1')), +- ('MOUSE_WHEEL_TILT_VERTICAL', Literal('1')), ++ ('ID_AUTOSUSPEND', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_ACCELEROMETER', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_JOYSTICK', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_KEY', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_KEYBOARD', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_MOUSE', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_POINTINGSTICK', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_SWITCH', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_TABLET', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_TABLET_PAD', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_TOUCHPAD', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_TOUCHSCREEN', Or((Literal('0'), Literal('1')))), ++ ('ID_INPUT_TRACKBALL', Or((Literal('0'), Literal('1')))), ++ ('MOUSE_WHEEL_TILT_HORIZONTAL', Or((Literal('0'), Literal('1')))), ++ ('MOUSE_WHEEL_TILT_VERTICAL', Or((Literal('0'), Literal('1')))), + ('POINTINGSTICK_SENSITIVITY', INTEGER), + ('POINTINGSTICK_CONST_ACCEL', REAL), + ('ID_INPUT_JOYSTICK_INTEGRATION', Or(('internal', 'external'))), diff --git a/1054-hwdb-allow-spaces-in-usb-matches-and-similar-pattern.patch b/1054-hwdb-allow-spaces-in-usb-matches-and-similar-pattern.patch new file mode 100644 index 0000000..3945954 --- /dev/null +++ b/1054-hwdb-allow-spaces-in-usb-matches-and-similar-pattern.patch @@ -0,0 +1,28 @@ +From 6c95b29117469a5ecb22655fb561dceee04106e8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Fri, 17 Jul 2020 07:44:10 +0200 +Subject: [PATCH] hwdb: allow spaces in usb: matches and similar patterns + +In the past we didn't have any matches like that, so the parser was stricter +than necessary, but now we have, so allow that. + +(cherry picked from commit 457763aa0393a9f11e30071bb3794caf1a4f2f64) + +Related: RHEL-130979 +--- + hwdb/parse_hwdb.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py +index d15ae0470c..db26a5e4d4 100755 +--- a/hwdb/parse_hwdb.py ++++ b/hwdb/parse_hwdb.py +@@ -89,7 +89,7 @@ def hwdb_grammar(): + for category, conn in TYPES.items()) + + matchline_typed = Combine(prefix + Word(printables + ' ' + '®')) +- matchline_general = Combine(Or(GENERAL_MATCHES) + ':' + Word(printables)) ++ matchline_general = Combine(Or(GENERAL_MATCHES) + ':' + Word(printables + ' ' + '®')) + matchline = (matchline_typed | matchline_general) + EOL + + propertyline = (White(' ', exact=1).suppress() + diff --git a/1055-test-fix-parsing-of-60-seat.hwdb-and-60-keyboard.hwd.patch b/1055-test-fix-parsing-of-60-seat.hwdb-and-60-keyboard.hwd.patch new file mode 100644 index 0000000..125daeb --- /dev/null +++ b/1055-test-fix-parsing-of-60-seat.hwdb-and-60-keyboard.hwd.patch @@ -0,0 +1,83 @@ +From aa5ed0d813964222dfe337c0733d4586d7a4f647 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Tue, 25 Nov 2025 17:56:16 +0100 +Subject: [PATCH] test: fix parsing of 60-seat.hwdb and 60-keyboard.hwdb + +This includes changes for hwdb/parse_hwdb.py from commits: + - c0b2e69f8815881d51b68b4f73e6c7f8cc2417a1 + - d7d31692bf7cde5dce7f4ed3cae429a5b302a9f0 + - a136c2cdd84c93c2fa5e1cedb20f5acac80df5be + - and possibly others + +The hwdb changes from these commits were backported as part of +793dc4d9e32baba27eac1f37283a7485b0889803. + +rhel-only +Related: RHEL-130979 +--- + hwdb/parse_hwdb.py | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py +index db26a5e4d4..956b206b00 100755 +--- a/hwdb/parse_hwdb.py ++++ b/hwdb/parse_hwdb.py +@@ -34,7 +34,7 @@ try: + LineStart, LineEnd, + OneOrMore, Combine, Or, Optional, Suppress, Group, + nums, alphanums, printables, +- stringEnd, pythonStyleComment, QuotedString, ++ stringEnd, pythonStyleComment, + ParseBaseException) + except ImportError: + print('pyparsing is not available') +@@ -56,13 +56,13 @@ EOL = LineEnd().suppress() + EMPTYLINE = LineEnd() + COMMENTLINE = pythonStyleComment + EOL + INTEGER = Word(nums) +-STRING = QuotedString('"') + REAL = Combine((INTEGER + Optional('.' + Optional(INTEGER))) ^ ('.' + INTEGER)) + SIGNED_REAL = Combine(Optional(Word('-+')) + REAL) + UDEV_TAG = Word(string.ascii_uppercase, alphanums + '_') + + TYPES = {'mouse': ('usb', 'bluetooth', 'ps2', '*'), + 'evdev': ('name', 'atkbd', 'input'), ++ 'fb': ('pci'), + 'id-input': ('modalias'), + 'touchpad': ('i8042', 'rmi', 'bluetooth', 'usb'), + 'joystick': ('i8042', 'rmi', 'bluetooth', 'usb'), +@@ -93,7 +93,8 @@ def hwdb_grammar(): + matchline = (matchline_typed | matchline_general) + EOL + + propertyline = (White(' ', exact=1).suppress() + +- Combine(UDEV_TAG - '=' - Word(alphanums + '_=:@*.!-;, "') - Optional(pythonStyleComment)) + ++ Combine(UDEV_TAG - '=' - Optional(Word(alphanums + '_=:@*.!-;, "')) ++ - Optional(pythonStyleComment)) + + EOL) + propertycomment = White(' ', exact=1) + pythonStyleComment + EOL + +@@ -113,6 +114,7 @@ def property_grammar(): + dpi_setting = (Optional('*')('DEFAULT') + INTEGER('DPI') + Suppress('@') + INTEGER('HZ'))('SETTINGS*') + mount_matrix_row = SIGNED_REAL + ',' + SIGNED_REAL + ',' + SIGNED_REAL + mount_matrix = (mount_matrix_row + ';' + mount_matrix_row + ';' + mount_matrix_row)('MOUNT_MATRIX') ++ xkb_setting = Optional(Word(alphanums + '+-/@._')) + + props = (('MOUSE_DPI', Group(OneOrMore(dpi_setting))), + ('MOUSE_WHEEL_CLICK_ANGLE', INTEGER), +@@ -139,12 +141,14 @@ def property_grammar(): + ('POINTINGSTICK_CONST_ACCEL', REAL), + ('ID_INPUT_JOYSTICK_INTEGRATION', Or(('internal', 'external'))), + ('ID_INPUT_TOUCHPAD_INTEGRATION', Or(('internal', 'external'))), +- ('XKB_FIXED_LAYOUT', STRING), +- ('XKB_FIXED_VARIANT', STRING), ++ ('XKB_FIXED_LAYOUT', xkb_setting), ++ ('XKB_FIXED_VARIANT', xkb_setting), ++ ('XKB_FIXED_MODEL', xkb_setting), + ('KEYBOARD_LED_NUMLOCK', Literal('0')), + ('KEYBOARD_LED_CAPSLOCK', Literal('0')), + ('ACCEL_MOUNT_MATRIX', mount_matrix), + ('ACCEL_LOCATION', Or(('display', 'base'))), ++ ('ID_TAG_MASTER_OF_SEAT', Literal('1')), + ) + fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE') + for name, val in props] diff --git a/1056-parse_hwdb-fix-compatibility-with-pyparsing-2.4.patch b/1056-parse_hwdb-fix-compatibility-with-pyparsing-2.4.patch new file mode 100644 index 0000000..6d0c462 --- /dev/null +++ b/1056-parse_hwdb-fix-compatibility-with-pyparsing-2.4.patch @@ -0,0 +1,54 @@ +From c85ce044e87038724cc1095d86ebd15b2da4564f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Tue, 8 Oct 2019 14:44:35 +0200 +Subject: [PATCH] parse_hwdb: fix compatibility with pyparsing 2.4.* + +pyparsing 2.3.1/2.4.0 had some changes to grouping of And matches, and as a +result we'd report 0 properties and 0 matches, and not really do any checks. + +With this change we get identical behaviour for pyparsing 2.3.1, 2.4.0, 2.4.2: + +$ hwdb/parse_hwdb.py +hwdb/60-evdev.hwdb: 72 match groups, 94 matches, 262 properties +hwdb/60-input-id.hwdb: 3 match groups, 3 matches, 4 properties +hwdb/60-keyboard.hwdb: 173 match groups, 256 matches, 872 properties +Keycode KBD_LCD_MENU1 unknown +Keycode KBD_LCD_MENU4 unknown +Keycode KBD_LCD_MENU2 unknown +Keycode KBD_LCD_MENU3 unknown +hwdb/60-sensor.hwdb: 101 match groups, 120 matches, 105 properties +hwdb/70-joystick.hwdb: 2 match groups, 3 matches, 2 properties +hwdb/70-mouse.hwdb: 104 match groups, 119 matches, 123 properties +hwdb/70-pointingstick.hwdb: 8 match groups, 30 matches, 11 properties +hwdb/70-touchpad.hwdb: 6 match groups, 9 matches, 6 properties + +(cherry picked from commit 2382a2e32b6076fa4603c958f84b46d5a5b13dfa) + +Related: RHEL-130979 +--- + hwdb/parse_hwdb.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py +index 956b206b00..8118ad4e3a 100755 +--- a/hwdb/parse_hwdb.py ++++ b/hwdb/parse_hwdb.py +@@ -103,7 +103,7 @@ def hwdb_grammar(): + (EMPTYLINE ^ stringEnd()).suppress()) + commentgroup = OneOrMore(COMMENTLINE).suppress() - EMPTYLINE.suppress() + +- grammar = OneOrMore(group('GROUPS*') ^ commentgroup) + stringEnd() ++ grammar = OneOrMore(Group(group)('GROUPS*') ^ commentgroup) + stringEnd() + + return grammar + +@@ -243,7 +243,8 @@ def check_properties(groups): + elif parsed.NAME == 'ACCEL_MOUNT_MATRIX': + check_one_mount_matrix(prop, parsed.VALUE) + elif parsed.NAME.startswith('KEYBOARD_KEY_'): +- check_one_keycode(prop, parsed.VALUE) ++ val = parsed.VALUE if isinstance(parsed.VALUE, str) else parsed.VALUE[0] ++ check_one_keycode(prop, val) + + def print_summary(fname, groups): + print('{}: {} match groups, {} matches, {} properties' diff --git a/1057-login-use-parse_uid-when-unmounting-user-runtime-dir.patch b/1057-login-use-parse_uid-when-unmounting-user-runtime-dir.patch new file mode 100644 index 0000000..acfead7 --- /dev/null +++ b/1057-login-use-parse_uid-when-unmounting-user-runtime-dir.patch @@ -0,0 +1,109 @@ +From 3d7dd494cd2c6cfe51f76de4fd0c8d2c6a80f0e4 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Mon, 9 Jul 2018 14:05:20 +0900 +Subject: [PATCH] login: use parse_uid() when unmounting user runtime directory + +When unmounting user runtime directory, only UID is necessary, +and the corresponding user may not exist anymore. +This makes first try to parse the input by parse_uid(), and only if it +fails, prase the input by get_user_creds(). + +Fixes #9541. + +(cherry picked from commit 86d18f3b09ec984ef3732567af992adb2dc77a8a) + +Resolves: RHEL-132175 +--- + src/login/user-runtime-dir.c | 57 +++++++++++++++++++++++------------- + 1 file changed, 36 insertions(+), 21 deletions(-) + +diff --git a/src/login/user-runtime-dir.c b/src/login/user-runtime-dir.c +index 9693821990..51b864c9f8 100644 +--- a/src/login/user-runtime-dir.c ++++ b/src/login/user-runtime-dir.c +@@ -110,8 +110,22 @@ static int user_remove_runtime_path(const char *runtime_path) { + return 0; + } + +-static int do_mount(const char *runtime_path, uid_t uid, gid_t gid) { ++static int do_mount(const char *user) { ++ char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)]; + size_t runtime_dir_size; ++ uid_t uid; ++ gid_t gid; ++ int r; ++ ++ r = get_user_creds(&user, &uid, &gid, NULL, NULL); ++ if (r < 0) ++ return log_error_errno(r, ++ r == -ESRCH ? "No such user \"%s\"" : ++ r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group" ++ : "Failed to look up user \"%s\": %m", ++ user); ++ ++ xsprintf(runtime_path, "/run/user/" UID_FMT, uid); + + assert_se(gather_configuration(&runtime_dir_size) == 0); + +@@ -119,16 +133,30 @@ static int do_mount(const char *runtime_path, uid_t uid, gid_t gid) { + return user_mkdir_runtime_path(runtime_path, uid, gid, runtime_dir_size); + } + +-static int do_umount(const char *runtime_path) { ++static int do_umount(const char *user) { ++ char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)]; ++ uid_t uid; ++ int r; ++ ++ /* The user may be already removed. So, first try to parse the string by parse_uid(), ++ * and if it fails, fallback to get_user_creds().*/ ++ if (parse_uid(user, &uid) < 0) { ++ r = get_user_creds(&user, &uid, NULL, NULL, NULL); ++ if (r < 0) ++ return log_error_errno(r, ++ r == -ESRCH ? "No such user \"%s\"" : ++ r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group" ++ : "Failed to look up user \"%s\": %m", ++ user); ++ } ++ ++ xsprintf(runtime_path, "/run/user/" UID_FMT, uid); ++ + log_debug("Will remove %s", runtime_path); + return user_remove_runtime_path(runtime_path); + } + + int main(int argc, char *argv[]) { +- const char *user; +- uid_t uid; +- gid_t gid; +- char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)]; + int r; + + log_parse_environment(); +@@ -145,23 +173,10 @@ int main(int argc, char *argv[]) { + + umask(0022); + +- user = argv[2]; +- r = get_user_creds(&user, &uid, &gid, NULL, NULL); +- if (r < 0) { +- log_error_errno(r, +- r == -ESRCH ? "No such user \"%s\"" : +- r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group" +- : "Failed to look up user \"%s\": %m", +- user); +- return EXIT_FAILURE; +- } +- +- xsprintf(runtime_path, "/run/user/" UID_FMT, uid); +- + if (streq(argv[1], "start")) +- r = do_mount(runtime_path, uid, gid); ++ r = do_mount(argv[2]); + else if (streq(argv[1], "stop")) +- r = do_umount(runtime_path); ++ r = do_umount(argv[2]); + else + assert_not_reached("Unknown verb!"); + diff --git a/1058-pid1-do-not-use-generated-strings-as-format-strings-.patch b/1058-pid1-do-not-use-generated-strings-as-format-strings-.patch new file mode 100644 index 0000000..afbce05 --- /dev/null +++ b/1058-pid1-do-not-use-generated-strings-as-format-strings-.patch @@ -0,0 +1,49 @@ +From 2b0d33678cbd86d87691d044a5c11aa981a2316e Mon Sep 17 00:00:00 2001 +From: Lincoln Ramsay +Date: Wed, 24 Mar 2021 17:37:25 +1000 +Subject: [PATCH] pid1: do not use generated strings as format strings (#19098) + +The generated string may include %, which will confuse both the +xprintf call, and the VA_FORMAT_ADVANCE macro. + +Pass the generated string as an argument to a "%s" format string +instead. + +(cherry picked from commit 7325a2b2d15af09a9389723d6153050130c0bd36) + +Resolves: RHEL-132317 +--- + src/core/transaction.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/core/transaction.c b/src/core/transaction.c +index 8196aba927..4d6cb01fa4 100644 +--- a/src/core/transaction.c ++++ b/src/core/transaction.c +@@ -395,7 +395,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi + j->unit->id, + unit_id == array ? "ordering cycle" : "dependency", + *unit_id, *job_type, +- unit_ids); ++ "%s", unit_ids); + + if (delete) { + const char *status; +@@ -404,7 +404,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi + "MESSAGE=%s: Job %s/%s deleted to break ordering cycle starting with %s/%s", + j->unit->id, delete->unit->id, job_type_to_string(delete->type), + j->unit->id, job_type_to_string(j->type), +- unit_ids); ++ "%s", unit_ids); + + if (log_get_show_color()) + status = ANSI_HIGHLIGHT_RED " SKIP " ANSI_NORMAL; +@@ -420,7 +420,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi + log_struct(LOG_ERR, + "MESSAGE=%s: Unable to break cycle starting with %s/%s", + j->unit->id, j->unit->id, job_type_to_string(j->type), +- unit_ids); ++ "%s", unit_ids); + + return sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC, + "Transaction order is cyclic. See system logs for details."); diff --git a/1059-core-transaction-make-merge_unit_ids-always-return-N.patch b/1059-core-transaction-make-merge_unit_ids-always-return-N.patch new file mode 100644 index 0000000..044c124 --- /dev/null +++ b/1059-core-transaction-make-merge_unit_ids-always-return-N.patch @@ -0,0 +1,57 @@ +From 1f6175b1b397293fe363f2c192dd2f994cbfe43d Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Sat, 18 Mar 2023 12:12:01 +0900 +Subject: [PATCH] core/transaction: make merge_unit_ids() always return + NUL-terminated string + +Follow-up for 924775e8ce49817f96df19c2b06356c12ecfc754. + +The loop run with `STRV_FOREACH_PAIR()`, hence `if (*(unit_id+1))` is +not a good way to detect if there exist a next entry. + +Fixes #26872. + +(cherry picked from commit 366eced4c81a15a25b9225347fa203aa67798b02) + +Resolves: RHEL-132317 +--- + src/core/transaction.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/src/core/transaction.c b/src/core/transaction.c +index 4d6cb01fa4..89cc1d0a4c 100644 +--- a/src/core/transaction.c ++++ b/src/core/transaction.c +@@ -322,22 +322,26 @@ _pure_ static bool unit_matters_to_anchor(Unit *u, Job *j) { + } + + static char* merge_unit_ids(const char* unit_log_field, char **pairs) { +- char **unit_id, **job_type, *ans = NULL; +- size_t alloc = 0, size = 0, next; ++ _cleanup_free_ char *ans = NULL; ++ char **unit_id, **job_type; ++ size_t alloc = 0, size = 0; + + STRV_FOREACH_PAIR(unit_id, job_type, pairs) { ++ size_t next; ++ ++ if (size > 0) ++ ans[size - 1] = '\n'; ++ + next = strlen(unit_log_field) + strlen(*unit_id); + if (!GREEDY_REALLOC(ans, alloc, size + next + 1)) { +- return mfree(ans); ++ return NULL; + } + + sprintf(ans + size, "%s%s", unit_log_field, *unit_id); +- if (*(unit_id+1)) +- ans[size + next] = '\n'; + size += next + 1; + } + +- return ans; ++ return TAKE_PTR(ans); + } + + static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsigned generation, sd_bus_error *e) { diff --git a/1060-core-transaction-make-merge_unit_ids-return-non-NULL.patch b/1060-core-transaction-make-merge_unit_ids-return-non-NULL.patch new file mode 100644 index 0000000..840c9b2 --- /dev/null +++ b/1060-core-transaction-make-merge_unit_ids-return-non-NULL.patch @@ -0,0 +1,27 @@ +From dc0b680699ec67ace0825724087487c3f5f82886 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Sat, 18 Mar 2023 12:17:54 +0900 +Subject: [PATCH] core/transaction: make merge_unit_ids() return non-NULL on + success + +(cherry picked from commit 999f16514367224cbc50cb3ccc1e4392e43f6811) + +Related: RHEL-132317 +--- + src/core/transaction.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/core/transaction.c b/src/core/transaction.c +index 89cc1d0a4c..cd80e7e111 100644 +--- a/src/core/transaction.c ++++ b/src/core/transaction.c +@@ -341,6 +341,9 @@ static char* merge_unit_ids(const char* unit_log_field, char **pairs) { + size += next + 1; + } + ++ if (!ans) ++ return strdup(""); ++ + return TAKE_PTR(ans); + } + diff --git a/1061-core-transaction-do-not-log-null.patch b/1061-core-transaction-do-not-log-null.patch new file mode 100644 index 0000000..e8af287 --- /dev/null +++ b/1061-core-transaction-do-not-log-null.patch @@ -0,0 +1,53 @@ +From 231be769332d2b699b9add3f8add7b8941c3a7aa Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Sat, 18 Mar 2023 12:15:10 +0900 +Subject: [PATCH] core/transaction: do not log "(null)" + +As we ignores the failure in merge_unit_ids(), so unit_ids may be NULL. + +(cherry picked from commit 5803c24da5cf543a55c4fce9009a9c5f2b18519a) + +Related: RHEL-132317 +--- + src/core/transaction.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/core/transaction.c b/src/core/transaction.c +index cd80e7e111..159c10c7c8 100644 +--- a/src/core/transaction.c ++++ b/src/core/transaction.c +@@ -6,6 +6,7 @@ + #include "alloc-util.h" + #include "bus-common-errors.h" + #include "bus-error.h" ++#include "string-util.h" + #include "terminal-util.h" + #include "transaction.h" + #include "dbus-unit.h" +@@ -402,7 +403,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi + j->unit->id, + unit_id == array ? "ordering cycle" : "dependency", + *unit_id, *job_type, +- "%s", unit_ids); ++ "%s", strna(unit_ids)); + + if (delete) { + const char *status; +@@ -411,7 +412,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi + "MESSAGE=%s: Job %s/%s deleted to break ordering cycle starting with %s/%s", + j->unit->id, delete->unit->id, job_type_to_string(delete->type), + j->unit->id, job_type_to_string(j->type), +- "%s", unit_ids); ++ "%s", strna(unit_ids)); + + if (log_get_show_color()) + status = ANSI_HIGHLIGHT_RED " SKIP " ANSI_NORMAL; +@@ -427,7 +428,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi + log_struct(LOG_ERR, + "MESSAGE=%s: Unable to break cycle starting with %s/%s", + j->unit->id, j->unit->id, job_type_to_string(j->type), +- "%s", unit_ids); ++ "%s", strna(unit_ids)); + + return sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC, + "Transaction order is cyclic. See system logs for details."); diff --git a/systemd.spec b/systemd.spec index b2124d0..8fcc417 100644 --- a/systemd.spec +++ b/systemd.spec @@ -13,7 +13,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 239 -Release: 82%{?dist}.9 +Release: 82%{?dist}.10 # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: System and Service Manager @@ -1099,6 +1099,18 @@ Patch1046: 1046-timer-don-t-run-service-immediately-after-restart-of.patch Patch1047: 1047-Revert-test-extend-testcase-to-ensure-controller-mem.patch Patch1048: 1048-cryptsetup-generator-refactor-add_crypttab_devices.patch Patch1049: 1049-cryptsetup-generator-continue-parsing-after-error.patch +Patch1050: 1050-hwdb-add-ACCEL_LOCATION-property-to-parse_hwdb.py.patch +Patch1051: 1051-hwdb-update-ACCEL_LOCATION-property-to-use-Or-instea.patch +Patch1052: 1052-test-support-general-properties-in-hwdb-files.patch +Patch1053: 1053-hwdb-Relax-parsing-script-to-allow-0-and-1-for-all-I.patch +Patch1054: 1054-hwdb-allow-spaces-in-usb-matches-and-similar-pattern.patch +Patch1055: 1055-test-fix-parsing-of-60-seat.hwdb-and-60-keyboard.hwd.patch +Patch1056: 1056-parse_hwdb-fix-compatibility-with-pyparsing-2.4.patch +Patch1057: 1057-login-use-parse_uid-when-unmounting-user-runtime-dir.patch +Patch1058: 1058-pid1-do-not-use-generated-strings-as-format-strings-.patch +Patch1059: 1059-core-transaction-make-merge_unit_ids-always-return-N.patch +Patch1060: 1060-core-transaction-make-merge_unit_ids-return-non-NULL.patch +Patch1061: 1061-core-transaction-do-not-log-null.patch %ifarch %{ix86} x86_64 aarch64 %global have_gnu_efi 1 @@ -1725,6 +1737,20 @@ fi %files tests -f .file-list-tests %changelog +* Tue Dec 02 2025 systemd maintenance team - 239-82.10 +- hwdb: add ACCEL_LOCATION property to parse_hwdb.py (RHEL-130979) +- hwdb: update ACCEL_LOCATION property to use Or instead of QuotedString (RHEL-130979) +- test: support general properties in hwdb files (RHEL-130979) +- hwdb: Relax parsing script to allow 0 and 1 for all ID_* properties (RHEL-130979) +- hwdb: allow spaces in usb: matches and similar patterns (RHEL-130979) +- test: fix parsing of 60-seat.hwdb and 60-keyboard.hwdb (RHEL-130979) +- parse_hwdb: fix compatibility with pyparsing 2.4.* (RHEL-130979) +- login: use parse_uid() when unmounting user runtime directory (RHEL-132175) +- pid1: do not use generated strings as format strings (#19098) (RHEL-132317) +- core/transaction: make merge_unit_ids() always return NUL-terminated string (RHEL-132317) +- core/transaction: make merge_unit_ids() return non-NULL on success (RHEL-132317) +- core/transaction: do not log "(null)" (RHEL-132317) + * Wed Nov 05 2025 systemd maintenance team - 239-82.9 - cryptsetup-generator: refactor add_crypttab_devices() (RHEL-38859) - cryptsetup-generator: continue parsing after error (RHEL-38859)