Compare commits

...

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

16 changed files with 701 additions and 839 deletions

View File

@ -1 +1 @@
afe7aee292e058141d8c19f6a82b5f8bae2d5163 SOURCES/augeas-1.12.0.tar.gz 22c15195bf6c7e71b4cfa2cc387b30a65ce75e65 SOURCES/augeas-1.13.0.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/augeas-1.12.0.tar.gz SOURCES/augeas-1.13.0.tar.gz

View File

@ -0,0 +1,109 @@
From 08101c754aafab4d0f79367839bbd0d6012c31cf Mon Sep 17 00:00:00 2001
From: Miroslav Lichvar <mlichvar@redhat.com>
Date: Wed, 2 Mar 2022 14:54:39 +0100
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
Support new configuration added in chrony 4.1 and 4.2.
Co-authored-by: Raphaël Pinson <github+aem1eeshi1@raphink.net>
(cherry picked from commit 5f3a566511626c35f69961598f1f332db01ed7a1)
---
lenses/chrony.aug | 11 ++++++++---
lenses/tests/test_chrony.aug | 9 +++++++--
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/lenses/chrony.aug b/lenses/chrony.aug
index 91c8ed51..d1c29531 100644
--- a/lenses/chrony.aug
+++ b/lenses/chrony.aug
@@ -57,8 +57,11 @@ module Chrony =
(************************************************************************
* Group: Create required expressions
************************************************************************)
+ (* Variable: hex *)
+ let hex = /[0-9a-fA-F]+/
+
(* Variable: number *)
- let number = integer | decimal | decimal . /[eE]/ . integer
+ let number = integer | decimal | decimal . /[eE]/ . integer | hex
(* Variable: address_re *)
let address_re = Rx.ip | Rx.hostname
@@ -79,6 +82,8 @@ module Chrony =
Server/Peer/Pool options with values
*)
let cmd_options = "asymmetry"
+ | "certset"
+ | "extfield"
| "filter"
| "key"
| /maxdelay((dev)?ratio)?/
@@ -96,7 +101,7 @@ module Chrony =
Server/Peer/Pool options without values
*)
let cmd_flags = "auto_offline"|"iburst"|"noselect"|"offline"|"prefer"
- |"require"|"trust"|"xleave"|"burst"|"nts"
+ |"copy"|"require"|"trust"|"xleave"|"burst"|"nts"
(* Variable: ntp_source
Server/Peer/Pool key names
@@ -183,7 +188,7 @@ module Chrony =
| "nocerttimecheck" | "ntsdumpdir" | "ntsntpserver"
| "ntsport" | "ntsprocesses" | "ntsrefresh" | "ntsrotate"
| "ntsservercert" | "ntsserverkey" | "ntstrustedcerts"
- | "ntpsigndsocket" | "pidfile"
+ | "ntpsigndsocket" | "pidfile" | "ptpport"
| "port" | "reselectdist" | "rtcautotrim" | "rtcdevice"
| "rtcfile" | "sched_priority" | "stratumweight" | "user"
diff --git a/lenses/tests/test_chrony.aug b/lenses/tests/test_chrony.aug
index 0c86cde7..691e63f7 100644
--- a/lenses/tests/test_chrony.aug
+++ b/lenses/tests/test_chrony.aug
@@ -17,8 +17,8 @@ module Test_Chrony =
server ntp1.example.com
server ntp2.example.com iburst
server ntp3.example.com presend 2
-server ntp4.example.com offline polltarget 4
-server ntp5.example.com maxdelay 2 offline
+server ntp4.example.com offline polltarget 4 extfield F323 copy
+server ntp5.example.com maxdelay 2 offline certset 1
server ntp6.example.com maxdelay 2 iburst presend 2 xleave offset 1e-4
server ntp7.example.com iburst presend 2 offline prefer trust require
server ntp8.example.com minsamples 8 maxsamples 16 version 3
@@ -88,6 +88,7 @@ ntsport 123
ntsprocesses 2
ntsrefresh 86400
ntsrotate 86400
+ptpport 319
"
test Chrony.lns get exampleconf =
@@ -110,10 +111,13 @@ ntsrotate 86400
{ "server" = "ntp4.example.com"
{ "offline" }
{ "polltarget" = "4" }
+ { "extfield" = "F323" }
+ { "copy" }
}
{ "server" = "ntp5.example.com"
{ "maxdelay" = "2" }
{ "offline" }
+ { "certset" = "1" }
}
{ "server" = "ntp6.example.com"
{ "maxdelay" = "2" }
@@ -312,6 +316,7 @@ ntsrotate 86400
{ "ntsprocesses" = "2" }
{ "ntsrefresh" = "86400" }
{ "ntsrotate" = "86400" }
+ { "ptpport" = "319" }
(* Local Variables: *)
--
2.31.1

View File

@ -1,59 +0,0 @@
From e666bf968071a9976bd44e1eb65645eb9d51b5cb Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Wed, 23 Oct 2019 11:35:57 +0200
Subject: [PATCH 1/9] Grub: support '+' in kernel command line option names
(#647)
This way it is possible to parse files that pass options with '+' in the
name to the kernel.
(cherry picked from commit 2ba77589baee1bf2d43d3a49f8e6f3eb522e5bba)
---
lenses/grub.aug | 2 +-
lenses/tests/test_grub.aug | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/lenses/grub.aug b/lenses/grub.aug
index 24ad39bc..82c1c37a 100644
--- a/lenses/grub.aug
+++ b/lenses/grub.aug
@@ -196,7 +196,7 @@ module Grub =
(* View: kernel_args
Parse the file name and args on a kernel or module line. *)
let kernel_args =
- let arg = /[A-Za-z0-9_.$-]+/ - /type|no-mem-option/ in
+ let arg = /[A-Za-z0-9_.$\+-]+/ - /type|no-mem-option/ in
store /(\([a-z0-9,]+\))?\/[^ \t\n]*/ .
(spc . multiboot_arg)? .
(spc . [ key arg . (eq. store /([^ \t\n])*/)?])* . eol
diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug
index 75657203..e50bdc4f 100644
--- a/lenses/tests/test_grub.aug
+++ b/lenses/tests/test_grub.aug
@@ -258,6 +258,23 @@ password --encrypted ^9^32kwzzX./3WISQ0C /boot/grub/custom.lst
{ "md5" }
} }
+ (* Test kernel options with different special characters. *)
+ test Grub.lns get "title Fedora (2.6.24.4-64.fc8)
+ root (hd0,0)
+ kernel /vmlinuz-2.6.24.4-64.fc8 ro root=/dev/vg00/lv00 with.dot=1 with-dash=1 with_underscore=1 with+plus=1
+ initrd /initrd-2.6.24.4-64.fc8.img\n" =
+ { "title" = "Fedora (2.6.24.4-64.fc8)"
+ { "root" = "(hd0,0)" }
+ { "kernel" = "/vmlinuz-2.6.24.4-64.fc8"
+ { "ro" }
+ { "root" = "/dev/vg00/lv00" }
+ { "with.dot" = "1" }
+ { "with-dash" = "1" }
+ { "with_underscore" = "1" }
+ { "with+plus" = "1" }
+ }
+ { "initrd" = "/initrd-2.6.24.4-64.fc8.img" } }
+
(* Test parsing of invalid entries via menu_error *)
test Grub.lns get "default=0\ncrud=no\n" =
{ "default" = "0" }
--
2.31.1

View File

@ -0,0 +1,276 @@
From e0bce2e8c21ccc69729676e8dc6fa1e541aedee2 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@users.noreply.github.com>
Date: Wed, 20 Apr 2022 10:13:06 +0200
Subject: [PATCH 2/5] Kdump: parse "auto_reset_crashkernel" (#754)
The "auto_reset_crashkernel" keyword was introduced in the following
kexec-tools patch set:
[PATCH v5 00/13] crashkernel=auto: support fadump and remove
crashkernel.default
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org/thread/V5WPTRAPJR65QXSTNW6W6E7ZBAUCQNUH/#V5WPTRAPJR65QXSTNW6W6E7ZBAUCQNUH
Related upstream commit:
https://src.fedoraproject.org/rpms/kexec-tools/c/73ced7f451a72
Recognize "auto_reset_crashkernel" in "kdump.aug". Update the test case.
Also copy "kdump.conf" from kexec-tools @ 73ced7f451a72 to
"tests/root/etc/kdump.conf".
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2042772
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
(cherry picked from commit 288a028da531a5f58d9ee89bc29fd73e7483bf24)
---
lenses/kdump.aug | 4 +
lenses/tests/test_kdump.aug | 2 +
tests/root/etc/kdump.conf | 192 ++++++++++++++++++++++++++++++++++++
3 files changed, 198 insertions(+)
create mode 100644 tests/root/etc/kdump.conf
diff --git a/lenses/kdump.aug b/lenses/kdump.aug
index ddf50ede..e50486c3 100644
--- a/lenses/kdump.aug
+++ b/lenses/kdump.aug
@@ -25,6 +25,7 @@ let empty = Util.empty
let comment = Util.comment
let value_to_eol = store /[^ \t\n#][^\n#]*[^ \t\n#]|[^ \t\n#]/
let int_to_eol = store Rx.integer
+let yn_to_eol = store ("yes" | "no")
let delimiter = Util.del_ws_spc
let eol = Util.eol
let value_to_spc = store Rx.neg1
@@ -64,9 +65,12 @@ let simple_kws = "raw" | "net" | "path" | "core_collector" | "kdump_post"
let int_kws = "force_rebuild" | "override_resettable" | "debug_mem_level"
| "link_delay" | "disk_timeout"
+let yn_kws = "auto_reset_crashkernel"
+
let option = Build.key_value_line_comment ( simple_kws | fs_types )
delimiter value_to_eol comment
| Build.key_value_line_comment int_kws delimiter int_to_eol comment
+ | Build.key_value_line_comment yn_kws delimiter yn_to_eol comment
| list "extra_bins"
| list "extra_modules"
| list "blacklist"
diff --git a/lenses/tests/test_kdump.aug b/lenses/tests/test_kdump.aug
index 51c79a38..ff82af05 100644
--- a/lenses/tests/test_kdump.aug
+++ b/lenses/tests/test_kdump.aug
@@ -11,6 +11,7 @@ module Test_Kdump =
#comment after empty line
#
#comment after empty comment
+auto_reset_crashkernel yes
path /var/crash #comment after entry
core_collector makedumpfile -c
default poweroff
@@ -49,6 +50,7 @@ blacklist gfs2
{ "#comment" = "comment after empty line" }
{ }
{ "#comment" = "comment after empty comment" }
+ { "auto_reset_crashkernel" = "yes" }
{ "path" = "/var/crash"
{ "#comment" = "comment after entry" } }
{ "core_collector" = "makedumpfile -c" }
diff --git a/tests/root/etc/kdump.conf b/tests/root/etc/kdump.conf
new file mode 100644
index 00000000..d4fc78b0
--- /dev/null
+++ b/tests/root/etc/kdump.conf
@@ -0,0 +1,192 @@
+# This file contains a series of commands to perform (in order) in the kdump
+# kernel after a kernel crash in the crash kernel(1st kernel) has happened.
+#
+# Directives in this file are only applicable to the kdump initramfs, and have
+# no effect once the root filesystem is mounted and the normal init scripts are
+# processed.
+#
+# Currently, only one dump target and path can be specified. If the dumping to
+# the configured target fails, the failure action which can be configured via
+# the "failure_action" directive will be performed.
+#
+# Supported options:
+#
+# auto_reset_crashkernel <yes|no>
+# - whether to reset kernel crashkernel to new default value
+# or not when kexec-tools updates the default crashkernel value and
+# existing kernels using the old default kernel crashkernel value.
+# The default value is yes.
+#
+# raw <partition>
+# - Will dd /proc/vmcore into <partition>.
+# Use persistent device names for partition devices,
+# such as /dev/vg/<devname>.
+#
+# nfs <nfs mount>
+# - Will mount nfs to <mnt>, and copy /proc/vmcore to
+# <mnt>/<path>/%HOST-%DATE/, supports DNS.
+#
+# ssh <user@server>
+# - Will save /proc/vmcore to <user@server>:<path>/%HOST-%DATE/,
+# supports DNS.
+# NOTE: make sure the user has write permissions on the server.
+#
+# sshkey <path>
+# - Will use the sshkey to do ssh dump.
+# Specify the path of the ssh key to use when dumping
+# via ssh. The default value is /root/.ssh/kdump_id_rsa.
+#
+# <fs type> <partition>
+# - Will mount -t <fs type> <partition> <mnt>, and copy
+# /proc/vmcore to <mnt>/<path>/%HOST_IP-%DATE/.
+# NOTE: <partition> can be a device node, label or uuid.
+# It's recommended to use persistent device names
+# such as /dev/vg/<devname>.
+# Otherwise it's suggested to use label or uuid.
+#
+# path <path>
+# - "path" represents the file system path in which vmcore
+# will be saved. If a dump target is specified in
+# kdump.conf, then "path" is relative to the specified
+# dump target.
+#
+# Interpretation of "path" changes a bit if the user didn't
+# specify any dump target explicitly in kdump.conf. In this
+# case, "path" represents the absolute path from root. The
+# dump target and adjusted path are arrived at automatically
+# depending on what's mounted in the current system.
+#
+# Ignored for raw device dumps. If unset, will use the default
+# "/var/crash".
+#
+# core_collector <command> <options>
+# - This allows you to specify the command to copy
+# the vmcore. The default is makedumpfile, which on
+# some architectures can drastically reduce vmcore size.
+# See /sbin/makedumpfile --help for a list of options.
+# Note that the -i and -g options are not needed here,
+# as the initrd will automatically be populated with a
+# config file appropriate for the running kernel.
+# The default core_collector for raw/ssh dump is:
+# "makedumpfile -F -l --message-level 7 -d 31".
+# The default core_collector for other targets is:
+# "makedumpfile -l --message-level 7 -d 31".
+#
+# "makedumpfile -F" will create a flattened vmcore.
+# You need to use "makedumpfile -R" to rearrange the dump data to
+# a normal dumpfile readable with analysis tools. For example:
+# "makedumpfile -R vmcore < vmcore.flat".
+#
+# For core_collector format details, you can refer to
+# kexec-kdump-howto.txt or kdump.conf manpage.
+#
+# kdump_post <binary | script>
+# - This directive allows you to run a executable binary
+# or script after the vmcore dump process terminates.
+# The exit status of the current dump process is fed to
+# the executable binary or script as its first argument.
+# All files under /etc/kdump/post.d are collectively sorted
+# and executed in lexical order, before binary or script
+# specified kdump_post parameter is executed.
+#
+# kdump_pre <binary | script>
+# - Works like the "kdump_post" directive, but instead of running
+# after the dump process, runs immediately before it.
+# Exit status of this binary is interpreted as follows:
+# 0 - continue with dump process as usual
+# non 0 - run the final action (reboot/poweroff/halt)
+# All files under /etc/kdump/pre.d are collectively sorted and
+# executed in lexical order, after binary or script specified
+# kdump_pre parameter is executed.
+# Even if the binary or script in /etc/kdump/pre.d directory
+# returns non 0 exit status, the processing is continued.
+#
+# extra_bins <binaries | shell scripts>
+# - This directive allows you to specify additional binaries or
+# shell scripts to be included in the kdump initrd.
+# Generally they are useful in conjunction with a kdump_post
+# or kdump_pre binary or script which depends on these extra_bins.
+#
+# extra_modules <module(s)>
+# - This directive allows you to specify extra kernel modules
+# that you want to be loaded in the kdump initrd.
+# Multiple modules can be listed, separated by spaces, and any
+# dependent modules will automatically be included.
+#
+# failure_action <reboot | halt | poweroff | shell | dump_to_rootfs>
+# - Action to perform in case dumping fails.
+# reboot: Reboot the system.
+# halt: Halt the system.
+# poweroff: Power down the system.
+# shell: Drop to a bash shell.
+# Exiting the shell reboots the system by default,
+# or perform "final_action".
+# dump_to_rootfs: Dump vmcore to rootfs from initramfs context and
+# reboot by default or perform "final_action".
+# Useful when non-root dump target is specified.
+# The default option is "reboot".
+#
+# default <reboot | halt | poweroff | shell | dump_to_rootfs>
+# - Same as the "failure_action" directive above, but this directive
+# is obsolete and will be removed in the future.
+#
+# final_action <reboot | halt | poweroff>
+# - Action to perform in case dumping succeeds. Also performed
+# when "shell" or "dump_to_rootfs" failure action finishes.
+# Each action is same as the "failure_action" directive above.
+# The default is "reboot".
+#
+# force_rebuild <0 | 1>
+# - By default, kdump initrd will only be rebuilt when necessary.
+# Specify 1 to force rebuilding kdump initrd every time when kdump
+# service starts.
+#
+# force_no_rebuild <0 | 1>
+# - By default, kdump initrd will be rebuilt when necessary.
+# Specify 1 to bypass rebuilding of kdump initrd.
+#
+# force_no_rebuild and force_rebuild options are mutually
+# exclusive and they should not be set to 1 simultaneously.
+#
+# override_resettable <0 | 1>
+# - Usually an unresettable block device can't be a dump target.
+# Specifying 1 when you want to dump even though the block
+# target is unresettable
+# By default, it is 0, which will not try dumping destined to fail.
+#
+# dracut_args <arg(s)>
+# - Pass extra dracut options when rebuilding kdump initrd.
+#
+# fence_kdump_args <arg(s)>
+# - Command line arguments for fence_kdump_send (it can contain
+# all valid arguments except hosts to send notification to).
+#
+# fence_kdump_nodes <node(s)>
+# - List of cluster node(s) except localhost, separated by spaces,
+# to send fence_kdump notifications to.
+# (this option is mandatory to enable fence_kdump).
+#
+
+#raw /dev/vg/lv_kdump
+#ext4 /dev/vg/lv_kdump
+#ext4 LABEL=/boot
+#ext4 UUID=03138356-5e61-4ab3-b58e-27507ac41937
+#nfs my.server.com:/export/tmp
+#nfs [2001:db8::1:2:3:4]:/export/tmp
+#ssh user@my.server.com
+#ssh user@2001:db8::1:2:3:4
+#sshkey /root/.ssh/kdump_id_rsa
+auto_reset_crashkernel yes
+path /var/crash
+core_collector makedumpfile -l --message-level 7 -d 31
+#core_collector scp
+#kdump_post /var/crash/scripts/kdump-post.sh
+#kdump_pre /var/crash/scripts/kdump-pre.sh
+#extra_bins /usr/bin/lftp
+#extra_modules gfs2
+#failure_action shell
+#force_rebuild 1
+#force_no_rebuild 1
+#dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"
+#fence_kdump_args -p 7410 -f auto -c 0 -i 10
+#fence_kdump_nodes node1 node2
--
2.31.1

View File

@ -1,94 +0,0 @@
From eb2dc4ec0879290f42e35a7facc345ca1c70ba69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= <raphael.pinson@camptocamp.com>
Date: Tue, 12 Nov 2019 13:33:26 +0100
Subject: [PATCH 2/9] Rsyslog: support multiple actions in filters and
selectors (#653)
(cherry picked from commit 5181105bae84dc7819a00886f068ad0bb4e6d05a)
---
lenses/rsyslog.aug | 11 ++++++++---
lenses/tests/test_rsyslog.aug | 37 +++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/lenses/rsyslog.aug b/lenses/rsyslog.aug
index 7b9f7dc9..29ff9b10 100644
--- a/lenses/rsyslog.aug
+++ b/lenses/rsyslog.aug
@@ -65,11 +65,17 @@ let hostname = [ label "hostname" .
( Syslog.plus | [ Build.xchgs "-" "reverse" ] ) .
Syslog.hostnames . Util.eol . Syslog.entries ]
+(* View: actions *)
+let actions =
+ let prop_act = [ label "action" . action ]
+ in let act_sep = del /[ \t]*\n&[ \t]*/ "\n& "
+ in Build.opt_list prop_act act_sep
+
(* View: entry
An entry contains selectors and an action
*)
let entry = [ label "entry" . Syslog.selectors . Syslog.sep_tab .
- [ label "action" . action ] . Util.eol ]
+ actions . Util.eol ]
(* View: prop_filter
Parses property-based filters, which start with ":" and the property name *)
@@ -78,9 +84,8 @@ let prop_filter =
in let prop_name = [ Util.del_str ":" . label "property" . store Rx.word ]
in let prop_oper = [ label "operation" . store /[A-Za-z!-]+/ ]
in let prop_val = [ label "value" . Quote.do_dquote (store /[^\n"]*/) ]
- in let prop_act = [ label "action" . action ]
in [ label "filter" . prop_name . sep . prop_oper . sep . prop_val .
- Sep.space . prop_act . Util.eol ]
+ Sep.space . actions . Util.eol ]
let entries = ( Syslog.empty | Util.comment | entry | macro | config_object | prop_filter )*
diff --git a/lenses/tests/test_rsyslog.aug b/lenses/tests/test_rsyslog.aug
index 9011a2b3..e83613a2 100644
--- a/lenses/tests/test_rsyslog.aug
+++ b/lenses/tests/test_rsyslog.aug
@@ -222,3 +222,40 @@ test Rsyslog.lns get "*.* ?DynamicFile\n" =
{ "dynamic" = "DynamicFile" }
}
}
+
+(* Multiple actions in filters and selectors *)
+test Rsyslog.lns get ":msg, startswith, \"iptables:\" -/var/log/iptables.log
+& ~
+# Save boot messages also to boot.log
+local7.* /var/log/boot.log
+local3.err /var/log/nfsen/nfsenlog
+& /var/log/also.log
+\n" =
+ { "filter"
+ { "property" = "msg" }
+ { "operation" = "startswith" }
+ { "value" = "iptables:" }
+ { "action"
+ { "no_sync" }
+ { "file" = "/var/log/iptables.log" } }
+ { "action"
+ { "discard" } }
+ }
+ { "#comment" = "Save boot messages also to boot.log" }
+ { "entry"
+ { "selector"
+ { "facility" = "local7" }
+ { "level" = "*" } }
+ { "action"
+ { "file" = "/var/log/boot.log" } }
+ }
+ { "entry"
+ { "selector"
+ { "facility" = "local3" }
+ { "level" = "err" } }
+ { "action"
+ { "file" = "/var/log/nfsen/nfsenlog" } }
+ { "action"
+ { "file" = "/var/log/also.log" } } }
+ { }
+
--
2.31.1

View File

@ -1,7 +1,7 @@
From f1480aa0c228107a22664e6302c6f2b388536ece Mon Sep 17 00:00:00 2001 From aca3def462ab141c3991a2d27c44341b809cf970 Mon Sep 17 00:00:00 2001
From: rwmjones <rjones@redhat.com> From: rwmjones <rjones@redhat.com>
Date: Thu, 6 Oct 2022 12:15:56 +0100 Date: Thu, 6 Oct 2022 12:15:56 +0100
Subject: [PATCH 9/9] 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 From /etc/selinux/semanage.conf from a RHEL 9.1 system, this line
caused problems: caused problems:
@ -132,7 +132,7 @@ index 00000000..406f16f1
+args = -r $@ +args = -r $@
+[end] +[end]
diff --git a/tests/xpath.tests b/tests/xpath.tests diff --git a/tests/xpath.tests b/tests/xpath.tests
index a7db8d83..feab7584 100644 index 4278e433..71c998b8 100644
--- a/tests/xpath.tests --- a/tests/xpath.tests
+++ b/tests/xpath.tests +++ b/tests/xpath.tests
@@ -109,6 +109,7 @@ test descendant-or-self /files/descendant-or-self :: 4 @@ -109,6 +109,7 @@ test descendant-or-self /files/descendant-or-self :: 4

View File

@ -1,37 +0,0 @@
From 5218c2997b7b77752511ebc61ffa743fd2d8fcbf Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Fri, 17 May 2019 13:47:20 +0200
Subject: [PATCH 3/9] * src/augrun.c (nexttoken): add more escape characters
Synchonize the list of "pass-through" characters with the set in the
'name_follow' variable in pathx.c: as pathx_escape_name() escapes them,
make sure that aug_srun() accepts them as arguments.
---
src/augrun.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/augrun.c b/src/augrun.c
index 07f865a9..fd710c5f 100644
--- a/src/augrun.c
+++ b/src/augrun.c
@@ -133,8 +133,16 @@ static char *nexttoken(struct command *cmd, char **line, bool path) {
copy = true;
if (*s == '\\') {
switch (*(s+1)) {
+ case ']':
case '[':
- case ']': /* pass both literally */
+ case '|':
+ case '/':
+ case '=':
+ case '(':
+ case ')':
+ case '!':
+ case ',': /* pass them literally;
+ * see 'name_follow' in pathx.c */
nescaped = 2;
break;
case 't': /* insert tab */
--
2.31.1

View File

@ -0,0 +1,164 @@
From 34749f9ea1af8e3fad9e60891beda0fe786cb0f2 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
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 <minus_tree> *)
{ "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 <equal> *)
+ 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 <tilde> *)
+ 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 <caret> *)
+ 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 <mode3> *)
{ "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 <mode_colon> *)
+ 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

View File

@ -1,42 +0,0 @@
From fc2b84a2ecd9a403cb602d2de26d6c1804a3ceac Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Fri, 17 May 2019 15:18:50 +0200
Subject: [PATCH 4/9] * src/augtool.c: hopefully fix readline quoting issues
Configure the quoting (also using a detector) and word break characters,
so it is possible to autocomplete paths with special characters (like
spaces, which are already quoted by augeas).
---
src/augtool.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/augtool.c b/src/augtool.c
index b42ef630..31a991eb 100644
--- a/src/augtool.c
+++ b/src/augtool.c
@@ -267,10 +267,22 @@ static char *get_home_dir(uid_t uid) {
return result;
}
+/* Inspired from:
+ * https://thoughtbot.com/blog/tab-completion-in-gnu-readline
+ */
+static int quote_detector(char *str, int index) {
+ return index > 0
+ && str[index - 1] == '\\'
+ && quote_detector(str, index - 1) == 0;
+}
+
static void readline_init(void) {
rl_readline_name = "augtool";
rl_attempted_completion_function = readline_completion;
rl_completion_entry_function = readline_path_generator;
+ rl_completer_quote_characters = "\"'";
+ rl_completer_word_break_characters = (char *) " ";
+ rl_char_is_quoted_p = &quote_detector;
/* Set up persistent history */
char *home_dir = get_home_dir(getuid());
--
2.31.1

View File

@ -1,133 +0,0 @@
From 1b4d6a9918b8bcbc06af4ce99a48cd66fed97196 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 4 Feb 2020 17:54:22 +0100
Subject: [PATCH 5/9] Krb5: improve [dbmodules] and includes (#630)
* Krb5: fix/revamp parsing of [dbmodules] subsection
The [dbmodules] subsection so far was parsed much like the [dbdefaults]
one, and thus it did not handle realms.
Revamp it a bit to handle realms, and specify the only keyword not in
realm subsections.
* Krb5: allow include/includedir directives everywhere
MIT Kerberos allows this, so do not restrict them only before any other
section.
---
lenses/krb5.aug | 27 +++++++++++++++++++--------
lenses/tests/test_krb5.aug | 36 +++++++++++++++++++++++++++++++++++-
2 files changed, 54 insertions(+), 9 deletions(-)
diff --git a/lenses/krb5.aug b/lenses/krb5.aug
index 46c22656..6b509c42 100644
--- a/lenses/krb5.aug
+++ b/lenses/krb5.aug
@@ -21,10 +21,11 @@ let closebr = del /[ \t]*\}/ "}"
and realms in the [appdefaults] section.
*)
+let include_re = /include(dir)?/
let realm_re = /[A-Z0-9][.a-zA-Z0-9-]*/
let realm_anycase_re = /[A-Za-z0-9][.a-zA-Z0-9-]*/
let app_re = /[a-z][a-zA-Z0-9_]*/
-let name_re = /[.a-zA-Z0-9_-]+/
+let name_re = /[.a-zA-Z0-9_-]+/ - include_re
let value_br = store /[^;# \t\r\n{}]+/
let value = store /[^;# \t\r\n]+/
@@ -130,10 +131,19 @@ let dbdefaults =
simple_section "dbdefaults" keys
let dbmodules =
- let keys = /db_library|ldap_kerberos_container_dn|ldap_kdc_dn/
- |/ldap_kadmind_dn|ldap_service_password_file|ldap_servers/
- |/ldap_conns_per_server/ in
- simple_section "dbmodules" keys
+ let subsec_key = /database_name|db_library|disable_last_success/
+ |/disable_lockout|ldap_conns_per_server|ldap_(kdc|kadmind)_dn/
+ |/ldap_(kdc|kadmind)_sasl_mech|ldap_(kdc|kadmind)_sasl_authcid/
+ |/ldap_(kdc|kadmind)_sasl_authzid|ldap_(kdc|kadmind)_sasl_realm/
+ |/ldap_kerberos_container_dn|ldap_servers/
+ |/ldap_service_password_file|mapsize|max_readers|nosync/
+ |/unlockiter/ in
+ let subsec_option = subsec_entry subsec_key eq comment in
+ let key = /db_module_dir/ in
+ let option = entry key eq value comment in
+ let realm = [ indent . label "realm" . store realm_re .
+ eq_openbr . (subsec_option)* . closebr . eol ] in
+ record "dbmodules" (option|realm)
(* This section is not documented in the krb5.conf manpage,
but the Fermi example uses it. *)
@@ -152,11 +162,12 @@ let kdc =
let pam =
simple_section "pam" name_re
-let includes = Build.key_value_line /include(dir)?/ Sep.space (store Rx.fspath)
+let includes = Build.key_value_line include_re Sep.space (store Rx.fspath)
+let include_lines = includes . (comment|empty)*
-let lns = (comment|empty|includes)* .
+let lns = (comment|empty)* .
(libdefaults|login|appdefaults|realms|domain_realm
- |logging|capaths|dbdefaults|dbmodules|instance_mapping|kdc|pam)*
+ |logging|capaths|dbdefaults|dbmodules|instance_mapping|kdc|pam|include_lines)*
let filter = (incl "/etc/krb5.conf.d/*.conf")
. (incl "/etc/krb5.conf")
diff --git a/lenses/tests/test_krb5.aug b/lenses/tests/test_krb5.aug
index f746543b..10b87605 100644
--- a/lenses/tests/test_krb5.aug
+++ b/lenses/tests/test_krb5.aug
@@ -1029,7 +1029,7 @@ default_ccache_name = KEYRING:persistent:%{uid}\n" =
{ }
{ "default_ccache_name" = "KEYRING:persistent:%{uid}" } }
-(* Include(dir) test *)
+(* Include(dir) tests *)
let include_test = "include /etc/krb5.other_conf.d/other.conf
includedir /etc/krb5.conf.d/
"
@@ -1037,3 +1037,37 @@ includedir /etc/krb5.conf.d/
test Krb5.lns get include_test =
{ "include" = "/etc/krb5.other_conf.d/other.conf" }
{ "includedir" = "/etc/krb5.conf.d/" }
+
+let include2_test = "[logging]
+ default = FILE:/var/log/krb5libs.log
+
+include /etc/krb5.other_conf.d/other.conf
+
+includedir /etc/krb5.conf.d/
+"
+
+test Krb5.lns get include2_test =
+ { "logging"
+ { "default"
+ { "file" = "/var/log/krb5libs.log" } }
+ { }
+ }
+ { "include" = "/etc/krb5.other_conf.d/other.conf" }
+ { }
+ { "includedir" = "/etc/krb5.conf.d/" }
+
+(* [dbmodules] test *)
+let dbmodules_test = "[dbmodules]
+ ATHENA.MIT.EDU = {
+ disable_last_success = true
+ }
+ db_module_dir = /some/path
+"
+
+test Krb5.lns get dbmodules_test =
+ { "dbmodules"
+ { "realm" = "ATHENA.MIT.EDU"
+ { "disable_last_success" = "true" }
+ }
+ { "db_module_dir" = "/some/path" }
+ }
--
2.31.1

View File

@ -0,0 +1,44 @@
From f4a9ca77e5dba3659cfadd9e12ba96b32befdaab Mon Sep 17 00:00:00 2001
From: rwmjones <rjones@redhat.com>
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 <rjones@redhat.com>
(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

View File

@ -1,59 +0,0 @@
From eb7c72cfffa5360a65be270c5554abf36739e382 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 4 Feb 2020 18:05:05 +0100
Subject: [PATCH 6/9] Systemd: fix parsing of envvars with spaces (#659)
Allow spaces inside of values quoted with single or double quotes.
This amends commit f64d8bc7a7670f3af2549fdcefb64c2b5f22cd0d that added
support for quoted values.
---
lenses/systemd.aug | 4 ++--
lenses/tests/test_systemd.aug | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/lenses/systemd.aug b/lenses/systemd.aug
index b868e86f..77434367 100644
--- a/lenses/systemd.aug
+++ b/lenses/systemd.aug
@@ -132,8 +132,8 @@ let entry_env =
let envkv (env_val:lens) = key env_key . Util.del_str "=" . env_val
(* bare has no spaces, and is optionally quoted *)
in let bare = Quote.do_quote_opt (envkv (store /[^#'" \t\n]*[^#'" \t\n\\]/)?)
- in let bare_dqval = envkv (store /"[^#" \t\n]*[^#" \t\n\\]"/)
- in let bare_sqval = envkv (store /'[^#' \t\n]*[^#' \t\n\\]'/)
+ in let bare_dqval = envkv (store /"[^#"\t\n]*[^#"\t\n\\]"/)
+ in let bare_sqval = envkv (store /'[^#'\t\n]*[^#'\t\n\\]'/)
(* quoted has at least one space, and must be quoted *)
in let quoted = Quote.do_quote (envkv (store /[^#"'\n]*[ \t]+[^#"'\n]*/))
in let envkv_quoted = [ bare ] | [ bare_dqval ] | [ bare_sqval ] | [ quoted ]
diff --git a/lenses/tests/test_systemd.aug b/lenses/tests/test_systemd.aug
index 3397456e..19c57075 100644
--- a/lenses/tests/test_systemd.aug
+++ b/lenses/tests/test_systemd.aug
@@ -206,6 +206,8 @@ FOO=BAR
Environment=\"LANG=foo bar\" FOO=BAR
Environment=OPTIONS=\"-LS0-6d\"
Environment=OPTIONS='-LS0-6d'
+Environment=VAR=\"with some spaces\" VAR2='more spaces'
+Environment=VAR='with some spaces'
"
(* Test: Systemd.lns *)
test Systemd.lns get env =
@@ -247,6 +249,13 @@ test Systemd.lns get env =
{ "Environment"
{ "OPTIONS" = "'-LS0-6d'" }
}
+ { "Environment"
+ { "VAR" = "\"with some spaces\"" }
+ { "VAR2" = "'more spaces'" }
+ }
+ { "Environment"
+ { "VAR" = "'with some spaces'" }
+ }
}
(* Variable: unit *)
--
2.31.1

View File

@ -1,85 +0,0 @@
From efd61b77563489ca0fa21904cc1fecfc482afd06 Mon Sep 17 00:00:00 2001
From: granquet <ranquet.guillaume@gmail.com>
Date: Tue, 6 Oct 2020 23:03:18 +0200
Subject: [PATCH 7/9] Ssh: add Match keyword support (#695)
Signed-off-by: Guillaume Ranquet <guillaume-externe.ranquet@edf.fr>
---
lenses/ssh.aug | 19 +++++++++++++++++--
lenses/tests/test_ssh.aug | 12 ++++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/lenses/ssh.aug b/lenses/ssh.aug
index 4e731581..c140c9a9 100644
--- a/lenses/ssh.aug
+++ b/lenses/ssh.aug
@@ -92,7 +92,7 @@ module Ssh =
| rekey_limit
let key_re = /[A-Za-z0-9]+/
- - /SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers|(HostKey|Kex)Algorithms|PubkeyAcceptedKeyTypes|GlobalKnownHostsFile|RekeyLimit/i
+ - /SendEnv|Host|Match|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers|(HostKey|Kex)Algorithms|PubkeyAcceptedKeyTypes|GlobalKnownHostsFile|RekeyLimit/i
let other_entry = [ indent . key key_re
@@ -105,11 +105,26 @@ module Ssh =
let host = [ key /Host/i . spc . value_to_eol . eol . entry* ]
+ let condition_entry =
+ let value = store /[^ \t\r\n=]+/ in
+ [ spc . key /[A-Za-z0-9]+/ . spc . value ]
+
+ let match_cond =
+ [ label "Condition" . condition_entry+ . eol ]
+
+ let match_entry = entry
+
+ let match =
+ [ key /Match/i . match_cond
+ . [ label "Settings" . match_entry+ ]
+ ]
+
+
(************************************************************************
* Group: LENS
*************************************************************************)
- let lns = entry* . host*
+ let lns = entry* . (host | match)*
let xfm = transform lns (incl "/etc/ssh/ssh_config" .
incl (Sys.getenv("HOME") . "/.ssh/config") .
diff --git a/lenses/tests/test_ssh.aug b/lenses/tests/test_ssh.aug
index f5fca252..456624e4 100644
--- a/lenses/tests/test_ssh.aug
+++ b/lenses/tests/test_ssh.aug
@@ -5,6 +5,9 @@ module Test_ssh =
"# start
IdentityFile /etc/ssh/identity.asc
+Match final all
+ GSSAPIAuthentication yes
+
Host suse.cz
ForwardAgent yes
SendEnv LC_LANG
@@ -30,6 +33,15 @@ PubkeyAcceptedKeyTypes ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,ssh-rsa-cert
{ "#comment" = "start" }
{ "IdentityFile" = "/etc/ssh/identity.asc" }
{ }
+ { "Match"
+ { "Condition"
+ { "final" = "all" }
+ }
+ { "Settings"
+ { "GSSAPIAuthentication" = "yes" }
+ { }
+ }
+ }
{ "Host" = "suse.cz"
{ "ForwardAgent" = "yes" }
{ "SendEnv"
--
2.31.1

View File

@ -1,251 +0,0 @@
From 59fb794a4c47b811998273323cd49cc91f9db7e2 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 12 Jan 2022 16:11:22 +0000
Subject: [PATCH 8/9] Include mke2fs lens and test from upstream
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1807010
---
lenses/mke2fs.aug | 108 ++++++++++++++++++++++++++---------
lenses/tests/test_mke2fs.aug | 46 ++++++++++++++-
2 files changed, 124 insertions(+), 30 deletions(-)
diff --git a/lenses/mke2fs.aug b/lenses/mke2fs.aug
index dc895490..46a7136e 100644
--- a/lenses/mke2fs.aug
+++ b/lenses/mke2fs.aug
@@ -34,6 +34,14 @@ let sep = IniFile.sep /=[ \t]*/ "="
(* View: empty *)
let empty = IniFile.empty
+(* View: boolean
+ The configuration parser of e2fsprogs recognizes different values
+ for booleans, so list all the recognized values *)
+let boolean = ("y"|"yes"|"true"|"t"|"1"|"on"|"n"|"no"|"false"|"nil"|"0"|"off")
+
+(* View: fspath *)
+let fspath = /[^ \t\n"]+/
+
(************************************************************************
* Group: RECORD TYPES
@@ -47,27 +55,59 @@ let entry (kw:regexp) (lns:lens) = Build.key_value_line kw sep lns
(* View: list_sto
A list of values with given lens *)
-let list_sto (kw:regexp) (lns:lens) = counter "item" .
- entry kw
- (Build.opt_list
- [lns]
- Sep.comma)
+let list_sto (kw:regexp) (lns:lens) =
+ entry kw (Quote.do_dquote_opt_nil (Build.opt_list [lns] Sep.comma))
(* View: entry_sto
Store a regexp as entry value *)
-let entry_sto (kw:regexp) (val:regexp) = entry kw (store val)
+let entry_sto (kw:regexp) (val:regexp) =
+ entry kw (Quote.do_dquote_opt_nil (store val))
+ | entry kw (Util.del_str "\"\"")
(************************************************************************
* Group: COMMON ENTRIES
*************************************************************************)
+
+(* View: common_entries_list
+ Entries with a list value *)
+let common_entries_list = ("base_features"|"default_features"|"default_mntopts")
+
+(* View: common_entries_int
+ Entries with an integer value *)
+let common_entries_int = ("cluster_size"|"flex_bg_size"|"force_undo"
+ |"inode_ratio"|"inode_size"|"num_backup_sb")
+
+(* View: common_entries_bool
+ Entries with a boolean value *)
+let common_entries_bool = ("auto_64-bit_support"|"discard"
+ |"enable_periodic_fsck"|"lazy_itable_init"
+ |"lazy_journal_init"|"packed_meta_blocks")
+
+(* View: common_entries_string
+ Entries with a string value *)
+let common_entries_string = ("encoding"|"journal_location")
+
+(* View: common_entries_double
+ Entries with a double value *)
+let common_entries_double = ("reserved_ratio")
+
(* View: common_entry
Entries shared between <defaults> and <fs_types> sections *)
-let common_entry = list_sto ("base_features"|"default_features")
- (key Rx.word)
+let common_entry = list_sto common_entries_list (key Rx.word)
+ | entry_sto common_entries_int Rx.integer
+ | entry_sto common_entries_bool boolean
+ | entry_sto common_entries_string Rx.word
+ | entry_sto common_entries_double Rx.decimal
| entry_sto "blocksize" ("-"? . Rx.integer)
| entry_sto "hash_alg" ("legacy"|"half_md4"|"tea")
- | entry_sto ("inode_ratio"|"inode_size") Rx.integer
+ | entry_sto "errors" ("continue"|"remount-ro"|"panic")
+ | list_sto "features"
+ ([del /\^/ "^" . label "disable"]?
+ . key Rx.word)
+ | list_sto "options"
+ (key Rx.word . Util.del_str "="
+ . store Rx.word)
(************************************************************************
* Group: DEFAULTS SECTION
@@ -75,11 +115,8 @@ let common_entry = list_sto ("base_features"|"default_features")
(* View: defaults_entry
Possible entries under the <defaults> section *)
-let defaults_entry = entry_sto "force_undo" ("true"|"false")
- | entry_sto "fs_type" Rx.word
- | entry_sto "undo_dir" Rx.fspath
- | list_sto "default_mntopts" (key Rx.word)
- | entry_sto "enable_periodic_fsck" Rx.integer
+let defaults_entry = entry_sto "fs_type" Rx.word
+ | entry_sto "undo_dir" fspath
(* View: defaults_title
Title for the <defaults> section *)
@@ -95,24 +132,12 @@ let defaults = IniFile.record defaults_title
* Group: FS_TYPES SECTION
*************************************************************************)
-(* View: fs_types_entry
- Possible entries under a <fs_types_record> group *)
-let fs_types_entry =list_sto "features"
- ([del /\^/ "^" . label "disable"]?
- . key Rx.word)
- | list_sto "options"
- (key Rx.word . Util.del_str "="
- . store Rx.word)
- | entry_sto "lazy_itable_init" ("true"|"false")
- | entry_sto ("flex_bg_size"|"auto_64-bit_support")
- Rx.integer
-
(* View: fs_types_record
Fs group records under the <fs_types> section *)
let fs_types_record = [ label "filesystem"
. Util.indent . store Rx.word
. del /[ \t]*=[ \t]*\{[ \t]*\n/ " = {\n"
- . ((Util.indent . (fs_types_entry|common_entry)) | empty | comment)*
+ . ((Util.indent . common_entry) | empty | comment)*
. del /[ \t]*\}[ \t]*\n/ " }\n" ]
(* View: fs_types_title
@@ -125,6 +150,33 @@ let fs_types = IniFile.record fs_types_title
(fs_types_record | comment)
+(************************************************************************
+ * Group: OPTIONS SECTION
+ *************************************************************************)
+
+(* View: options_entries_int
+ Entries with an integer value *)
+let options_entries_int = ("proceed_delay"|"sync_kludge")
+
+(* View: options_entries_bool
+ Entries with a boolean value *)
+let options_entries_bool = ("old_bitmaps")
+
+(* View: options_entry
+ Possible entries under the <options> section *)
+let options_entry = entry_sto options_entries_int Rx.integer
+ | entry_sto options_entries_bool boolean
+
+(* View: defaults_title
+ Title for the <options> section *)
+let options_title = IniFile.title "options"
+
+(* View: options
+ A options section *)
+let options = IniFile.record options_title
+ ((Util.indent . options_entry) | comment)
+
+
(************************************************************************
* Group: LENS AND FILTER
*************************************************************************)
@@ -132,7 +184,7 @@ let fs_types = IniFile.record fs_types_title
(* View: lns
The mke2fs lens
*)
-let lns = (empty|comment)* . (defaults|fs_types)*
+let lns = (empty|comment)* . (defaults|fs_types|options)*
(* Variable: filter *)
let filter = incl "/etc/mke2fs.conf"
diff --git a/lenses/tests/test_mke2fs.aug b/lenses/tests/test_mke2fs.aug
index f1ddbe9e..bcf2fe61 100644
--- a/lenses/tests/test_mke2fs.aug
+++ b/lenses/tests/test_mke2fs.aug
@@ -33,6 +33,10 @@ module Test_mke2fs =
inode_ratio = 1048576
blocksize = -1
}
+
+[options]
+ proceed_delay = 1
+ sync_kludge = 1
"
test Mke2fs.lns get conf =
@@ -74,10 +78,48 @@ module Test_mke2fs =
{ "inode_ratio" = "4096" } }
{ "filesystem" = "largefile"
{ "inode_ratio" = "1048576" }
- { "blocksize" = "-1" } } }
+ { "blocksize" = "-1" } }
+ {} }
+ { "options"
+ { "proceed_delay" = "1" }
+ { "sync_kludge" = "1" } }
-test Mke2fs.fs_types_entry
+ let quoted_conf = "[defaults]
+ base_features = \"sparse_super,filetype,resize_inode,dir_index,ext_attr\"
+
+[fs_types]
+ ext4dev = {
+ features = \"has_journal,^extent\"
+ default_mntopts = \"user_xattr\"
+ encoding = \"utf8\"
+ encoding = \"\"
+ }
+"
+
+ test Mke2fs.lns get quoted_conf =
+ { "defaults"
+ { "base_features"
+ { "sparse_super" }
+ { "filetype" }
+ { "resize_inode" }
+ { "dir_index" }
+ { "ext_attr" } }
+ {} }
+ { "fs_types"
+ { "filesystem" = "ext4dev"
+ { "features"
+ { "has_journal" }
+ { "extent"
+ { "disable" } } }
+ { "default_mntopts"
+ { "user_xattr" } }
+ { "encoding" = "utf8" }
+ { "encoding" }
+ } }
+
+
+test Mke2fs.common_entry
put "features = has_journal,^extent\n"
after set "/features/has_journal/disable" "";
rm "/features/extent/disable" = "features = ^has_journal,extent\n"
--
2.31.1

View File

@ -1,28 +1,47 @@
Name: augeas Name: augeas
Version: 1.12.0 Version: 1.13.0
Release: 8%{?dist} Release: 5%{?dist}
Summary: A library for changing configuration files Summary: A library for changing configuration files
Group: System Environment/Libraries
License: LGPLv2+ License: LGPLv2+
URL: http://augeas.net/ URL: http://augeas.net/
Source0: http://download.augeas.net/%{name}-%{version}.tar.gz
# Patches are stored here: # The upstream release tarballs on github don't work, see:
# https://github.com/rwmjones/augeas/tree/rhel-8.8 # https://github.com/hercules-team/augeas/pull/744
# The website release tarballs were not created for 1.13:
# http://download.augeas.net/
#Source0: https://github.com/hercules-team/augeas/archive/refs/tags/release-%{version}.tar.gz
# So I had to create a tarball myself using make dist.
Source0: %{name}-%{version}.tar.gz
Patch1: 0001-Grub-support-in-kernel-command-line-option-names-647.patch # Add new directives and options for chrony.
Patch2: 0002-Rsyslog-support-multiple-actions-in-filters-and-sele.patch # Upstream commit 5f3a566511626c35f69961598f1f332db01ed7a1
Patch3: 0003-src-augrun.c-nexttoken-add-more-escape-characters.patch Patch1: 0001-Chrony-add-new-directives-and-options-745.patch
Patch4: 0004-src-augtool.c-hopefully-fix-readline-quoting-issues.patch
Patch5: 0005-Krb5-improve-dbmodules-and-includes-630.patch # Parse auto_reset_crashkernel in kdump (RHBZ#2042772).
Patch6: 0006-Systemd-fix-parsing-of-envvars-with-spaces-659.patch # Upstream commit 288a028da531a5f58d9ee89bc29fd73e7483bf24
Patch7: 0007-Ssh-add-Match-keyword-support-695.patch Patch2: 0002-Kdump-parse-auto_reset_crashkernel-754.patch
Patch8: 0008-Include-mke2fs-lens-and-test-from-upstream.patch
Patch9: 0009-semanage-Fix-parsing-of-ignoredirs-758.patch # Fix parsing of /etc/selinux/semanage.conf in RHEL 9 (RHBZ#2077120).
# 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
BuildRequires: gcc
BuildRequires: readline-devel
BuildRequires: libselinux-devel
BuildRequires: libxml2-devel
BuildRequires: readline-devel libselinux-devel libxml2-devel
BuildRequires: autoconf, automake
Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release}
%description %description
@ -37,7 +56,6 @@ format and the transformation into a tree.
%package devel %package devel
Summary: Development files for %{name} Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release}
Requires: pkgconfig Requires: pkgconfig
@ -48,9 +66,6 @@ developing applications that use %{name}.
%package libs %package libs
Summary: Libraries for %{name} Summary: Libraries for %{name}
Group: System Environment/Libraries
Provides: bundled(gnulib)
%description libs %description libs
The libraries for %{name}. The libraries for %{name}.
@ -60,6 +75,14 @@ configuration files into a tree structure, which it exposes through its
public API. Changes made through the API are written back to the initially public API. Changes made through the API are written back to the initially
read files. read files.
%package static
Summary: Static libraries for %{name}
Requires: %{name}-devel = %{version}-%{release}
%description static
The %{name}-static package contains static libraries needed to produce
static builds using %{name}.
%prep %prep
@ -70,19 +93,21 @@ read files.
%ifarch riscv64 %ifarch riscv64
--disable-gnulib-tests \ --disable-gnulib-tests \
%endif %endif
--disable-static --enable-static
make V=1 %{?_smp_mflags} make %{?_smp_mflags}
%check %check
# Disable test-preserve.sh SELinux testing. This fails when run under mock due # Disable test-preserve.sh SELinux testing. This fails when run under mock due
# to differing SELinux labelling. # to differing SELinux labelling.
export SKIP_TEST_PRESERVE_SELINUX=1 export SKIP_TEST_PRESERVE_SELINUX=1
make %{?_smp_mflags} check || { # Tests disabled because gnulib tests fail see:
echo '===== tests/test-suite.log =====' # https://bugzilla.redhat.com/show_bug.cgi?id=1674672
cat tests/test-suite.log #make %{?_smp_mflags} check || {
exit 1 # echo '===== tests/test-suite.log ====='
} # cat tests/test-suite.log
# exit 1
#}
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -93,15 +118,12 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
# so it shouldn't be packaged. # so it shouldn't be packaged.
rm -r $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/dist/tests rm -r $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/dist/tests
%clean # In 1.9.0, the example /usr/bin/dump gets installed inadvertently
rm -rf $RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT/usr/bin/dump
%post libs -p /sbin/ldconfig %ldconfig_scriptlets libs
%postun libs -p /sbin/ldconfig
%files %files
%defattr(-,root,root,-)
%{_bindir}/augmatch %{_bindir}/augmatch
%{_bindir}/augparse %{_bindir}/augparse
%{_bindir}/augtool %{_bindir}/augtool
@ -111,7 +133,6 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/vim/vimfiles/ftdetect/augeas.vim %{_datadir}/vim/vimfiles/ftdetect/augeas.vim
%files libs %files libs
%defattr(-,root,root,-)
# _datadir/augeas and _datadir/augeas/lenses are owned # _datadir/augeas and _datadir/augeas/lenses are owned
# by filesystem. # by filesystem.
%{_datadir}/augeas/lenses/dist %{_datadir}/augeas/lenses/dist
@ -119,64 +140,72 @@ rm -rf $RPM_BUILD_ROOT
%doc AUTHORS COPYING NEWS %doc AUTHORS COPYING NEWS
%files devel %files devel
%defattr(-,root,root,-)
%doc %doc
%{_includedir}/* %{_includedir}/*
%{_libdir}/*.so %{_libdir}/*.so
%{_libdir}/pkgconfig/augeas.pc %{_libdir}/pkgconfig/augeas.pc
%files static
%{_libdir}/libaugeas.a
%{_libdir}/libfa.a
%changelog %changelog
* Wed Oct 12 2022 Richard W.M. Jones <rjones@redhat.com> - 1.12.0-8 * Tue Apr 04 2023 Richard W.M. Jones <rjones@redhat.com> - 1.13.0-4
- Fix parsing of semanage.conf ignoredirs - Fix parsing of /usr/lib/tmpfiles.d/provision.conf
resolves: rhbz#1931058 - Fix parsing of /etc/kernel/cmdline
resolves: rhbz#2155136, rhbz#2159282
* Wed Jan 12 2022 Richard W.M. Jones <rjones@redhat.com> - 1.12.0-7 * Thu Oct 06 2022 Richard W.M. Jones <rjones@redhat.com> - 1.13.0-3
- Fix parsing of mke2fs.conf files - Fix parsing of /etc/selinux/semanage.conf in RHEL 9
resolves: rhbz#1807010 resolves: rhbz#2077120
* Tue Jan 05 2021 Pino Toscano <ptoscano@redhat.com> - 1.12.0-6 * Wed Apr 20 2022 Richard W.M. Jones <rjones@redhat.com> - 1.13.0-2
- Ssh: parse Match options (RHBZ#1716359) - Parse auto_reset_crashkernel in kdump
resolves: rhbz#2042772
- Add new directives and options for chrony
* Mon Feb 10 2020 Pino Toscano <ptoscano@redhat.com> - 1.12.0-5 * Wed Jan 12 2022 Richard W.M. Jones <rjones@redhat.com> - 1.13.0-1
- Fix completion with special characters in augtool. (RHBZ#1232224) - New upstream version 1.13.0
- Krb5: improve handling of [dbmodules]; allow include/includedir directives
everywhere (RHBZ#1798486)
- Systemd: improve parsing of quoted variables of Environment (RHBZ#1798922)
* Thu Nov 14 2019 Pino Toscano <ptoscano@redhat.com> - 1.12.0-4 * Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-0.2.git18558bb
- Rsyslog: support multiple actions in filters and selectors (RHBZ#1660884) - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Nov 07 2019 Pino Toscano <ptoscano@redhat.com> - 1.12.0-3 * Tue Jul 06 2021 Richard W.M. Jones <rjones@redhat.com> - 1.12.1-0.1
- Grub: handle '+' in kernel command line options (RHBZ#1769314) - Package up a git pre-release of 1.12.1 or 1.13.0.
* Mon Jun 03 2019 Pino Toscano <ptoscano@redhat.com> - 1.12.0-2 * Thu Apr 15 2021 Richard W.M. Jones <rjones@redhat.com> - 1.12.0-6
- Disable static libraries, not needed in RHEL. - Add upstream patch to parse chrony configuration.
- Use %%autosetup.
* Tue May 14 2019 Pino Toscano <ptoscano@redhat.com> - 1.12.0-1 * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-5
- New upstream release (RHBZ#1709416) - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fstab: allow leading whitespaces (RHBZ#1671950)
* Thu Dec 13 2018 Pino Toscano <ptoscano@redhat.com> - 1.10.1-8 * Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-4
- Add simple tests (RHBZ#1653994) - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Dec 12 2018 Pino Toscano <ptoscano@redhat.com> - 1.10.1-7 * Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-3
- Anaconda: new lens (RHBZ#1657192) - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Nov 29 2018 Pino Toscano <ptoscano@redhat.com> - 1.10.1-6 * Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-2
- Semanage: new lens (RHBZ#1652840) - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
- Add "Provides: bundled(gnulib)" to augeas-libs, as it embeds gnulib
(RHBZ#1653768)
* Fri Nov 23 2018 Pino Toscano <ptoscano@redhat.com> - 1.10.1-5 * Mon Apr 15 2019 Richard W.M. Jones <rjones@redhat.com> - 1.12.0-1
- Rsyslog: support include() directive (RHBZ#1652832) - New upstream release 1.12.0.
* Tue Nov 13 2018 Pino Toscano <ptoscano@redhat.com> - 1.10.1-4 * Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.11.0-4
- Grub: better handle invalid grub.conf files (RHBZ#1649262) - Rebuild for readline 8.0
- Sudoers: handle "always_query_group_plugin" option (RHBZ#1649299)
* Mon Oct 08 2018 Pino Toscano <ptoscano@redhat.com> - 1.10.1-3 * Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-3
- Backport some upstream commits to fix few memory leaks, and potential - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
memory issues (RHBZ#1602446)
* Mon Nov 26 2018 Richard W.M. Jones <rjones@redhat.com> - 1.11.0-2
- Augeas uses gnulib, add the correct 'Provides' line.
* Tue Aug 28 2018 Richard W.M. Jones <rjones@redhat.com> - 1.11.0-1
- New upstream version 1.11.0.
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.1-2 * Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild