diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46d1daa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/augeas-1.12.0.tar.gz diff --git a/0001-Grub-support-in-kernel-command-line-option-names-647.patch b/0001-Grub-support-in-kernel-command-line-option-names-647.patch new file mode 100644 index 0000000..dbeddc1 --- /dev/null +++ b/0001-Grub-support-in-kernel-command-line-option-names-647.patch @@ -0,0 +1,59 @@ +From e666bf968071a9976bd44e1eb65645eb9d51b5cb Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Wed, 23 Oct 2019 11:35:57 +0200 +Subject: [PATCH 1/8] 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 + diff --git a/0002-Rsyslog-support-multiple-actions-in-filters-and-sele.patch b/0002-Rsyslog-support-multiple-actions-in-filters-and-sele.patch new file mode 100644 index 0000000..2c0de8b --- /dev/null +++ b/0002-Rsyslog-support-multiple-actions-in-filters-and-sele.patch @@ -0,0 +1,94 @@ +From eb2dc4ec0879290f42e35a7facc345ca1c70ba69 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= +Date: Tue, 12 Nov 2019 13:33:26 +0100 +Subject: [PATCH 2/8] 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 + diff --git a/0003-src-augrun.c-nexttoken-add-more-escape-characters.patch b/0003-src-augrun.c-nexttoken-add-more-escape-characters.patch new file mode 100644 index 0000000..5c275fd --- /dev/null +++ b/0003-src-augrun.c-nexttoken-add-more-escape-characters.patch @@ -0,0 +1,37 @@ +From 5218c2997b7b77752511ebc61ffa743fd2d8fcbf Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 17 May 2019 13:47:20 +0200 +Subject: [PATCH 3/8] * 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 + diff --git a/0004-src-augtool.c-hopefully-fix-readline-quoting-issues.patch b/0004-src-augtool.c-hopefully-fix-readline-quoting-issues.patch new file mode 100644 index 0000000..8dcbba8 --- /dev/null +++ b/0004-src-augtool.c-hopefully-fix-readline-quoting-issues.patch @@ -0,0 +1,42 @@ +From fc2b84a2ecd9a403cb602d2de26d6c1804a3ceac Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 17 May 2019 15:18:50 +0200 +Subject: [PATCH 4/8] * 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 = "e_detector; + + /* Set up persistent history */ + char *home_dir = get_home_dir(getuid()); +-- +2.31.1 + diff --git a/0005-Krb5-improve-dbmodules-and-includes-630.patch b/0005-Krb5-improve-dbmodules-and-includes-630.patch new file mode 100644 index 0000000..4b42a62 --- /dev/null +++ b/0005-Krb5-improve-dbmodules-and-includes-630.patch @@ -0,0 +1,133 @@ +From 1b4d6a9918b8bcbc06af4ce99a48cd66fed97196 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Tue, 4 Feb 2020 17:54:22 +0100 +Subject: [PATCH 5/8] 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 + diff --git a/0006-Systemd-fix-parsing-of-envvars-with-spaces-659.patch b/0006-Systemd-fix-parsing-of-envvars-with-spaces-659.patch new file mode 100644 index 0000000..f45e50f --- /dev/null +++ b/0006-Systemd-fix-parsing-of-envvars-with-spaces-659.patch @@ -0,0 +1,59 @@ +From eb7c72cfffa5360a65be270c5554abf36739e382 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Tue, 4 Feb 2020 18:05:05 +0100 +Subject: [PATCH 6/8] 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 + diff --git a/0007-Ssh-add-Match-keyword-support-695.patch b/0007-Ssh-add-Match-keyword-support-695.patch new file mode 100644 index 0000000..8f2bc43 --- /dev/null +++ b/0007-Ssh-add-Match-keyword-support-695.patch @@ -0,0 +1,85 @@ +From efd61b77563489ca0fa21904cc1fecfc482afd06 Mon Sep 17 00:00:00 2001 +From: granquet +Date: Tue, 6 Oct 2020 23:03:18 +0200 +Subject: [PATCH 7/8] Ssh: add Match keyword support (#695) + +Signed-off-by: Guillaume Ranquet +--- + 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 + diff --git a/0008-Include-mke2fs-lens-and-test-from-upstream.patch b/0008-Include-mke2fs-lens-and-test-from-upstream.patch new file mode 100644 index 0000000..9ea417c --- /dev/null +++ b/0008-Include-mke2fs-lens-and-test-from-upstream.patch @@ -0,0 +1,251 @@ +From 59fb794a4c47b811998273323cd49cc91f9db7e2 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 12 Jan 2022 16:11:22 +0000 +Subject: [PATCH 8/8] 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 and 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 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 section *) +@@ -95,24 +132,12 @@ let defaults = IniFile.record defaults_title + * Group: FS_TYPES SECTION + *************************************************************************) + +-(* View: fs_types_entry +- Possible entries under a 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 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 section *) ++let options_entry = entry_sto options_entries_int Rx.integer ++ | entry_sto options_entries_bool boolean ++ ++(* View: defaults_title ++ Title for the 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 + diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/augeas.spec b/augeas.spec new file mode 100644 index 0000000..e39e080 --- /dev/null +++ b/augeas.spec @@ -0,0 +1,356 @@ +Name: augeas +Version: 1.12.0 +Release: 7%{?dist} +Summary: A library for changing configuration files + +Group: System Environment/Libraries +License: LGPLv2+ +URL: http://augeas.net/ +Source0: http://download.augeas.net/%{name}-%{version}.tar.gz + +# Patches are stored here: +# https://github.com/rwmjones/augeas/tree/rhel-8.6 + +Patch1: 0001-Grub-support-in-kernel-command-line-option-names-647.patch +Patch2: 0002-Rsyslog-support-multiple-actions-in-filters-and-sele.patch +Patch3: 0003-src-augrun.c-nexttoken-add-more-escape-characters.patch +Patch4: 0004-src-augtool.c-hopefully-fix-readline-quoting-issues.patch +Patch5: 0005-Krb5-improve-dbmodules-and-includes-630.patch +Patch6: 0006-Systemd-fix-parsing-of-envvars-with-spaces-659.patch +Patch7: 0007-Ssh-add-Match-keyword-support-695.patch +Patch8: 0008-Include-mke2fs-lens-and-test-from-upstream.patch + +BuildRequires: readline-devel libselinux-devel libxml2-devel +BuildRequires: autoconf, automake +Requires: %{name}-libs = %{version}-%{release} + +%description +A library for programmatically editing configuration files. Augeas parses +configuration files into a tree structure, which it exposes through its +public API. Changes made through the API are written back to the initially +read files. + +The transformation works very hard to preserve comments and formatting +details. It is controlled by ``lens'' definitions that describe the file +format and the transformation into a tree. + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} +Requires: pkgconfig + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%package libs +Summary: Libraries for %{name} +Group: System Environment/Libraries + +Provides: bundled(gnulib) + +%description libs +The libraries for %{name}. + +Augeas is a library for programmatically editing configuration files. It parses +configuration files into a tree structure, which it exposes through its +public API. Changes made through the API are written back to the initially +read files. + + + +%prep +%autosetup -p1 + +%build +%configure \ +%ifarch riscv64 + --disable-gnulib-tests \ +%endif + --disable-static +make V=1 %{?_smp_mflags} + +%check +# Disable test-preserve.sh SELinux testing. This fails when run under mock due +# to differing SELinux labelling. +export SKIP_TEST_PRESERVE_SELINUX=1 + +make %{?_smp_mflags} check || { + echo '===== tests/test-suite.log =====' + cat tests/test-suite.log + exit 1 +} + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p" +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' + +# The tests/ subdirectory contains lenses used only for testing, and +# so it shouldn't be packaged. +rm -r $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/dist/tests + +%clean +rm -rf $RPM_BUILD_ROOT + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%{_bindir}/augmatch +%{_bindir}/augparse +%{_bindir}/augtool +%{_bindir}/fadot +%doc %{_mandir}/man1/* +%{_datadir}/vim/vimfiles/syntax/augeas.vim +%{_datadir}/vim/vimfiles/ftdetect/augeas.vim + +%files libs +%defattr(-,root,root,-) +# _datadir/augeas and _datadir/augeas/lenses are owned +# by filesystem. +%{_datadir}/augeas/lenses/dist +%{_libdir}/*.so.* +%doc AUTHORS COPYING NEWS + +%files devel +%defattr(-,root,root,-) +%doc +%{_includedir}/* +%{_libdir}/*.so +%{_libdir}/pkgconfig/augeas.pc + +%changelog +* Wed Jan 12 2022 Richard W.M. Jones - 1.12.0-7 +- Fix parsing of mke2fs.conf files + resolves: rhbz#1807010 + +* Tue Jan 05 2021 Pino Toscano - 1.12.0-6 +- Ssh: parse Match options (RHBZ#1716359) + +* Mon Feb 10 2020 Pino Toscano - 1.12.0-5 +- Fix completion with special characters in augtool. (RHBZ#1232224) +- 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 - 1.12.0-4 +- Rsyslog: support multiple actions in filters and selectors (RHBZ#1660884) + +* Thu Nov 07 2019 Pino Toscano - 1.12.0-3 +- Grub: handle '+' in kernel command line options (RHBZ#1769314) + +* Mon Jun 03 2019 Pino Toscano - 1.12.0-2 +- Disable static libraries, not needed in RHEL. + +* Tue May 14 2019 Pino Toscano - 1.12.0-1 +- New upstream release (RHBZ#1709416) + * Fstab: allow leading whitespaces (RHBZ#1671950) + +* Thu Dec 13 2018 Pino Toscano - 1.10.1-8 +- Add simple tests (RHBZ#1653994) + +* Wed Dec 12 2018 Pino Toscano - 1.10.1-7 +- Anaconda: new lens (RHBZ#1657192) + +* Thu Nov 29 2018 Pino Toscano - 1.10.1-6 +- Semanage: new lens (RHBZ#1652840) +- Add "Provides: bundled(gnulib)" to augeas-libs, as it embeds gnulib + (RHBZ#1653768) + +* Fri Nov 23 2018 Pino Toscano - 1.10.1-5 +- Rsyslog: support include() directive (RHBZ#1652832) + +* Tue Nov 13 2018 Pino Toscano - 1.10.1-4 +- Grub: better handle invalid grub.conf files (RHBZ#1649262) +- Sudoers: handle "always_query_group_plugin" option (RHBZ#1649299) + +* Mon Oct 08 2018 Pino Toscano - 1.10.1-3 +- Backport some upstream commits to fix few memory leaks, and potential + memory issues (RHBZ#1602446) + +* Wed Feb 07 2018 Fedora Release Engineering - 1.10.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Jan 29 2018 David Lutterkort - 1.10.1-1 +- New upstream version 1.10.1 + +* Fri Jan 26 2018 Richard W.M. Jones - 1.10.0-1 +- New upstream version 1.10.0 (RHBZ#1538846). +- Remove upstream patch. +- New tool ‘augmatch’. + +* Tue Nov 21 2017 David Lutterkort - 1.9.0 +- New upstream version 1.9.0 (RHBZ#1482713) +- Add -static subpackage (RHBZ#1405600) + +* Thu Aug 24 2017 Richard W.M. Jones - 1.8.1-1 +- New upstream version 1.8.1. +- Fixes CVE-2017-7555 (RHBZ#1482340). + +* Wed Aug 02 2017 Fedora Release Engineering - 1.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Mar 21 2017 Dominic Cleal - 1.8.0-1 +- Update to 1.8.0 + +* Fri Feb 10 2017 Fedora Release Engineering - 1.7.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Jan 12 2017 Igor Gnatenko - 1.7.0-3 +- Rebuild for readline 7.x + +* Sat Nov 12 2016 Richard W.M. Jones - 1.7.0-2 +- riscv64: Disable gnulib tests on riscv64 architecture. + +* Wed Nov 09 2016 Dominic Cleal - 1.7.0-1 +- Update to 1.7.0 + +* Mon Aug 08 2016 Dominic Cleal - 1.6.0-1 +- Update to 1.6.0 + +* Thu May 12 2016 Dominic Cleal - 1.5.0-1 +- Update to 1.5.0 + +* Wed Feb 03 2016 Fedora Release Engineering - 1.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Jun 02 2015 Dominic Cleal - 1.4.0-1 +- Update to 1.4.0 + +* Sat Nov 08 2014 Dominic Cleal - 1.3.0-1 +- Update to 1.3.0; remove all patches + +* Fri Aug 15 2014 Fedora Release Engineering - 1.2.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Mar 31 2014 Dominic Cleal - 1.2.0-2 +- Add patch for Krb5, parse braces in values (RHBZ#1079444) + +* Wed Feb 12 2014 Dominic Cleal - 1.2.0-1 +- Update to 1.2.0, add check section +- Update source URL to download.augeas.net (RHBZ#996032) + +* Sat Aug 03 2013 Fedora Release Engineering - 1.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jun 19 2013 David Lutterkort - 1.1.0-1 +- Update to 1.1.0; remove all patches + +* Tue Jun 18 2013 Richard W.M. Jones - 1.0.0-4 +- Fix /etc/sysconfig/network (RHBZ#904222). + +* Wed Jun 5 2013 Richard W.M. Jones - 1.0.0-3 +- Don't package lenses in tests/ subdirectory. + +* Wed Feb 13 2013 Fedora Release Engineering - 1.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Jan 4 2013 David Lutterkort - 1.0.0-1 +- New version; remove all patches + +* Wed Jul 18 2012 Fedora Release Engineering - 0.10.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jan 10 2012 David Lutterkort - 0.10.0-3 +- Add patches for bugs 247 and 248 (JSON lens) + +* Sat Dec 3 2011 Richard W.M. Jones - 0.10.0-2 +- Add patch to resolve missing libxml2 requirement in augeas.pc. + +* Fri Dec 2 2011 David Lutterkort - 0.10.0-1 +- New version + +* Mon Jul 25 2011 David Lutterkort - 0.9.0-1 +- New version; removed patch pathx-whitespace-ea010d8 + +* Tue May 3 2011 David Lutterkort - 0.8.1-2 +- Add patch pathx-whitespace-ea010d8.patch to fix BZ 700608 + +* Fri Apr 15 2011 David Lutterkort - 0.8.1-1 +- New version + +* Wed Feb 23 2011 David Lutterkort - 0.8.0-1 +- New version + +* Mon Feb 07 2011 Fedora Release Engineering - 0.7.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Nov 22 2010 Matthew Booth - 0.7.4-1 +- Update to version 0.7.4 + +* Thu Nov 18 2010 Richard W.M. Jones - 0.7.3-2 +- Upstream patch proposed to fix GCC optimization bug (RHBZ#651992). + +* Fri Aug 6 2010 David Lutterkort - 0.7.3-1 +- Remove upstream patches + +* Tue Jun 29 2010 David Lutterkort - 0.7.2-2 +- Patches based on upstream fix for BZ 600141 + +* Tue Jun 22 2010 David Lutterkort - 0.7.2-1 +- Fix ownership of /usr/share/augeas. BZ 569393 + +* Wed Apr 21 2010 David Lutterkort - 0.7.1-1 +- New version + +* Thu Jan 14 2010 David Lutterkort - 0.7.0-1 +- Remove patch vim-ftdetect-syntax.patch. It's upstream + +* Tue Dec 15 2009 David Lutterkort - 0.6.0-2 +- Fix ftdetect file for vim + +* Mon Nov 30 2009 David Lutterkort - 0.6.0-1 +- Install vim syntax files + +* Mon Sep 14 2009 David Lutterkort - 0.5.3-1 +- Remove separate xorg.aug, included in upstream source + +* Tue Aug 25 2009 Matthew Booth - 0.5.2-3 +- Include new xorg lens from upstream + +* Fri Jul 24 2009 Fedora Release Engineering - 0.5.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Jul 13 2009 David Lutterkort - 0.5.2-1 +- New version + +* Fri Jun 5 2009 David Lutterkort - 0.5.1-1 +- Install fadot + +* Fri Mar 27 2009 David Lutterkort - 0.5.0-2 +- fadot isn't being installed just yet + +* Tue Mar 24 2009 David Lutterkort - 0.5.0-1 +- New program /usr/bin/fadot + +* Mon Mar 9 2009 David Lutterkort - 0.4.2-1 +- New version + +* Fri Feb 27 2009 David Lutterkort - 0.4.1-1 +- New version + +* Fri Feb 6 2009 David Lutterkort - 0.4.0-1 +- New version + +* Mon Jan 26 2009 David Lutterkort - 0.3.6-1 +- New version + +* Tue Dec 23 2008 David Lutterkort - 0.3.5-1 +- New version + +* Mon Feb 25 2008 David Lutterkort - 0.0.4-1 +- Initial specfile diff --git a/sources b/sources new file mode 100644 index 0000000..960a902 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (augeas-1.12.0.tar.gz) = 4f61d4abbf338e915dfae212560d39792674bc757f05f500afa80c6170abc214ffb99cab2cf5bbd1c2338d11a6909e5fc3ff7112a2246fca69f7b39ac283da40