From 48512ca3f7865e300ff2cc09edc1cb8c4621dd9e Mon Sep 17 00:00:00 2001 From: eabdullin Date: Thu, 21 Sep 2023 18:03:58 +0000 Subject: [PATCH] import CS augeas-1.13.0-5.el9 --- ...y-add-new-directives-and-options-745.patch | 2 +- ...ump-parse-auto_reset_crashkernel-754.patch | 2 +- ...manage-Fix-parsing-of-ignoredirs-758.patch | 2 +- ...or-letter-types-allow-as-prefix-for-.patch | 164 ++++++++++++++++++ ...tespace-at-the-end-of-kernel-commnd-.patch | 44 +++++ SPECS/augeas.spec | 15 +- 6 files changed, 225 insertions(+), 4 deletions(-) create mode 100644 SOURCES/0004-Tmpfiles-allow-for-letter-types-allow-as-prefix-for-.patch create mode 100644 SOURCES/0005-lenses-Allow-whitespace-at-the-end-of-kernel-commnd-.patch diff --git a/SOURCES/0001-Chrony-add-new-directives-and-options-745.patch b/SOURCES/0001-Chrony-add-new-directives-and-options-745.patch index ea6b1ba..4297c64 100644 --- a/SOURCES/0001-Chrony-add-new-directives-and-options-745.patch +++ b/SOURCES/0001-Chrony-add-new-directives-and-options-745.patch @@ -1,7 +1,7 @@ From 08101c754aafab4d0f79367839bbd0d6012c31cf Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 2 Mar 2022 14:54:39 +0100 -Subject: [PATCH 1/3] Chrony: add new directives and options (#745) +Subject: [PATCH 1/5] Chrony: add new directives and options (#745) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/SOURCES/0002-Kdump-parse-auto_reset_crashkernel-754.patch b/SOURCES/0002-Kdump-parse-auto_reset_crashkernel-754.patch index 0c9b150..47fde06 100644 --- a/SOURCES/0002-Kdump-parse-auto_reset_crashkernel-754.patch +++ b/SOURCES/0002-Kdump-parse-auto_reset_crashkernel-754.patch @@ -1,7 +1,7 @@ From e0bce2e8c21ccc69729676e8dc6fa1e541aedee2 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 20 Apr 2022 10:13:06 +0200 -Subject: [PATCH 2/3] Kdump: parse "auto_reset_crashkernel" (#754) +Subject: [PATCH 2/5] Kdump: parse "auto_reset_crashkernel" (#754) The "auto_reset_crashkernel" keyword was introduced in the following kexec-tools patch set: diff --git a/SOURCES/0003-semanage-Fix-parsing-of-ignoredirs-758.patch b/SOURCES/0003-semanage-Fix-parsing-of-ignoredirs-758.patch index f1b417f..3939ef8 100644 --- a/SOURCES/0003-semanage-Fix-parsing-of-ignoredirs-758.patch +++ b/SOURCES/0003-semanage-Fix-parsing-of-ignoredirs-758.patch @@ -1,7 +1,7 @@ From aca3def462ab141c3991a2d27c44341b809cf970 Mon Sep 17 00:00:00 2001 From: rwmjones Date: Thu, 6 Oct 2022 12:15:56 +0100 -Subject: [PATCH 3/3] semanage: Fix parsing of ignoredirs (#758) +Subject: [PATCH 3/5] semanage: Fix parsing of ignoredirs (#758) From /etc/selinux/semanage.conf from a RHEL 9.1 system, this line caused problems: diff --git a/SOURCES/0004-Tmpfiles-allow-for-letter-types-allow-as-prefix-for-.patch b/SOURCES/0004-Tmpfiles-allow-for-letter-types-allow-as-prefix-for-.patch new file mode 100644 index 0000000..71048ca --- /dev/null +++ b/SOURCES/0004-Tmpfiles-allow-for-letter-types-allow-as-prefix-for-.patch @@ -0,0 +1,164 @@ +From 34749f9ea1af8e3fad9e60891beda0fe786cb0f2 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 24 Mar 2023 11:26:46 +0100 +Subject: [PATCH 4/5] Tmpfiles: allow '=', '~', '^' for letter types, allow ":" + as prefix for the mode + +* Tmpfiles: allow '=', '~', '^' for letter types + +Allow an equal sign, a tilde character and/or a caret for the type +specification: +- equal: strict file type enforcing +- tilde: base64-encoded content in the argument +- caret: credential name in the argument + +Fixes: #795 + +* Tmpfiles: allow ":" as prefix for the mode + +Represents a mode to be set only for new inodes. + +(cherry picked from commit 41b2a33ff02687fa53d69a012a1d47141b196a86) +--- + lenses/tests/test_tmpfiles.aug | 78 ++++++++++++++++++++++++++++++++++ + lenses/tmpfiles.aug | 9 ++-- + 2 files changed, 83 insertions(+), 4 deletions(-) + +diff --git a/lenses/tests/test_tmpfiles.aug b/lenses/tests/test_tmpfiles.aug +index 6ced069f..4bbd06a2 100644 +--- a/lenses/tests/test_tmpfiles.aug ++++ b/lenses/tests/test_tmpfiles.aug +@@ -97,6 +97,60 @@ Tree for *) + { "argument" = "-" } + } + ++ (* Variable: equal ++Example with an equal sign in the type *) ++ let equal = "d= /tmp/foo 0755 root root - -\n" ++ ++ (* Variable: equal_tree ++Tree for *) ++ let equal_tree = ++ { ++ "1" ++ { "type" = "d=" } ++ { "path" = "/tmp/foo" } ++ { "mode" = "0755" } ++ { "uid" = "root" } ++ { "gid" = "root" } ++ { "age" = "-" } ++ { "argument" = "-" } ++ } ++ ++ (* Variable: tilde ++Example with a tilde character in the type *) ++ let tilde = "w~ /tmp/foo 0755 root root - dGVzdAo=\n" ++ ++ (* Variable: tilde_tree ++Tree for *) ++ let tilde_tree = ++ { ++ "1" ++ { "type" = "w~" } ++ { "path" = "/tmp/foo" } ++ { "mode" = "0755" } ++ { "uid" = "root" } ++ { "gid" = "root" } ++ { "age" = "-" } ++ { "argument" = "dGVzdAo=" } ++ } ++ ++ (* Variable: caret ++Example with a caret in the type *) ++ let caret = "f^ /etc/motd.d/50-provision.conf - - - - login.motd\n" ++ ++ (* Variable: caret_tree ++Tree for *) ++ let caret_tree = ++ { ++ "1" ++ { "type" = "f^" } ++ { "path" = "/etc/motd.d/50-provision.conf" } ++ { "mode" = "-" } ++ { "uid" = "-" } ++ { "gid" = "-" } ++ { "age" = "-" } ++ { "argument" = "login.motd" } ++ } ++ + (* Variable: short + Example with only type and path *) + let short = "A+ /tmp/foo\n" +@@ -337,6 +391,22 @@ Tree for *) + { "mode" = "755" } + } + ++ (* Variable: mode_colon ++Mode field with colon prefix *) ++ let mode_colon = "d- /root :0700 root :root\n" ++ ++ (* Variable: mode_colon_tree ++Tree for *) ++ let mode_colon_tree = ++ { ++ "1" ++ { "type" = "d-" } ++ { "path" = "/root" } ++ { "mode" = ":0700" } ++ { "uid" = "root" } ++ { "gid" = ":root" } ++ } ++ + (************************************************************************ + * Group: INVALID EXAMPLES + *************************************************************************) +@@ -377,6 +447,12 @@ Invalid example that contain invalid mode (letter) *) + + test Tmpfiles.lns get minus = minus_tree + ++ test Tmpfiles.lns get equal = equal_tree ++ ++ test Tmpfiles.lns get tilde = tilde_tree ++ ++ test Tmpfiles.lns get caret = caret_tree ++ + test Tmpfiles.lns get short = short_tree + + test Tmpfiles.lns get short_mode = short_mode_tree +@@ -405,6 +481,8 @@ Invalid example that contain invalid mode (letter) *) + + test Tmpfiles.lns get mode3 = mode3_tree + ++ test Tmpfiles.lns get mode_colon = mode_colon_tree ++ + + (* failure cases *) + +diff --git a/lenses/tmpfiles.aug b/lenses/tmpfiles.aug +index 01b3003a..1163c84a 100644 +--- a/lenses/tmpfiles.aug ++++ b/lenses/tmpfiles.aug +@@ -50,15 +50,16 @@ Empty lines *) + + (* View: type + One letter. Some of them can have a "+" and all can have an +-exclamation mark ("!") and/or minus sign ("-"). ++exclamation mark ("!"), a minus sign ("-"), an equal sign ("="), ++a tilde character ("~") and/or a caret ("^"). + + Not all letters are valid. + *) +- let type = /([fFwdDevqQpLcbCxXrRzZtThHaAm]|[fFwpLcbaA]\+)!?-?/ ++ let type = /([fFwdDevqQpLcbCxXrRzZtThHaAm]|[fFwpLcbaA]\+)[-!=~^]*/ + + (* View: mode +-"-", or 3-4 bytes. Optionally starts with a "~". *) +- let mode = /(-|~?[0-7]{3,4})/ ++"-", or 3-4 bytes. Optionally starts with a "~" or a ":". *) ++ let mode = /(-|(~|:)?[0-7]{3,4})/ + + (* View: age + "-", or one of the formats seen in the manpage: 10d, 5seconds, 1y5days. +-- +2.31.1 + diff --git a/SOURCES/0005-lenses-Allow-whitespace-at-the-end-of-kernel-commnd-.patch b/SOURCES/0005-lenses-Allow-whitespace-at-the-end-of-kernel-commnd-.patch new file mode 100644 index 0000000..7f313b1 --- /dev/null +++ b/SOURCES/0005-lenses-Allow-whitespace-at-the-end-of-kernel-commnd-.patch @@ -0,0 +1,44 @@ +From f4a9ca77e5dba3659cfadd9e12ba96b32befdaab Mon Sep 17 00:00:00 2001 +From: rwmjones +Date: Sun, 5 Mar 2023 10:30:43 +0000 +Subject: [PATCH 5/5] lenses: Allow whitespace at the end of kernel commnd line + (#798) + +Reported-by: Yongkui Guo +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2159282 + +Signed-off-by: Richard W.M. Jones +(cherry picked from commit 801aa73db3c356378467622a7e02dea21ccf4332) +--- + lenses/cmdline.aug | 2 +- + lenses/tests/test_cmdline.aug | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lenses/cmdline.aug b/lenses/cmdline.aug +index b8b5176d..30e9aac7 100644 +--- a/lenses/cmdline.aug ++++ b/lenses/cmdline.aug +@@ -13,7 +13,7 @@ module Cmdline = + + let entry = [ key Rx.word . Util.del_str "=" . store Rx.no_spaces ] | [ key Rx.word ] + +-let lns = (Build.opt_list entry Sep.space)? . del /\n?/ "" ++let lns = (Build.opt_list entry Sep.space)? . del /[ \t]*\n?/ "" + + let filter = incl "/etc/kernel/cmdline" + . incl "/proc/cmdline" +diff --git a/lenses/tests/test_cmdline.aug b/lenses/tests/test_cmdline.aug +index 0624a0b2..77a429d8 100644 +--- a/lenses/tests/test_cmdline.aug ++++ b/lenses/tests/test_cmdline.aug +@@ -4,6 +4,7 @@ let lns = Cmdline.lns + + test lns get "foo\nbar" = * + test lns get "foo\n" = { "foo" } ++test lns get "foo \n" = { "foo" } + test lns get "foo" = { "foo" } + test lns get "foo bar" = { "foo" } { "bar" } + test lns get "foo bar" = { "foo" } { "bar" } +-- +2.31.1 + diff --git a/SPECS/augeas.spec b/SPECS/augeas.spec index b19e755..8d81d9e 100644 --- a/SPECS/augeas.spec +++ b/SPECS/augeas.spec @@ -1,6 +1,6 @@ Name: augeas Version: 1.13.0 -Release: 3%{?dist} +Release: 5%{?dist} Summary: A library for changing configuration files License: LGPLv2+ @@ -26,6 +26,14 @@ Patch2: 0002-Kdump-parse-auto_reset_crashkernel-754.patch # Upstream commit a3ba6e2d32b95507e2474a219e788ac3d54bc4a1 Patch3: 0003-semanage-Fix-parsing-of-ignoredirs-758.patch +# Fix parsing of /usr/lib/tmpfiles.d/provision.conf +# Upstream commit 41b2a33ff02687fa53d69a012a1d47141b196a86 +Patch4: 0004-Tmpfiles-allow-for-letter-types-allow-as-prefix-for-.patch + +# Fix parsing of /etc/kernel/cmdline +# Upstream commit 801aa73db3c356378467622a7e02dea21ccf4332 +Patch5: 0005-lenses-Allow-whitespace-at-the-end-of-kernel-commnd-.patch + Provides: bundled(gnulib) BuildRequires: make @@ -142,6 +150,11 @@ rm -f $RPM_BUILD_ROOT/usr/bin/dump %{_libdir}/libfa.a %changelog +* Tue Apr 04 2023 Richard W.M. Jones - 1.13.0-4 +- Fix parsing of /usr/lib/tmpfiles.d/provision.conf +- Fix parsing of /etc/kernel/cmdline + resolves: rhbz#2155136, rhbz#2159282 + * Thu Oct 06 2022 Richard W.M. Jones - 1.13.0-3 - Fix parsing of /etc/selinux/semanage.conf in RHEL 9 resolves: rhbz#2077120