From c8163da5312352651e947ecc64f7083096dec5a3 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2019 12:10:38 +0000 Subject: import augeas-1.4.0-9.el7 --- diff --git a/SOURCES/0018-Fix-sudoers-lens-always_query_group_plugin-588.patch b/SOURCES/0018-Fix-sudoers-lens-always_query_group_plugin-588.patch deleted file mode 100644 index 0754fb6..0000000 --- a/SOURCES/0018-Fix-sudoers-lens-always_query_group_plugin-588.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fb806708da719a37422d33fdda77de702c3c646e Mon Sep 17 00:00:00 2001 -From: Steve Traylen -Date: Thu, 1 Nov 2018 13:54:32 +0100 -Subject: [PATCH] Fix sudoers lens: "always_query_group_plugin" (#588) - -The option is now enabled by default in the default sudoers of -RHEL 7.6 (and probably soon CentOS 7). ---- - lenses/sudoers.aug | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lenses/sudoers.aug b/lenses/sudoers.aug -index 0437daae..d6140a8b 100644 ---- a/lenses/sudoers.aug -+++ b/lenses/sudoers.aug -@@ -308,6 +308,7 @@ let parameter_flag_kw = "always_set_home" | "authenticate" | "env_editor" - | "closefrom_override" | "compress_io" | "fast_glob" - | "log_input" | "log_output" | "pwfeedback" - | "umask_override" | "use_pty" | "match_group_by_gid" -+ | "always_query_group_plugin" - - let parameter_flag = [ del_negate . negate_node? - . key parameter_flag_kw ] --- -2.17.2 - diff --git a/SOURCES/0018-Grub-tolerate-some-invalid-entries.patch b/SOURCES/0018-Grub-tolerate-some-invalid-entries.patch new file mode 100644 index 0000000..1e8643a --- /dev/null +++ b/SOURCES/0018-Grub-tolerate-some-invalid-entries.patch @@ -0,0 +1,159 @@ +From ccebad103f3466d5e8fc2b60f6127af618adf8d2 Mon Sep 17 00:00:00 2001 +From: David Lutterkort +Date: Mon, 4 Jun 2018 10:45:19 -0700 +Subject: [PATCH] Grub: tolerate some invalid entries + +Refusing to parse an entire file because of invalid entries is too +harsh. Try to make the behavior a little friendlier by simply mapping invalid +entries to '#error' nodes but still parsing the rest of the file. + +Also remove del_to_eol, that would delete anything up to eol; it was only +used in kw_pres, but should have never been used there. kw_pres should only +match the keyword and eol. A line like 'quiet foo bar baz' should not be +accepted by (kw_pres "quiet"). +--- + lenses/grub.aug | 58 ++++++++++++++++++++++++++++++++------ + lenses/tests/test_grub.aug | 25 ++++++++++++++++ + 2 files changed, 75 insertions(+), 8 deletions(-) + +diff --git a/lenses/grub.aug b/lenses/grub.aug +index 9866f3f7..f99a3a92 100644 +--- a/lenses/grub.aug ++++ b/lenses/grub.aug +@@ -29,9 +29,6 @@ module Grub = + (* View: eol *) + let eol = Util.eol + +- (* View: del_to_eol *) +- let del_to_eol = del /[^ \t\n]*/ "" +- + (* View: spc *) + let spc = Util.del_ws_spc + +@@ -92,7 +89,22 @@ module Grub = + eol ] + + (* View: kw_pres *) +- let kw_pres (kw:string) = [ opt_ws . key kw . del_to_eol . eol ] ++ let kw_pres (kw:string) = [ opt_ws . key kw . eol ] ++ ++ (* View: error ++ * Parse a line that looks almost like a valid setting, but isn't, ++ * into an '#error' node. Any line that starts with letters, but not ++ * anything matching kw, is considered an error line. ++ * ++ * Parameters: ++ * kw:regexp - the valid keywords that are _not_ considered an ++ * error ++ *) ++ let error (kw:regexp) = ++ let not_kw = /[a-zA-Z]+/ - kw in ++ [ label "#error" . Util.del_opt_ws "\t" ++ . store (not_kw . /([^a-zA-Z\n].*[^ \t\n])?/) . eol ] ++ + + (************************************************************************ + * Group: BOOT ENTRIES +@@ -138,8 +150,8 @@ module Grub = + spc . [ label "from" . store Rx.no_spaces ] )? . + eol ] + +- (* View: menu_setting *) +- let menu_setting = kw_menu_arg "default" ++ (* View: menu_entry *) ++ let menu_entry = kw_menu_arg "default" + | kw_menu_arg "fallback" + | kw_pres "hiddenmenu" + | kw_menu_arg "timeout" +@@ -156,6 +168,21 @@ module Grub = + | device + | setkey + ++ (* View: menu_error ++ * Accept lines not matching menu_entry and stuff them into ++ * '#error' nodes ++ *) ++ let menu_error = ++ let kw = /default|fallback|hiddenmenu|timeout|splashimage|gfxmenu/ ++ |/foreground|background|verbose|boot|password|title/ ++ |/serial|setkey|terminal|color|device/ in ++ error kw ++ ++ (* View: menu_setting ++ * a valid menu setting or a line that looks like one but is an #error ++ *) ++ let menu_setting = menu_entry | menu_error ++ + (* View: title *) + let title = del /title[ \t=]+/ "title " . value_to_eol . eol + +@@ -206,9 +233,9 @@ module Grub = + let configfile = + [ command "configfile" "\t" . spc . store Rx.no_spaces . eol ] + +- (* View: boot_setting ++ (* View: boot_entry + entries *) +- let boot_setting = ++ let boot_entry = + let boot_arg_re = "root" | "initrd" | "rootnoverify" | "uuid" + | "findroot" | "bootfs" (* Solaris extensions *) + in kw_boot_arg boot_arg_re +@@ -223,6 +250,21 @@ module Grub = + | kw_pres "makeactive" + | password_arg + ++ (* View: boot_error ++ * Accept lines not matching boot_entry and stuff them into ++ * '#error' nodes ++ *) ++ let boot_error = ++ let kw = /lock|uuid|password|root|initrd|rootnoverify|findroot|bootfs/ ++ |/configfile|chainloader|title|boot|quiet|kernel|module/ ++ |/makeactive|savedefault|map/ in ++ error kw ++ ++ (* View: boot_setting ++ * a valid boot setting or a line that looks like one but is an #error ++ *) ++ let boot_setting = boot_entry | boot_error ++ + (* View: boot *) + let boot = + let line = ((boot_setting|comment)* . boot_setting)? in +diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug +index 8a0d9f4a..75657203 100644 +--- a/lenses/tests/test_grub.aug ++++ b/lenses/tests/test_grub.aug +@@ -257,3 +257,28 @@ password --encrypted ^9^32kwzzX./3WISQ0C /boot/grub/custom.lst + { "password" = "secret" + { "md5" } + } } ++ ++ (* Test parsing of invalid entries via menu_error *) ++ test Grub.lns get "default=0\ncrud=no\n" = ++ { "default" = "0" } ++ { "#error" = "crud=no" } ++ ++ (* We handle some pretty bizarre bad syntax *) ++ test Grub.lns get "default=0 ++crud no ++valid:nope ++nonsense = yes ++bad arg1 arg2 arg3=v\n" = ++ { "default" = "0" } ++ { "#error" = "crud no" } ++ { "#error" = "valid:nope" } ++ { "#error" = "nonsense = yes" } ++ { "#error" = "bad arg1 arg2 arg3=v" } ++ ++ (* Test parsing of invalid entries via boot_error *) ++ test Grub.lns get "title test ++ root (hd0,0) ++ crud foo\n" = ++ { "title" = "test" ++ { "root" = "(hd0,0)" } ++ { "#error" = "crud foo" } } +-- +2.17.2 + diff --git a/SOURCES/0019-Fix-sudoers-lens-always_query_group_plugin-588.patch b/SOURCES/0019-Fix-sudoers-lens-always_query_group_plugin-588.patch new file mode 100644 index 0000000..cbdf317 --- /dev/null +++ b/SOURCES/0019-Fix-sudoers-lens-always_query_group_plugin-588.patch @@ -0,0 +1,26 @@ +From 4e8c541392486f14715c5ec05da4612fc2e26ad9 Mon Sep 17 00:00:00 2001 +From: Steve Traylen +Date: Thu, 1 Nov 2018 13:54:32 +0100 +Subject: [PATCH] Fix sudoers lens: "always_query_group_plugin" (#588) + +The option is now enabled by default in the default sudoers of +RHEL 7.6 (and probably soon CentOS 7). +--- + lenses/sudoers.aug | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lenses/sudoers.aug b/lenses/sudoers.aug +index 0437daae..d6140a8b 100644 +--- a/lenses/sudoers.aug ++++ b/lenses/sudoers.aug +@@ -308,6 +308,7 @@ let parameter_flag_kw = "always_set_home" | "authenticate" | "env_editor" + | "closefrom_override" | "compress_io" | "fast_glob" + | "log_input" | "log_output" | "pwfeedback" + | "umask_override" | "use_pty" | "match_group_by_gid" ++ | "always_query_group_plugin" + + let parameter_flag = [ del_negate . negate_node? + . key parameter_flag_kw ] +-- +2.17.2 + diff --git a/SOURCES/0020-New-lens-Anaconda-597.patch b/SOURCES/0020-New-lens-Anaconda-597.patch new file mode 100644 index 0000000..cd78b63 --- /dev/null +++ b/SOURCES/0020-New-lens-Anaconda-597.patch @@ -0,0 +1,186 @@ +From ba333a3205324a7b0489d93b67317c72b76fe8bf Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Wed, 12 Dec 2018 13:54:06 +0100 +Subject: [PATCH] New lens: Anaconda (#597) + +Introduce a new lens to parse the INI-like `/etc/sysconfig/anaconda` instead of using `Shellvars`. +--- + lenses/anaconda.aug | 30 +++++++++++ + lenses/shellvars.aug | 1 + + lenses/tests/test_anaconda.aug | 89 +++++++++++++++++++++++++++++++ + tests/Makefile.am | 1 + + tests/root/etc/sysconfig/anaconda | 5 ++ + 5 files changed, 126 insertions(+) + create mode 100644 lenses/anaconda.aug + create mode 100644 lenses/tests/test_anaconda.aug + create mode 100644 tests/root/etc/sysconfig/anaconda + +diff --git a/lenses/anaconda.aug b/lenses/anaconda.aug +new file mode 100644 +index 00000000..8f618db2 +--- /dev/null ++++ b/lenses/anaconda.aug +@@ -0,0 +1,30 @@ ++(* ++Module: Anaconda ++ Parses Anaconda's user interaction configuration files. ++ ++Author: Pino Toscano ++ ++About: Reference ++ https://anaconda-installer.readthedocs.io/en/latest/user-interaction-config-file-spec.html ++ ++About: Configuration file ++ This lens applies to /etc/sysconfig/anaconda. ++ ++About: License ++ This file is licensed under the LGPL v2+, like the rest of Augeas. ++*) ++module Anaconda = ++autoload xfm ++ ++let comment = IniFile.comment "#" "#" ++let sep = IniFile.sep "=" "=" ++ ++let entry = IniFile.entry IniFile.entry_re sep comment ++let title = IniFile.title IniFile.record_re ++let record = IniFile.record title entry ++ ++let lns = IniFile.lns record comment ++ ++let filter = incl "/etc/sysconfig/anaconda" ++ ++let xfm = transform lns filter +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index 25bb82b9..03ab921b 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -198,6 +198,7 @@ module Shellvars = + + let filter_sysconfig = + sc_incl "*" . ++ sc_excl "anaconda" . + sc_excl "bootloader" . + sc_excl "hw-uuid" . + sc_excl "hwconf" . +diff --git a/lenses/tests/test_anaconda.aug b/lenses/tests/test_anaconda.aug +new file mode 100644 +index 00000000..50b0ac22 +--- /dev/null ++++ b/lenses/tests/test_anaconda.aug +@@ -0,0 +1,89 @@ ++(* ++Module: Test_Anaconda ++ Provides unit tests and examples for the lens. ++ ++ - 'exampleN' snippets are taken from the documentation: ++ https://anaconda-installer.readthedocs.io/en/latest/user-interaction-config-file-spec.html ++ - 'installedN' snippets are taken from the resulting files after ++ a successful installation ++*) ++ ++module Test_Anaconda = ++ ++let example1 = "# comment example - before the section headers ++ ++[section_1] ++# comment example - inside section 1 ++key_a_in_section1=some_value ++key_b_in_section1=some_value ++ ++[section_2] ++# comment example - inside section 2 ++key_a_in_section2=some_value ++" ++ ++test Anaconda.lns get example1 = ++ { "#comment" = "comment example - before the section headers" } ++ { } ++ { "section_1" ++ { "#comment" = "comment example - inside section 1" } ++ { "key_a_in_section1" = "some_value" } ++ { "key_b_in_section1" = "some_value" } ++ { } ++ } ++ { "section_2" ++ { "#comment" = "comment example - inside section 2" } ++ { "key_a_in_section2" = "some_value" } ++ } ++ ++let example2 = "# this is the user interaction config file ++ ++[General] ++post_install_tools_disabled=0 ++ ++[DatetimeSpoke] ++# the date and time spoke has been visited ++visited=1 ++changed_timezone=1 ++changed_ntp=0 ++changed_timedate=1 ++ ++[KeyboardSpoke] ++# the keyboard spoke has not been visited ++visited=0 ++" ++ ++test Anaconda.lns get example2 = ++ { "#comment" = "this is the user interaction config file" } ++ { } ++ { "General" ++ { "post_install_tools_disabled" = "0" } ++ { } ++ } ++ { "DatetimeSpoke" ++ { "#comment" = "the date and time spoke has been visited" } ++ { "visited" = "1" } ++ { "changed_timezone" = "1" } ++ { "changed_ntp" = "0" } ++ { "changed_timedate" = "1" } ++ { } ++ } ++ { "KeyboardSpoke" ++ { "#comment" = "the keyboard spoke has not been visited" } ++ { "visited" = "0" } ++ } ++ ++let installed1 = "# This file has been generated by the Anaconda Installer 21.48.22.134-1 ++ ++[ProgressSpoke] ++visited = 1 ++ ++" ++ ++test Anaconda.lns get installed1 = ++ { "#comment" = "This file has been generated by the Anaconda Installer 21.48.22.134-1" } ++ { } ++ { "ProgressSpoke" ++ { "visited" = "1" } ++ { } ++ } +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 4d2b2605..08d5dc59 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -22,6 +22,7 @@ lens_tests = \ + lens-activemq_xml.sh \ + lens-afs_cellalias.sh \ + lens-aliases.sh \ ++ lens-anaconda.sh \ + lens-anacron.sh \ + lens-approx.sh \ + lens-apt_update_manager.sh \ +diff --git a/tests/root/etc/sysconfig/anaconda b/tests/root/etc/sysconfig/anaconda +new file mode 100644 +index 00000000..73318cf6 +--- /dev/null ++++ b/tests/root/etc/sysconfig/anaconda +@@ -0,0 +1,5 @@ ++# This file has been generated by the Anaconda Installer 21.48.22.134-1 ++ ++[ProgressSpoke] ++visited = 1 ++ +-- +2.17.2 + diff --git a/SPECS/augeas.spec b/SPECS/augeas.spec index 72b051e..20e3976 100644 --- a/SPECS/augeas.spec +++ b/SPECS/augeas.spec @@ -1,6 +1,6 @@ Name: augeas Version: 1.4.0 -Release: 6%{?dist}.1 +Release: 9%{?dist} Summary: A library for changing configuration files Group: System Environment/Libraries @@ -24,7 +24,9 @@ Patch14: 0014-Fix-430-support-Krb5-include-dir.patch Patch15: 0015-Cgconfig-allow-fperm-dperm-in-admin-task.patch Patch16: 0016-Grub-handle-top-level-boot-directive-494.patch Patch17: 0017-Fstab-allow-leading-whitespace-in-lines-with-spec-54.patch -Patch18: 0018-Fix-sudoers-lens-always_query_group_plugin-588.patch +Patch18: 0018-Grub-tolerate-some-invalid-entries.patch +Patch19: 0019-Fix-sudoers-lens-always_query_group_plugin-588.patch +Patch20: 0020-New-lens-Anaconda-597.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -60,6 +62,8 @@ developing applications that use %{name}. Summary: Libraries for %{name} Group: System Environment/Libraries +Provides: bundled(gnulib) + %description libs The libraries for %{name}. @@ -84,6 +88,8 @@ The libraries for %{name}. %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 +%patch20 -p1 # Patches affect Makefile.am and configure.ac, so rerun autotools. autoreconf @@ -145,8 +151,16 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/augeas.pc %changelog -* Thu Nov 15 2018 Pino Toscano - 1.4.0-6.el7_6.1 -- Sudoers: handle "always_query_group_plugin" option (RHBZ#1650174) +* Wed Dec 19 2018 Pino Toscano - 1.4.0-9 +- Add "Provides: bundled(gnulib)" to augeas-libs, as it embeds gnulib + (RHBZ#1653766) +- Anaconda: new lens (RHBZ#1657189) + +* Tue Nov 13 2018 Pino Toscano - 1.4.0-8 +- Sudoers: handle "always_query_group_plugin" option (RHBZ#1649287) + +* Tue Nov 13 2018 Pino Toscano - 1.4.0-7 +- Grub: better handle invalid grub.conf files (RHBZ#1582236) * Thu Mar 29 2018 Pino Toscano - 1.4.0-6 - Fstab: allow leading whitespaces (RHBZ#1544520)