diff --git a/SOURCES/0001-Grub-support-the-setkey-directive.patch b/SOURCES/0001-Grub-support-the-setkey-directive.patch new file mode 100644 index 0000000..5cc956a --- /dev/null +++ b/SOURCES/0001-Grub-support-the-setkey-directive.patch @@ -0,0 +1,160 @@ +From bc46ce8269a89a55b87a906226cfe8b54e9e5d11 Mon Sep 17 00:00:00 2001 +From: Matthew Booth <mbooth@redhat.com> +Date: Tue, 27 Aug 2013 15:24:48 +0100 +Subject: [PATCH 1/3] Grub: support the 'setkey' directive + +--- + lenses/grub.aug | 7 +++++++ + lenses/tests/test_grub.aug | 6 ++++++ + 2 files changed, 13 insertions(+) + +diff --git a/lenses/grub.aug b/lenses/grub.aug +index 2c19ffa..d8fd5ed 100644 +--- a/lenses/grub.aug ++++ b/lenses/grub.aug +@@ -132,6 +132,12 @@ module Grub = + |[ spc . switch_arg /timeout|lines/ ])* . + [ spc . key /console|serial|hercules/ ]* . eol ] + ++ (* View: setkey *) ++ let setkey = [ command "setkey" "" . ++ ( spc . [ label "to" . store Rx.no_spaces ] . ++ spc . [ label "from" . store Rx.no_spaces ] )? . ++ eol ] ++ + (* View: menu_setting *) + let menu_setting = kw_menu_arg "default" + | kw_menu_arg "fallback" +@@ -145,6 +151,7 @@ module Grub = + | password_arg + | color + | device ++ | setkey + + (* View: title *) + let title = del /title[ \t=]+/ "title " . value_to_eol . eol +diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug +index 3eba710..e4dc228 100644 +--- a/lenses/tests/test_grub.aug ++++ b/lenses/tests/test_grub.aug +@@ -12,6 +12,8 @@ module Test_grub = + device (hd0) HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4) + password --md5 $1$M9NLj$p2gs87vwNv48BUu.wAfVw0 + default=0 ++setkey ++setkey less backquote + background 103332 + timeout=5 + splashimage=(hd0,0)/grub/splash.xpm.gz +@@ -54,6 +56,10 @@ title othermenu + { "password" = "$1$M9NLj$p2gs87vwNv48BUu.wAfVw0" + { "md5" } } + { "default" = "0" } ++ { "setkey" } ++ { "setkey" ++ { "to" = "less" } ++ { "from" = "backquote" } } + { "background" = "103332" } + { "timeout" = "5" } + { "splashimage" = "(hd0,0)/grub/splash.xpm.gz" } +-- +1.8.3.1 + + +From f55175ed0e17a5a4f50a32d9ad5cba5f486eb577 Mon Sep 17 00:00:00 2001 +From: Matthew Booth <mbooth@redhat.com> +Date: Tue, 27 Aug 2013 15:24:49 +0100 +Subject: [PATCH 2/3] Grub: NFC fix whitespace errors introduced by 4e09d15 + +Kill tabs! +--- + lenses/grub.aug | 6 +++--- + lenses/tests/test_grub.aug | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lenses/grub.aug b/lenses/grub.aug +index d8fd5ed..a64a572 100644 +--- a/lenses/grub.aug ++++ b/lenses/grub.aug +@@ -102,8 +102,8 @@ module Grub = + * This is a shell-only directive in upstream grub; the grub versions + * in at least Fedora/RHEL use this to find devices for UEFI boot *) + let device = +- [ command "device" "" . Sep.space . store /\([A-Za-z0-9_.-]+\)/ . spc . +- [ label "file" . value_to_eol ] . Util.eol ] ++ [ command "device" "" . Sep.space . store /\([A-Za-z0-9_.-]+\)/ . spc . ++ [ label "file" . value_to_eol ] . Util.eol ] + + (* View: color *) + let color = +@@ -150,7 +150,7 @@ module Grub = + | terminal + | password_arg + | color +- | device ++ | device + | setkey + + (* View: title *) +diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug +index e4dc228..87bb243 100644 +--- a/lenses/tests/test_grub.aug ++++ b/lenses/tests/test_grub.aug +@@ -52,7 +52,7 @@ title othermenu + { "#comment" = "initrd /initrd-version.img" } + { "#comment" = "boot=/dev/sda" } + { "device" = "(hd0)" +- { "file" = "HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)" } } ++ { "file" = "HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)" } } + { "password" = "$1$M9NLj$p2gs87vwNv48BUu.wAfVw0" + { "md5" } } + { "default" = "0" } +-- +1.8.3.1 + + +From e3f1c15155fba5c10e74b400f2b06c8a31372420 Mon Sep 17 00:00:00 2001 +From: Matthew Booth <mbooth@redhat.com> +Date: Tue, 27 Aug 2013 15:24:50 +0100 +Subject: [PATCH 3/3] Grub: support the 'lock' directive + +--- + lenses/grub.aug | 1 + + lenses/tests/test_grub.aug | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/lenses/grub.aug b/lenses/grub.aug +index a64a572..9f8d6af 100644 +--- a/lenses/grub.aug ++++ b/lenses/grub.aug +@@ -216,6 +216,7 @@ module Grub = + | configfile + | module_line + | map_line ++ | kw_pres "lock" + + (* View: boot *) + let boot = +diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug +index 87bb243..de6397d 100644 +--- a/lenses/tests/test_grub.aug ++++ b/lenses/tests/test_grub.aug +@@ -38,6 +38,7 @@ title Fedora (2.6.24.3-34.fc8) + initrd /initrd-2.6.24.3-34.fc8.img + map (hd0) (hd1) + title othermenu ++ lock + configfile /boot/grub/othergrub.conf + " + +@@ -88,6 +89,7 @@ title othermenu + { "initrd" = "/initrd-2.6.24.3-34.fc8.img" } + { "map" { "from" = "(hd0)" } { "to" = "(hd1)" } } } + { "title" = "othermenu" ++ { "lock" } + { "configfile" = "/boot/grub/othergrub.conf" } } + + +-- +1.8.3.1 + diff --git a/SOURCES/0002-src-transform.c-filter_matches-wrap-fnmatch-to-ensur.patch b/SOURCES/0002-src-transform.c-filter_matches-wrap-fnmatch-to-ensur.patch new file mode 100644 index 0000000..58c9b54 --- /dev/null +++ b/SOURCES/0002-src-transform.c-filter_matches-wrap-fnmatch-to-ensur.patch @@ -0,0 +1,143 @@ +From 361adbf9e520d695ae13efe6084cbcdebe4779e2 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Tue, 19 Nov 2013 09:39:23 +0000 +Subject: [PATCH] * src/transform.c (filter_matches): wrap fnmatch to ensure + that an incl pattern containing "//" matches file paths + +Fixes RHBZ#1031084 +--- + src/transform.c | 38 ++++++++++++++++++++++++++++++++++---- + tests/test-save.c | 39 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 73 insertions(+), 4 deletions(-) + +diff --git a/src/transform.c b/src/transform.c +index 1ee8da8..ccbe422 100644 +--- a/src/transform.c ++++ b/src/transform.c +@@ -142,6 +142,33 @@ static char *mtime_as_string(struct augeas *aug, const char *fname) { + return NULL; + } + ++/* fnmatch(3) which will match // in a pattern to a path, like glob(3) does */ ++static int fnmatch_normalize(const char *pattern, const char *string, int flags) { ++ int i, j, r; ++ char *pattern_norm = NULL; ++ ++ r = ALLOC_N(pattern_norm, strlen(pattern) + 1); ++ if (r < 0) ++ goto error; ++ ++ for (i = 0, j = 0; i < strlen(pattern); i++) { ++ if (pattern[i] != '/' || pattern[i+1] != '/') { ++ pattern_norm[j] = pattern[i]; ++ j++; ++ } ++ } ++ pattern_norm[j] = 0; ++ ++ r = fnmatch(pattern_norm, string, flags); ++ FREE(pattern_norm); ++ return r; ++ ++ error: ++ if (pattern_norm != NULL) ++ FREE(pattern_norm); ++ return -1; ++} ++ + static bool file_current(struct augeas *aug, const char *fname, + struct tree *finfo) { + struct tree *mtime = tree_child(finfo, s_mtime); +@@ -217,9 +244,12 @@ static int filter_generate(struct tree *xfm, const char *root, + + if (strchr(e->value, SEP) == NULL) + path = pathbase(path); +- if ((r = fnmatch(e->value, path, fnm_flags)) == 0) { ++ ++ r = fnmatch_normalize(e->value, path, fnm_flags); ++ if (r < 0) ++ goto error; ++ else if (r == 0) + include = false; +- } + } + + if (include) +@@ -254,7 +284,7 @@ static int filter_generate(struct tree *xfm, const char *root, + static int filter_matches(struct tree *xfm, const char *path) { + int found = 0; + list_for_each(f, xfm->children) { +- if (is_incl(f) && fnmatch(f->value, path, fnm_flags) == 0) { ++ if (is_incl(f) && fnmatch_normalize(f->value, path, fnm_flags) == 0) { + found = 1; + break; + } +@@ -262,7 +292,7 @@ static int filter_matches(struct tree *xfm, const char *path) { + if (! found) + return 0; + list_for_each(f, xfm->children) { +- if (is_excl(f) && (fnmatch(f->value, path, fnm_flags) == 0)) ++ if (is_excl(f) && (fnmatch_normalize(f->value, path, fnm_flags) == 0)) + return 0; + } + return 1; +diff --git a/tests/test-save.c b/tests/test-save.c +index 04b86f7..617ef31 100644 +--- a/tests/test-save.c ++++ b/tests/test-save.c +@@ -183,6 +183,44 @@ static void testRelPath(CuTest *tc) { + CuAssertIntEquals(tc, 1, r); + } + ++/* Check that loading and saving a file with // in the incl pattern works. ++ * RHBZ#1031084 ++ */ ++static void testDoubleSlashPath(CuTest *tc) { ++ int r; ++ ++ r = aug_rm(aug, "/augeas/load/*"); ++ CuAssertPositive(tc, r); ++ ++ r = aug_set(aug, "/augeas/load/Hosts/lens", "Hosts.lns"); ++ CuAssertRetSuccess(tc, r); ++ r = aug_set(aug, "/augeas/load/Hosts/incl", "/etc//hosts"); ++ CuAssertRetSuccess(tc, r); ++ r = aug_load(aug); ++ CuAssertRetSuccess(tc, r); ++ ++ r = aug_match(aug, "/files/etc/hosts/1/alias[ . = 'new']", NULL); ++ CuAssertIntEquals(tc, 0, r); ++ ++ r = aug_set(aug, "/files/etc/hosts/1/alias[last() + 1]", "new"); ++ CuAssertRetSuccess(tc, r); ++ ++ r = aug_save(aug); ++ CuAssertRetSuccess(tc, r); ++ r = aug_match(aug, "/augeas//error", NULL); ++ CuAssertIntEquals(tc, 0, r); ++ ++ /* Force reloading the file */ ++ r = aug_rm(aug, "/augeas/files//mtime"); ++ CuAssertPositive(tc, r); ++ ++ r = aug_load(aug); ++ CuAssertRetSuccess(tc, r); ++ ++ r = aug_match(aug, "/files/etc/hosts/1/alias[. = 'new']", NULL); ++ CuAssertIntEquals(tc, 1, r); ++} ++ + int main(void) { + char *output = NULL; + CuSuite* suite = CuSuiteNew(); +@@ -206,6 +244,7 @@ int main(void) { + SUITE_ADD_TEST(suite, testMultipleXfm); + SUITE_ADD_TEST(suite, testMtime); + SUITE_ADD_TEST(suite, testRelPath); ++ SUITE_ADD_TEST(suite, testDoubleSlashPath); + + CuSuiteRun(suite); + CuSuiteSummary(suite, &output); +-- +1.8.3.1 + diff --git a/SOURCES/0003-Sysconfig-permit-empty-comments-after-comment-lines.patch b/SOURCES/0003-Sysconfig-permit-empty-comments-after-comment-lines.patch new file mode 100644 index 0000000..acd63ce --- /dev/null +++ b/SOURCES/0003-Sysconfig-permit-empty-comments-after-comment-lines.patch @@ -0,0 +1,43 @@ +From 92274bd3ff47d3cc4511d934dae06f16b59db7ad Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 16 Dec 2013 20:45:36 +0000 +Subject: [PATCH] Sysconfig: permit empty comments after comment lines + +Fixes RHBZ#1043636 +--- + lenses/sysconfig.aug | 3 ++- + lenses/tests/test_sysconfig.aug | 4 ++++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/lenses/sysconfig.aug b/lenses/sysconfig.aug +index a39d7f3..ee83af1 100644 +--- a/lenses/sysconfig.aug ++++ b/lenses/sysconfig.aug +@@ -11,7 +11,8 @@ module Sysconfig = + let key_re = Shellvars.key_re + let eq = Util.del_str "=" + +- let comment = Util.comment ++ let eol_for_comment = del /([ \t]*\n)([ \t]*(#[ \t]*)?\n)*/ "\n" ++ let comment = Util.comment_generic_seteol /[ \t]*#[ \t]*/ "# " eol_for_comment + let comment_or_eol = Shellvars.comment_or_eol + + let empty = Util.empty +diff --git a/lenses/tests/test_sysconfig.aug b/lenses/tests/test_sysconfig.aug +index 3e9356d..539ad99 100644 +--- a/lenses/tests/test_sysconfig.aug ++++ b/lenses/tests/test_sysconfig.aug +@@ -142,6 +142,10 @@ unset ONBOOT # We do not want this var + test lns put "var=v\n" after set "/var" "v\"w"= + "var='v\"w'\n" + ++ (* RHBZ#1043636: empty comment lines after comments *) ++ test lns get "#MOUNTD_NFS_V3\n#\n" = ++ { "#comment" = "MOUNTD_NFS_V3" } ++ + (* Local Variables: *) + (* mode: caml *) + (* End: *) +-- +1.8.4.2 + diff --git a/SOURCES/0004-tests-test-load.c-testPermsErrorReported-skip-permis.patch b/SOURCES/0004-tests-test-load.c-testPermsErrorReported-skip-permis.patch new file mode 100644 index 0000000..97f65a7 --- /dev/null +++ b/SOURCES/0004-tests-test-load.c-testPermsErrorReported-skip-permis.patch @@ -0,0 +1,38 @@ +From b0fa354ecada84f7a4fdf586c08ae99ca2dd9a65 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 2 Sep 2013 18:29:49 +0100 +Subject: [PATCH] * tests/test-load.c (testPermsErrorReported): skip + permissions test when root + +--- + tests/test-load.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tests/test-load.c b/tests/test-load.c +index ef6c01a..fb63a62 100644 +--- a/tests/test-load.c ++++ b/tests/test-load.c +@@ -21,6 +21,8 @@ + */ + + #include <config.h> ++#include <sys/types.h> ++#include <unistd.h> + + #include "augeas.h" + +@@ -529,6 +531,11 @@ static void testParseErrorReported(CuTest *tc) { + + /* Test failed file opening is reported, e.g. EACCES */ + static void testPermsErrorReported(CuTest *tc) { ++ if (getuid() == 0) { ++ puts("pending (testPermsErrorReported): can't test permissions under root account"); ++ return; ++ } ++ + augeas *aug = NULL; + int r; + const char *s; +-- +1.8.4.2 + diff --git a/SOURCES/0005-Shellvars-Sysconfig-map-bare-export-and-unset-lines-.patch b/SOURCES/0005-Shellvars-Sysconfig-map-bare-export-and-unset-lines-.patch new file mode 100644 index 0000000..7ce0fad --- /dev/null +++ b/SOURCES/0005-Shellvars-Sysconfig-map-bare-export-and-unset-lines-.patch @@ -0,0 +1,132 @@ +From c40fc2b24f9f3b104603e3d19ff2b0975b1af9cc Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Thu, 2 Jan 2014 13:50:41 +0000 +Subject: [PATCH] Shellvars, Sysconfig: map "bare" export and unset lines using + seq to handle multiple variables + +Fixes RHBZ#1033795 + +(cherry picked from commit 15ec3753b0ba82e155426288572f6b92c3cafc59) + +Conflicts: + NEWS + lenses/tests/test_shellvars.aug +--- + lenses/shellvars.aug | 6 ++++-- + lenses/tests/test_shellvars.aug | 21 ++++++++++++++++----- + lenses/tests/test_sysconfig.aug | 8 +++++--- + 3 files changed, 25 insertions(+), 10 deletions(-) + +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index a88ad83..da19379 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -63,8 +63,10 @@ module Shellvars = + . eq . (simple_value | array) . comment_or_eol ] + + let var_action (name:string) = +- [ Util.indent . xchgs name ("@" . name) . Util.del_ws_spc +- . store (key_re | matching_re) . comment_or_eol ] ++ Util.indent . del name name . Util.del_ws_spc . ++ [ label ("@" . name) . counter "var_action" ++ . Build.opt_list [ seq "var_action" . store (key_re | matching_re) ] Util.del_ws_spc ++ . comment_or_eol ] + + let unset = var_action "unset" + let bare_export = var_action "export" +diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug +index 9aea433..79a5a4e 100644 +--- a/lenses/tests/test_shellvars.aug ++++ b/lenses/tests/test_shellvars.aug +@@ -30,7 +30,8 @@ unset ONBOOT # We do not want this var + { "#comment" = "DHCP_HOSTNAME=host.example.com" } + { "NETMASK" = "255.255.255.0" } + { "NETWORK" = "172.31.0.0" } +- { "@unset" = "ONBOOT" ++ { "@unset" ++ { "1" = "ONBOOT" } + { "#comment" = "We do not want this var" } } + + test lns put eth_static after +@@ -147,7 +148,8 @@ unset ONBOOT # We do not want this var + + (* Bug 109: allow a bare export *) + test lns get "export FOO\n" = +- { "@export" = "FOO" } ++ { "@export" ++ { "1" = "FOO" } } + + (* Bug 73: allow ulimit builtin *) + test lns get "ulimit -c unlimited\n" = +@@ -259,7 +261,8 @@ esac\n" = + { "@case_entry" = "/tmp/file2" + { ".source" = "/tmp/file2" } } + { "@case_entry" = "*" +- { "@unset" = "f" } } } ++ { "@unset" ++ { "1" = "f" } } } } + + (* Select *) + test lns get "select i in a b c; do . /tmp/file$i +@@ -346,7 +349,8 @@ esac\n" = + { "#comment" = "comment before 2" } + { "@case_entry" = "*" + { "#comment" = "comment in 2" } +- { "@unset" = "f" } } ++ { "@unset" ++ { "1" = "f" } } } + { "#comment" = "comment after" } } + + (* Empty case *) +@@ -397,7 +401,8 @@ esac\n" = + + (* unset can be used on wildcard variables *) + test Shellvars.lns get "unset ${!LC_*}\n" = +- { "@unset" = "${!LC_*}" } ++ { "@unset" ++ { "1" = "${!LC_*}" } } + + (* Empty comment before entries *) + test Shellvars.lns get "# \nfoo=bar\n" = +@@ -435,6 +440,12 @@ esac\n" = + { "#comment" = "foo" } + { "foo" = "bar" } + ++ (* Export of multiple variables, RHBZ#1033795 *) ++ test lns get "export TestVar1 TestVar2\n" = ++ { "@export" ++ { "1" = "TestVar1" } ++ { "2" = "TestVar2" } } ++ + (* Local Variables: *) + (* mode: caml *) + (* End: *) +diff --git a/lenses/tests/test_sysconfig.aug b/lenses/tests/test_sysconfig.aug +index 539ad99..fa1601a 100644 +--- a/lenses/tests/test_sysconfig.aug ++++ b/lenses/tests/test_sysconfig.aug +@@ -30,8 +30,9 @@ unset ONBOOT # We do not want this var + { "#comment" = "DHCP_HOSTNAME=host.example.com" } + { "NETMASK" = "255.255.255.0" } + { "NETWORK" = "172.31.0.0" } +- { "@unset" = "ONBOOT" +- { "#comment" = "We do not want this var" } } ++ { "@unset" ++ { "1" = "ONBOOT" } ++ { "#comment" = "We do not want this var" } } + + test lns put eth_static after + set "BOOTPROTO" "dhcp" ; +@@ -124,7 +125,8 @@ unset ONBOOT # We do not want this var + + (* Bug 109: allow a bare export *) + test lns get "export FOO\n" = +- { "@export" = "FOO" } ++ { "@export" ++ { "1" = "FOO" } } + + (* Check we put quotes in when changes require them *) + test lns put "var=\"v\"\n" after rm "/foo" = +-- +1.8.4.2 + diff --git a/SOURCES/0006-Fix-umask-handling-when-creating-new-files.patch b/SOURCES/0006-Fix-umask-handling-when-creating-new-files.patch new file mode 100644 index 0000000..1496bc0 --- /dev/null +++ b/SOURCES/0006-Fix-umask-handling-when-creating-new-files.patch @@ -0,0 +1,113 @@ +From 0f7c1ef8e06413679928746c7206786210d3df1e Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 2 Dec 2013 17:49:35 +0000 +Subject: [PATCH] Fix umask handling when creating new files + + * src/transform.c (transform_save): faulty umask arithmetic would cause + overly-open file modes when the umask contains "7", as the umask was + incorrectly subtracted from the target file mode + +Fixes CVE-2013-6412, RHBZ#1034261 + +(cherry picked from commit f5b4fc0ceb0e5a2be5f3a19f63ad936897a3ac26) +--- + src/transform.c | 2 +- + tests/test-save.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 49 insertions(+), 1 deletion(-) + +diff --git a/src/transform.c b/src/transform.c +index ccbe422..b0288fc 100644 +--- a/src/transform.c ++++ b/src/transform.c +@@ -1144,7 +1144,7 @@ int transform_save(struct augeas *aug, struct tree *xfm, + mode_t curumsk = umask(022); + umask(curumsk); + +- if (fchmod(fileno(fp), 0666 - curumsk) < 0) { ++ if (fchmod(fileno(fp), 0666 & ~curumsk) < 0) { + err_status = "create_chmod"; + return -1; + } +diff --git a/tests/test-save.c b/tests/test-save.c +index 617ef31..f28f626 100644 +--- a/tests/test-save.c ++++ b/tests/test-save.c +@@ -26,6 +26,7 @@ + #include "cutest.h" + + #include <stdio.h> ++#include <sys/stat.h> + #include <sys/types.h> + #include <sys/wait.h> + +@@ -51,6 +52,7 @@ static void setup(CuTest *tc) { + if (asprintf(&lensdir, "%s/lenses", abs_top_srcdir) < 0) + CuFail(tc, "asprintf lensdir failed"); + ++ umask(0022); + run(tc, "test -d %s && chmod -R u+w %s || :", root, root); + run(tc, "rm -rf %s", root); + run(tc, "mkdir -p %s", root); +@@ -221,6 +223,49 @@ static void testDoubleSlashPath(CuTest *tc) { + CuAssertIntEquals(tc, 1, r); + } + ++/* Check the umask is followed when creating files ++ */ ++static void testUmask(CuTest *tc, int tumask, mode_t expected_mode) { ++ int r; ++ struct stat buf; ++ char* fpath = NULL; ++ ++ if (asprintf(&fpath, "%s/etc/test", root) < 0) { ++ CuFail(tc, "failed to set root"); ++ } ++ ++ umask(tumask); ++ ++ r = aug_rm(aug, "/augeas/load/*"); ++ CuAssertPositive(tc, r); ++ ++ r = aug_set(aug, "/augeas/load/Test/lens", "Simplelines.lns"); ++ CuAssertRetSuccess(tc, r); ++ r = aug_set(aug, "/augeas/load/Test/incl", "/etc/test"); ++ CuAssertRetSuccess(tc, r); ++ r = aug_load(aug); ++ CuAssertRetSuccess(tc, r); ++ r = aug_set(aug, "/files/etc/test/1", "test"); ++ CuAssertRetSuccess(tc, r); ++ ++ r = aug_save(aug); ++ CuAssertRetSuccess(tc, r); ++ r = aug_match(aug, "/augeas//error", NULL); ++ CuAssertIntEquals(tc, 0, r); ++ ++ CuAssertIntEquals(tc, 0, stat(fpath, &buf)); ++ CuAssertIntEquals(tc, expected_mode, buf.st_mode & 0777); ++} ++static void testUmask077(CuTest *tc) { ++ testUmask(tc, 0077, 0600); ++} ++static void testUmask027(CuTest *tc) { ++ testUmask(tc, 0027, 0640); ++} ++static void testUmask022(CuTest *tc) { ++ testUmask(tc, 0022, 0644); ++} ++ + int main(void) { + char *output = NULL; + CuSuite* suite = CuSuiteNew(); +@@ -245,6 +290,9 @@ int main(void) { + SUITE_ADD_TEST(suite, testMtime); + SUITE_ADD_TEST(suite, testRelPath); + SUITE_ADD_TEST(suite, testDoubleSlashPath); ++ SUITE_ADD_TEST(suite, testUmask077); ++ SUITE_ADD_TEST(suite, testUmask027); ++ SUITE_ADD_TEST(suite, testUmask022); + + CuSuiteRun(suite); + CuSuiteSummary(suite, &output); +-- +1.8.4.2 + diff --git a/SOURCES/0007-Yum-add-yum-cron-.conf-files.patch b/SOURCES/0007-Yum-add-yum-cron-.conf-files.patch new file mode 100644 index 0000000..4bd183e --- /dev/null +++ b/SOURCES/0007-Yum-add-yum-cron-.conf-files.patch @@ -0,0 +1,25 @@ +From f1cad0ba3df9d8231cc0651302c7b638d6fdfcb7 Mon Sep 17 00:00:00 2001 +From: Pat Riehecky <prieheck@iwu.edu> +Date: Tue, 27 Aug 2013 20:03:31 +0100 +Subject: [PATCH 1/5] Yum: add yum-cron*.conf files + +(cherry picked from commit 148330ac79660e35b8726c7ec6fc8b6916c8a23e) +--- + lenses/yum.aug | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lenses/yum.aug b/lenses/yum.aug +index 31d4776..585695f 100644 +--- a/lenses/yum.aug ++++ b/lenses/yum.aug +@@ -50,6 +50,7 @@ let lns = (empty | comment)* . record* + + let filter = (incl "/etc/yum.conf") + . (incl "/etc/yum.repos.d/*") ++ . (incl "/etc/yum/yum-cron*.conf") + . (incl "/etc/yum/pluginconf.d/*") + . (excl "/etc/yum/pluginconf.d/versionlock.list") + . Util.stdexcl +-- +1.8.5.3 + diff --git a/SOURCES/0008-Shellvars-read-etc-firewalld-firewalld.conf.patch b/SOURCES/0008-Shellvars-read-etc-firewalld-firewalld.conf.patch new file mode 100644 index 0000000..1d75bab --- /dev/null +++ b/SOURCES/0008-Shellvars-read-etc-firewalld-firewalld.conf.patch @@ -0,0 +1,27 @@ +From 620d73fdec0aa82f2d04d9d3263e036f2bd6d9e2 Mon Sep 17 00:00:00 2001 +From: David Lutterkort <lutter@watzmann.net> +Date: Tue, 27 Aug 2013 10:39:45 -0700 +Subject: [PATCH 2/5] Shellvars: read /etc/firewalld/firewalld.conf + +Fixes https://fedorahosted.org/augeas/ticket/363 + +(cherry picked from commit 63e322699272dd26fc9014c672ea5ce9e4fb21e8) +--- + lenses/shellvars.aug | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index da19379..4111ee6 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -205,6 +205,7 @@ module Shellvars = + let filter_misc = incl "/etc/arno-iptables-firewall/debconf.cfg" + . incl "/etc/cron-apt/config" + . incl "/etc/environment" ++ . incl "/etc/firewalld/firewalld.conf" + . incl "/etc/blkid.conf" + . incl "/etc/adduser.conf" + . incl "/etc/cowpoke.conf" +-- +1.8.5.3 + diff --git a/SOURCES/0009-Grub-handle-foreground-option.patch b/SOURCES/0009-Grub-handle-foreground-option.patch new file mode 100644 index 0000000..cebb6dc --- /dev/null +++ b/SOURCES/0009-Grub-handle-foreground-option.patch @@ -0,0 +1,27 @@ +From 2556648fdd45887246658579dd576b25e7af874d Mon Sep 17 00:00:00 2001 +From: Miguel Armas <kuko@canarytek.com> +Date: Thu, 30 Jan 2014 09:23:27 +0000 +Subject: [PATCH 3/5] Grub: handle "foreground" option + +Fixes RHBZ#1059383 + +(cherry picked from commit a370d9ccfbd0b6b6f927880014b29569c58b03c0) +--- + lenses/grub.aug | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lenses/grub.aug b/lenses/grub.aug +index 9f8d6af..81fb9d3 100644 +--- a/lenses/grub.aug ++++ b/lenses/grub.aug +@@ -145,6 +145,7 @@ module Grub = + | kw_menu_arg "timeout" + | kw_menu_arg "splashimage" + | kw_menu_arg "gfxmenu" ++ | kw_menu_arg "foreground" + | kw_menu_arg "background" + | serial + | terminal +-- +1.8.5.3 + diff --git a/SOURCES/0010-Yum-permit-spaces-after-equals-sign-in-list-options.patch b/SOURCES/0010-Yum-permit-spaces-after-equals-sign-in-list-options.patch new file mode 100644 index 0000000..52a2045 --- /dev/null +++ b/SOURCES/0010-Yum-permit-spaces-after-equals-sign-in-list-options.patch @@ -0,0 +1,50 @@ +From 897c3c97b6d70bc739eb58cee2c5430c9619ce56 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Sat, 9 Nov 2013 12:33:00 +0000 +Subject: [PATCH 4/5] Yum: permit spaces after equals sign in list options + +Fixes GitHub issue #45 + +(cherry picked from commit deb73b5f284db09e3c63f2d7698ab140e2337a3d) +--- + lenses/tests/test_yum.aug | 10 ++++++++++ + lenses/yum.aug | 2 +- + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/lenses/tests/test_yum.aug b/lenses/tests/test_yum.aug +index 660a46c..17d4ea2 100644 +--- a/lenses/tests/test_yum.aug ++++ b/lenses/tests/test_yum.aug +@@ -201,6 +201,16 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi + Check that we can parse an empty line, to fix test-save *) + test Yum.lns get "\n" = { } + ++ (* Test: Yum.lns ++ Issue #45: allow spaces around equals sign *) ++ test Yum.lns get "[rpmforge] ++name = RHEL $releasever - RPMforge.net - dag ++baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge\n" = ++ { "rpmforge" ++ { "name" = "RHEL $releasever - RPMforge.net - dag" } ++ { "baseurl" = "http://apt.sw.be/redhat/el6/en/$basearch/rpmforge" } ++ } ++ + (* Local Variables: *) + (* mode: caml *) + (* End: *) +diff --git a/lenses/yum.aug b/lenses/yum.aug +index 585695f..1b13833 100644 +--- a/lenses/yum.aug ++++ b/lenses/yum.aug +@@ -19,7 +19,7 @@ let eol = IniFile.eol + let list_entry (list_key:string) = + let list_value = store /[^# \t\r\n,][^ \t\r\n,]*[^# \t\r\n,]|[^# \t\r\n,]/ in + let list_sep = del /([ \t]*(,[ \t]*|\r?\n[ \t]+))|[ \t]+/ "\n\t" in +- [ key list_key . sep . list_value ] ++ [ key list_key . sep . Sep.opt_space . list_value ] + . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)? + . eol + +-- +1.8.5.3 + diff --git a/SOURCES/0011-Shellvars-handle-case-statements-with-same-line-toke.patch b/SOURCES/0011-Shellvars-handle-case-statements-with-same-line-toke.patch new file mode 100644 index 0000000..eb87110 --- /dev/null +++ b/SOURCES/0011-Shellvars-handle-case-statements-with-same-line-toke.patch @@ -0,0 +1,180 @@ +From 0cce971fabef13af3a9592ef93a505378f73338a Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Wed, 29 Jan 2014 22:57:02 +0000 +Subject: [PATCH 5/5] Shellvars: handle case statements with same-line ;; + tokens + +Fixes RHBZ#1033799 + +(cherry picked from commit a1b9831d14f22f81cf7dc840160c08cc14234ee9) + +Conflicts: + NEWS + lenses/shellvars.aug +--- + lenses/shellvars.aug | 65 +++++++++++++++++++++++++---------------- + lenses/sysconfig.aug | 6 ++-- + lenses/tests/test_shellvars.aug | 11 +++++++ + 3 files changed, 54 insertions(+), 28 deletions(-) + +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index 4111ee6..eff933a 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -59,40 +59,37 @@ module Shellvars = + | bquot | dbquot | dollar_assign | empty_array) + + let export = [ key "export" . Util.del_ws_spc ] +- let kv = [ Util.indent . export? . key key_re +- . eq . (simple_value | array) . comment_or_eol ] ++ let kv = Util.indent . export? . key key_re ++ . eq . (simple_value | array) + + let var_action (name:string) = +- Util.indent . del name name . Util.del_ws_spc . +- [ label ("@" . name) . counter "var_action" +- . Build.opt_list [ seq "var_action" . store (key_re | matching_re) ] Util.del_ws_spc +- . comment_or_eol ] ++ Util.indent . del name name . Util.del_ws_spc ++ . label ("@" . name) . counter "var_action" ++ . Build.opt_list [ seq "var_action" . store (key_re | matching_re) ] Util.del_ws_spc + + let unset = var_action "unset" + let bare_export = var_action "export" + + let source = +- [ Util.indent +- . del /\.|source/ "." . label ".source" +- . Util.del_ws_spc . store /[^;=# \t\n]+/ . comment_or_eol ] ++ Util.indent ++ . del /\.|source/ "." . label ".source" ++ . Util.del_ws_spc . store /[^;=# \t\n]+/ + + let shell_builtin_cmds = "ulimit" | "shift" | "exit" + + let builtin = +- [ Util.indent . label "@builtin" +- . store shell_builtin_cmds +- . (Util.del_ws_spc +- . [ label "args" . sto_to_semicol ])? +- . comment_or_eol ] ++ Util.indent . label "@builtin" ++ . store shell_builtin_cmds ++ . (Util.del_ws_spc ++ . [ label "args" . sto_to_semicol ])? + + let keyword (kw:string) = Util.indent . Util.del_str kw + let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl + + let return = +- [ Util.indent . label "@return" +- . Util.del_str "return" +- . ( Util.del_ws_spc . store Rx.integer )? +- . comment_or_eol ] ++ Util.indent . label "@return" ++ . Util.del_str "return" ++ . ( Util.del_ws_spc . store Rx.integer )? + + + (************************************************************************ +@@ -128,11 +125,11 @@ module Shellvars = + let loop_select (entry:lens) = + generic_cond "select" "@select" "do" entry+ "done" + +- let case (entry:lens) = ++ let case (entry:lens) (entry_noeol:lens) = + let case_entry = [ label "@case_entry" + . Util.indent . store /[^ \t\n\)]+/ + . Util.del_str ")" . eol +- . entry* ++ . ( entry+ | entry_noeol )? + . Util.indent . Util.del_str ";;" . eol ] in + [ keyword_label "case" "@case" . Sep.space + . store (char+ | ("\"" . char+ . "\"")) +@@ -149,20 +146,38 @@ module Shellvars = + . entry+ + . Util.indent . Util.del_str "}" . eol ] + ++ let entry_eol = ++ let entry_eol_item (item:lens) = ++ [ item . comment_or_eol ] in ++ entry_eol_item source ++ | entry_eol_item kv ++ | entry_eol_item unset ++ | entry_eol_item bare_export ++ | entry_eol_item builtin ++ | entry_eol_item return ++ ++ let entry_noeol = ++ let entry_item (item:lens) = [ item ] in ++ entry_item source ++ | entry_item kv ++ | entry_item unset ++ | entry_item bare_export ++ | entry_item builtin ++ | entry_item return ++ + let rec rec_entry = +- let entry = comment | source | kv +- | unset | bare_export | builtin | return | rec_entry in ++ let entry = comment | entry_eol | rec_entry in + cond_if entry + | loop_for entry + | loop_select entry + | loop_while entry + | loop_until entry +- | case entry ++ | case entry entry_noeol + | function entry + +- let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) * ++ let lns_norec = empty* . (comment | entry_eol) * + +- let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) * ++ let lns = empty* . (comment | entry_eol | rec_entry) * + + let sc_incl (n:string) = (incl ("/etc/sysconfig/" . n)) + let sc_excl (n:string) = (excl ("/etc/sysconfig/" . n)) +diff --git a/lenses/sysconfig.aug b/lenses/sysconfig.aug +index ee83af1..8c505b3 100644 +--- a/lenses/sysconfig.aug ++++ b/lenses/sysconfig.aug +@@ -55,10 +55,10 @@ module Sysconfig = + + let var_action = Shellvars.var_action + +- let unset = var_action "unset" +- let bare_export = var_action "export" ++ let unset = [ var_action "unset" . comment_or_eol ] ++ let bare_export = [ var_action "export" . comment_or_eol ] + +- let source = Shellvars.source ++ let source = [ Shellvars.source . comment_or_eol ] + + let lns = empty* . (comment | source | assign | unset | bare_export)* + +diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug +index 79a5a4e..18fd361 100644 +--- a/lenses/tests/test_shellvars.aug ++++ b/lenses/tests/test_shellvars.aug +@@ -446,6 +446,17 @@ esac\n" = + { "1" = "TestVar1" } + { "2" = "TestVar2" } } + ++ (* Support ;; on same line as a case statement entry, RHBZ#1033799 *) ++ test lns get "case $ARG in ++ 0) TestVar=\"test0\" ;; ++ 1) TestVar=\"test1\" ;; ++esac\n" = ++ { "@case" = "$ARG" ++ { "@case_entry" = "0" ++ { "TestVar" = "\"test0\"" } } ++ { "@case_entry" = "1" ++ { "TestVar" = "\"test1\"" } } } ++ + (* Local Variables: *) + (* mode: caml *) + (* End: *) +-- +1.8.5.3 + diff --git a/SOURCES/0012-IPRoute2-handle-hex-IDs-and-hyphens-in-names-as-pres.patch b/SOURCES/0012-IPRoute2-handle-hex-IDs-and-hyphens-in-names-as-pres.patch new file mode 100644 index 0000000..1cf85e1 --- /dev/null +++ b/SOURCES/0012-IPRoute2-handle-hex-IDs-and-hyphens-in-names-as-pres.patch @@ -0,0 +1,59 @@ +From e27a4f34800d8420a01ee3e7d4182c1d48489182 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Wed, 12 Feb 2014 09:49:03 +0000 +Subject: [PATCH 1/2] IPRoute2: handle hex IDs and hyphens in names, as present + in rt_dsfield + +Fixes RHBZ#1063961 + +(cherry picked from commit 2686edf4bcc0a2110ef5a2e8c01045ab0081b04e) + +Conflicts: + NEWS +--- + lenses/iproute2.aug | 3 ++- + lenses/tests/test_iproute2.aug | 10 ++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/lenses/iproute2.aug b/lenses/iproute2.aug +index 66b4a2c..6f6b1ba 100644 +--- a/lenses/iproute2.aug ++++ b/lenses/iproute2.aug +@@ -2,7 +2,8 @@ module IPRoute2 = + autoload xfm + + let empty = [ del /[ \t]*#?[ \t]*\n/ "\n" ] +- let record = [ store /[0-9]+/ . del /[ \t]+/ "\t" . key /[a-zA-Z0-9]+/ . Util.comment_or_eol ] ++ let id = Rx.hex | Rx.integer ++ let record = [ store id . del /[ \t]+/ "\t" . key /[a-zA-Z0-9-]+/ . Util.comment_or_eol ] + + let lns = ( empty | Util.comment | record ) * + +diff --git a/lenses/tests/test_iproute2.aug b/lenses/tests/test_iproute2.aug +index cbd7802..cc24efe 100644 +--- a/lenses/tests/test_iproute2.aug ++++ b/lenses/tests/test_iproute2.aug +@@ -19,6 +19,11 @@ let conf = " + 203 adsl3 + 204 adsl4 + 205 wifi0 ++# ++# From rt_dsfield ++# ++0x00 default ++0x80 flash-override + " + + test IPRoute2.lns get conf = +@@ -41,3 +46,8 @@ test IPRoute2.lns get conf = + { "adsl3" = "203" } + { "adsl4" = "204" } + { "wifi0" = "205" } ++ { } ++ { "#comment" = "From rt_dsfield" } ++ { } ++ { "default" = "0x00" } ++ { "flash-override" = "0x80" } +-- +1.8.5.3 + diff --git a/SOURCES/0013-IPRoute2-handle-in-protocol-names-swap-ID-and-name-f.patch b/SOURCES/0013-IPRoute2-handle-in-protocol-names-swap-ID-and-name-f.patch new file mode 100644 index 0000000..2756eae --- /dev/null +++ b/SOURCES/0013-IPRoute2-handle-in-protocol-names-swap-ID-and-name-f.patch @@ -0,0 +1,91 @@ +From 13a5a36d4da2cb456b338b94025150d8e3847a5f Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Wed, 12 Feb 2014 10:19:21 +0000 +Subject: [PATCH 2/2] IPRoute2: handle "/" in protocol names, swap ID and name + fields + +This is an incompatible change. + +Fixes RHBZ#1063968 + +(cherry picked from commit bd6c783dc05ccf66af02fe24af703737823a99ad) + +Conflicts: + NEWS +--- + lenses/iproute2.aug | 2 +- + lenses/tests/test_iproute2.aug | 34 ++++++++++++++++++++++------------ + 2 files changed, 23 insertions(+), 13 deletions(-) + +diff --git a/lenses/iproute2.aug b/lenses/iproute2.aug +index 6f6b1ba..fa3dcb7 100644 +--- a/lenses/iproute2.aug ++++ b/lenses/iproute2.aug +@@ -3,7 +3,7 @@ module IPRoute2 = + + let empty = [ del /[ \t]*#?[ \t]*\n/ "\n" ] + let id = Rx.hex | Rx.integer +- let record = [ store id . del /[ \t]+/ "\t" . key /[a-zA-Z0-9-]+/ . Util.comment_or_eol ] ++ let record = [ key id . del /[ \t]+/ "\t" . store /[a-zA-Z0-9\/-]+/ . Util.comment_or_eol ] + + let lns = ( empty | Util.comment | record ) * + +diff --git a/lenses/tests/test_iproute2.aug b/lenses/tests/test_iproute2.aug +index cc24efe..2acd367 100644 +--- a/lenses/tests/test_iproute2.aug ++++ b/lenses/tests/test_iproute2.aug +@@ -24,6 +24,11 @@ let conf = " + # + 0x00 default + 0x80 flash-override ++ ++# From rt_protos ++# ++254 gated/aggr ++253 gated/bgp + " + + test IPRoute2.lns get conf = +@@ -32,22 +37,27 @@ test IPRoute2.lns get conf = + { } + { "#comment" = "reserved values" } + { } +- { "local" = "255" } +- { "main" = "254" } +- { "default" = "253" } +- { "unspec" = "0" } ++ { "255" = "local" } ++ { "254" = "main" } ++ { "253" = "default" } ++ { "0" = "unspec" } + { } + { "#comment" = "local" } + { } + { "#comment" = "1 inr.ruhep" } +- { "h3g0" = "200" } +- { "adsl1" = "201" } +- { "adsl2" = "202" } +- { "adsl3" = "203" } +- { "adsl4" = "204" } +- { "wifi0" = "205" } ++ { "200" = "h3g0" } ++ { "201" = "adsl1" } ++ { "202" = "adsl2" } ++ { "203" = "adsl3" } ++ { "204" = "adsl4" } ++ { "205" = "wifi0" } + { } + { "#comment" = "From rt_dsfield" } + { } +- { "default" = "0x00" } +- { "flash-override" = "0x80" } ++ { "0x00" = "default" } ++ { "0x80" = "flash-override" } ++ { } ++ { "#comment" = "From rt_protos" } ++ { } ++ { "254" = "gated/aggr" } ++ { "253" = "gated/bgp" } +-- +1.8.5.3 + diff --git a/SOURCES/0014-Yum.lns-simplify-code-for-combinatory-logic-of-list_.patch b/SOURCES/0014-Yum.lns-simplify-code-for-combinatory-logic-of-list_.patch new file mode 100644 index 0000000..89c94b7 --- /dev/null +++ b/SOURCES/0014-Yum.lns-simplify-code-for-combinatory-logic-of-list_.patch @@ -0,0 +1,231 @@ +From 50792ee989e81b52ed886be967843d85433f0ce5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= <raphael.pinson@camptocamp.com> +Date: Tue, 3 Dec 2013 10:11:38 +0100 +Subject: [PATCH] Yum.lns: simplify code for combinatory logic of list_entry + elements + +(cherry picked from commit 9c645afbde88a2bdb5f8b139fde44968b019234c) + +Build: Add combinatorics group + +(cherry picked from commit 3f57641d8df3ed1edf89cd7641c4c6e84c3a3429) + +Yum.lns: split excludes as lists (ticket #275) + +(cherry picked from commit c16ccfd64045cb5f9c8793bc7589fc80fc027064) +--- + lenses/build.aug | 57 +++++++++++++++++++++++++++++++++++ + lenses/tests/test_build.aug | 73 +++++++++++++++++++++++++++++++++++++++++++++ + lenses/tests/test_yum.aug | 11 +++++++ + lenses/yum.aug | 16 +++++----- + 4 files changed, 149 insertions(+), 8 deletions(-) + +diff --git a/lenses/build.aug b/lenses/build.aug +index 2e57356..efc8814 100644 +--- a/lenses/build.aug ++++ b/lenses/build.aug +@@ -298,3 +298,60 @@ let block_newlines (entry:lens) (comment:lens) = + ************************************************************************) + let named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ] + ++ ++(************************************************************************ ++ * Group: COMBINATORICS ++ ************************************************************************) ++ ++(************************************************************************ ++ * View: combine_two_opt_ord ++ * Combine two lenses optionally, ensuring first lens is first ++ * (a, and optionally b) ++ * ++ * Parameters: ++ * a:lens - the first lens ++ * b:lens - the second lens ++ ************************************************************************) ++let combine_two_opt_ord (a:lens) (b:lens) = a . b? ++ ++(************************************************************************ ++ * View: combine_two_opt ++ * Combine two lenses optionally ++ * (either a, b, or both, in any order) ++ * ++ * Parameters: ++ * a:lens - the first lens ++ * b:lens - the second lens ++ ************************************************************************) ++let combine_two_opt (a:lens) (b:lens) = ++ combine_two_opt_ord a b | combine_two_opt_ord b a ++ ++ ++(************************************************************************ ++ * View: combine_three_opt_ord ++ * Combine three lenses optionally, ensuring first lens is first ++ * (a followed by either b, c, or any of them, in any order) ++ * ++ * Parameters: ++ * a:lens - the first lens ++ * b:lens - the second lens ++ * c:lens - the third lens ++ ************************************************************************) ++let combine_three_opt_ord (a:lens) (b:lens) (c:lens) = ++ combine_two_opt_ord a (combine_two_opt b c) ++ ++(************************************************************************ ++ * View: combine_three_opt ++ * Combine three lenses optionally ++ * (either a, b, c, or any of them, in any order) ++ * ++ * Parameters: ++ * a:lens - the first lens ++ * b:lens - the second lens ++ * c:lens - the third lens ++ ************************************************************************) ++let combine_three_opt (a:lens) (b:lens) (c:lens) = ++ combine_three_opt_ord a b c ++ | combine_three_opt_ord b a c ++ | combine_three_opt_ord c b a ++ +diff --git a/lenses/tests/test_build.aug b/lenses/tests/test_build.aug +index b9b09fa..bc565f3 100644 +--- a/lenses/tests/test_build.aug ++++ b/lenses/tests/test_build.aug +@@ -174,3 +174,76 @@ test logrotate_block get "/var/log/wtmp\n/var/log/wtmp2\n{ + { "monthly" } + } + ++ ++(************************************************************************ ++ * Group: COMBINATORICS ++ ************************************************************************) ++ ++(* View: combine_two_opt ++ A minimalistic optional combination lens *) ++let combine_two_opt = ++ let entry (k:string) = [ key k ] ++ in Build.combine_two_opt (entry "a") (entry "b") ++ ++(* Test: combine_two_opt ++ Should parse ab *) ++test combine_two_opt get "ab" = { "a" } { "b" } ++ ++(* Test: combine_two_opt ++ Should parse ba *) ++test combine_two_opt get "ba" = { "b" } { "a" } ++ ++(* Test: combine_two_opt ++ Should parse a *) ++test combine_two_opt get "a" = { "a" } ++ ++(* Test: combine_two_opt ++ Should parse b *) ++test combine_two_opt get "b" = { "b" } ++ ++(* Test: combine_two_opt ++ Should not parse aa *) ++test combine_two_opt get "aa" = * ++ ++(* Test: combine_two_opt ++ Should not parse bb *) ++test combine_two_opt get "bb" = * ++ ++ ++(* View: combine_three_opt ++ A minimalistic optional combination lens *) ++let combine_three_opt = ++ let entry (k:string) = [ key k ] ++ in Build.combine_three_opt (entry "a") (entry "b") (entry "c") ++ ++(* Test: combine_three_opt ++ Should parse ab *) ++test combine_three_opt get "ab" = { "a" } { "b" } ++ ++(* Test: combine_three_opt ++ Should parse ba *) ++test combine_three_opt get "ba" = { "b" } { "a" } ++ ++(* Test: combine_three_opt ++ Should parse a *) ++test combine_three_opt get "a" = { "a" } ++ ++(* Test: combine_three_opt ++ Should parse b *) ++test combine_three_opt get "b" = { "b" } ++ ++(* Test: combine_three_opt ++ Should not parse aa *) ++test combine_three_opt get "aa" = * ++ ++(* Test: combine_three_opt ++ Should not parse bbc *) ++test combine_three_opt get "bbc" = * ++ ++(* Test: combine_three_opt ++ Should parse abc *) ++test combine_three_opt get "abc" = { "a" } { "b" } { "c" } ++ ++(* Test: combine_three_opt ++ Should parse cab *) ++test combine_three_opt get "cab" = { "c" } { "a" } { "b" } +diff --git a/lenses/tests/test_yum.aug b/lenses/tests/test_yum.aug +index 17d4ea2..2688182 100644 +--- a/lenses/tests/test_yum.aug ++++ b/lenses/tests/test_yum.aug +@@ -211,6 +211,17 @@ baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge\n" = + { "baseurl" = "http://apt.sw.be/redhat/el6/en/$basearch/rpmforge" } + } + ++ (* Test: Yum.lns ++ Issue #275: parse excludes as a list *) ++ test Yum.lns get "[epel] ++name=Extra Packages for Enterprise Linux 6 - $basearch ++exclude=ocs* clamav* ++" = ++ { "epel" ++ { "name" = "Extra Packages for Enterprise Linux 6 - $basearch" } ++ { "exclude" = "ocs*" } ++ { "exclude" = "clamav*" } } ++ + (* Local Variables: *) + (* mode: caml *) + (* End: *) +diff --git a/lenses/yum.aug b/lenses/yum.aug +index 1b13833..030d944 100644 +--- a/lenses/yum.aug ++++ b/lenses/yum.aug +@@ -11,7 +11,6 @@ let sep = IniFile.sep "=" "=" + let empty = Util.empty + let eol = IniFile.eol + +- + (************************************************************************ + * ENTRY + *************************************************************************) +@@ -23,17 +22,18 @@ let list_entry (list_key:string) = + . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)? + . eol + +-let entry_re = IniFile.entry_re - ("baseurl" | "gpgkey") ++let entry_re = IniFile.entry_re - ("baseurl" | "gpgkey" | "exclude") + + let entry = IniFile.entry entry_re sep comment + | empty + +-let entries = entry* +- | entry* . list_entry "baseurl" . entry* +- | entry* . list_entry "gpgkey" . entry* +- | entry* . list_entry "baseurl" . entry* . list_entry "gpgkey" . entry* +- | entry* . list_entry "gpgkey" . entry* . list_entry "baseurl" . entry* +- ++let entries = ++ let list_entry_elem (k:string) = list_entry k . entry* ++ in entry* ++ | entry* . Build.combine_three_opt ++ (list_entry_elem "baseurl") ++ (list_entry_elem "gpgkey") ++ (list_entry_elem "exclude") + + + (***********************************************************************a +-- +1.8.5.3 + diff --git a/SOURCES/0015-dovecot-enchancement-and-bug-fixes.patch b/SOURCES/0015-dovecot-enchancement-and-bug-fixes.patch new file mode 100644 index 0000000..136102e --- /dev/null +++ b/SOURCES/0015-dovecot-enchancement-and-bug-fixes.patch @@ -0,0 +1,111 @@ +From 24364f9c9955ea10b094d6892e8c91d6b308ffe2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20Haslgr=C3=BCbler?= <work-michael@haslgruebler.eu> +Date: Wed, 21 Aug 2013 23:19:04 +0200 +Subject: [PATCH 1/3] dovecot enchancement and bug fixes + +* add mailbox to block_names +* fix for block_args in quotes +* fix for block's brackets upon write +* fixes broken tests for mailbox +* fixes indention +* test case for block_args with " +* fixes broken indention + +(cherry picked from commit e6ff9449e5af1759d6b7828ceb118882e955dca4) + +Use Quote module in dovecot + +* use Quote.dquote_spaces for quoting + +(cherry picked from commit 735caf587959019d214a51a7c0cce57da9bb88f6) +--- + lenses/dovecot.aug | 37 +++++++++++++++++++++++++++++++++---- + lenses/tests/test_dovecot.aug | 6 ++++++ + 2 files changed, 39 insertions(+), 4 deletions(-) + +diff --git a/lenses/dovecot.aug b/lenses/dovecot.aug +index 6e5ccc9..e3558d0 100644 +--- a/lenses/dovecot.aug ++++ b/lenses/dovecot.aug +@@ -56,9 +56,6 @@ let value = any . (Rx.space . any)* + (* View: command_start *) + let command_start = Util.del_str "!" + +-(* View: block_args +-Map block arguments after block name and before "{" *) +-let block_args = Sep.space . store /[A-Za-z0-9\/\\_-]+/ + + (****************************************************************** + * Group: ENTRIES +@@ -82,11 +79,43 @@ let entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ] + Map commands started with "!". *) + let command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ] + ++(* ++View: dquote_spaces ++ Make double quotes mandatory if value contains spaces, ++ and optional if value doesn't contain spaces. ++ ++Based off Quote.dquote_spaces ++ ++Parameters: ++ lns1:lens - the lens before ++ lns2:lens - the lens after ++*) ++let dquote_spaces (lns1:lens) (lns2:lens) = ++ (* bare has no spaces, and is optionally quoted *) ++ let bare = Quote.do_dquote_opt (store /[^" \t\n]+/) ++ (* quoted has at least one space, and must be quoted *) ++ in let quoted = Quote.do_dquote (store /[^"\n]*[ \t]+[^"\n]*/) ++ in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ] ++ ++let mailbox = indent ++ . dquote_spaces ++ (key /mailbox/ . Sep.space) ++ (Build.block_newlines (entry) comment . eol) ++ ++let block_ldelim_newlines_re = /[ \t]+\{([ \t\n]*\n)?/ ++ ++let block_newlines (entry:lens) (comment:lens) = ++ let indent = del Rx.opt_space "\t" ++ in del block_ldelim_newlines_re Build.block_ldelim_default ++ . ((entry | comment) . (Util.empty | entry | comment)*)? ++ . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default ++ + (* View: block + Map block enclosed in brackets recursively. + Block may be indented and have optional argument. + Block body may have entries, comments, empty lines, and nested blocks recursively. *) +-let rec block = [ indent . key block_names . block_args? . Build.block_newlines (entry|block) comment . eol ] ++let rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store /[\/A-Za-z0-9_-]+/))? . block_newlines (entry|block|mailbox) comment . eol ] ++ + + (****************************************************************** + * Group: LENS AND FILTER +diff --git a/lenses/tests/test_dovecot.aug b/lenses/tests/test_dovecot.aug +index 2201735..33ea16f 100644 +--- a/lenses/tests/test_dovecot.aug ++++ b/lenses/tests/test_dovecot.aug +@@ -465,6 +465,9 @@ namespace { + hidden = no + list = yes + subscriptions = yes ++ mailbox \"Sent Messages\" { ++ special_use = \Sent ++ } + } + + # Example shared namespace configuration +@@ -533,6 +536,9 @@ test Dovecot.lns get mail_conf = + { "hidden" = "no" } + { "list" = "yes" } + { "subscriptions" = "yes" } ++ { "mailbox" = "Sent Messages" ++ { "special_use" = "\Sent" } ++ } + } + { } + { "#comment" = "Example shared namespace configuration" } +-- +1.8.5.3 + diff --git a/SOURCES/0016-Keepalived-add-more-virtual-real-server-settings-and.patch b/SOURCES/0016-Keepalived-add-more-virtual-real-server-settings-and.patch new file mode 100644 index 0000000..a5d046d --- /dev/null +++ b/SOURCES/0016-Keepalived-add-more-virtual-real-server-settings-and.patch @@ -0,0 +1,279 @@ +From 6eba1a21df59cc1638a2047f24080ebe657b497e Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Fri, 21 Feb 2014 10:56:57 +0000 +Subject: [PATCH 2/3] Keepalived: add more virtual/real server settings and + checks + +Fixes RHBZ#1064388 + +(cherry picked from commit 1f6ec69ffcd46a5b6937025973a2f2337df2727d) + +Conflicts: + NEWS +--- + lenses/keepalived.aug | 81 +++++++++++++++++++++++-- + lenses/tests/test_keepalived.aug | 128 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 203 insertions(+), 6 deletions(-) + +diff --git a/lenses/keepalived.aug b/lenses/keepalived.aug +index 1fe3aa2..9fd02ff 100644 +--- a/lenses/keepalived.aug ++++ b/lenses/keepalived.aug +@@ -83,6 +83,10 @@ let field (kw:regexp) (sto:lens) = indent . Build.key_value_line_comment kw sep_ + A single word *) + let flag (kw:regexp) = [ indent . key kw . comment_or_eol ] + ++(* View: ip_port ++ An IP <space> port pair *) ++let ip_port = [ label "ip" . sto_word ] . sep_spc . [ label "port" . sto_num ] ++ + (* View: lens_block + A generic block with a title lens. + The definition is very similar to Build.block_newlines +@@ -220,22 +224,87 @@ let vrrpd_conf = vrrp_sync_group | vrrp_instance | vrrp_script + + + (************************************************************************ +- * Group: LVS CONFIGURATION ++ * Group: REAL SERVER CHECKS CONFIGURATION + *************************************************************************) + + (* View: tcp_check_field *) +-let tcp_check_field = field /connect_(timeout|port)/ sto_num ++let tcp_check_field = ++ let word_re = "bindto" ++ in let num_re = /connect_(timeout|port)/ ++ in field word_re sto_word ++ | field num_re sto_num ++ ++(* View: misc_check_field *) ++let misc_check_field = ++ let flag_re = "misc_dynamic" ++ in let num_re = "misc_timeout" ++ in let to_eol_re = "misc_path" ++ in field num_re sto_num ++ | flag flag_re ++ | field to_eol_re sto_to_eol ++ ++(* View: smtp_host_check_field *) ++let smtp_host_check_field = ++ let word_re = "connect_ip" | "bindto" ++ in let num_re = "connect_port" ++ in field word_re sto_word ++ | field num_re sto_num ++ ++(* View: smtp_check_field *) ++let smtp_check_field = ++ let word_re = "connect_ip" | "bindto" ++ in let num_re = "connect_timeout" | "retry" | "delay_before_retry" ++ in let to_eol_re = "helo_name" ++ in field word_re sto_word ++ | field num_re sto_num ++ | field to_eol_re sto_to_eol ++ | block "host" smtp_host_check_field ++ ++(* View: http_url_check_field *) ++let http_url_check_field = ++ let word_re = "digest" ++ in let num_re = "status_code" ++ in let to_eol_re = "path" ++ in field word_re sto_word ++ | field num_re sto_num ++ | field to_eol_re sto_to_eol ++ ++(* View: http_check_field *) ++let http_check_field = ++ let num_re = /connect_(timeout|port)/ | "nb_get_retry" | "delay_before_retry" ++ in field num_re sto_num ++ | block "url" http_url_check_field + + (* View: real_server_field *) +-let real_server_field = field "weight" sto_num +- | block "TCP_CHECK" tcp_check_field ++let real_server_field = ++ let num_re = "weight" ++ in let flag_re = "inhibit_on_failure" ++ in let to_eol_re = /notify_(up|down)/ ++ in field num_re sto_num ++ | flag flag_re ++ | field to_eol_re sto_to_eol ++ | block "TCP_CHECK" tcp_check_field ++ | block "MISC_CHECK" misc_check_field ++ | block "SMTP_CHECK" smtp_check_field ++ | block /(HTTP|SSL)_GET/ http_check_field ++ ++(************************************************************************ ++ * Group: LVS CONFIGURATION ++ *************************************************************************) + + (* View: virtual_server_field *) + let virtual_server_field = +- let num_re = "delay_loop" +- in let word_re = /lb_(algo|kind)/ | "nat_mask" | "protocol" ++ let num_re = "delay_loop" | "persistence_timeout" | "quorum" | "hysteresis" ++ in let word_re = /lb_(algo|kind)/ | "nat_mask" | "protocol" | "persistence_granularity" ++ | "virtualhost" ++ in let flag_re = "ops" | "ha_suspend" | "alpha" | "omega" ++ in let to_eol_re = /quorum_(up|down)/ ++ in let ip_port_re = "sorry_server" + in field num_re sto_num + | field word_re sto_word ++ | flag flag_re ++ | field to_eol_re sto_to_eol ++ | field ip_port_re ip_port + | named_block_arg "real_server" "ip" "port" real_server_field + + (* View: virtual_server *) +diff --git a/lenses/tests/test_keepalived.aug b/lenses/tests/test_keepalived.aug +index 615509e..371df25 100644 +--- a/lenses/tests/test_keepalived.aug ++++ b/lenses/tests/test_keepalived.aug +@@ -118,6 +118,8 @@ virtual_server 192.168.1.11 22 { + + protocol TCP + ++ sorry_server 10.20.40.30 22 ++ + ! there can be as many real_server blocks as you need + + real_server 10.20.40.10 22 { +@@ -269,6 +271,10 @@ weight 2 # add 2 points of prio if OK + { } + { "protocol" = "TCP" } + { } ++ { "sorry_server" ++ { "ip" = "10.20.40.30" } ++ { "port" = "22" } } ++ { } + { "#comment" = "there can be as many real_server blocks as you need" } + { } + { "real_server" +@@ -312,3 +318,125 @@ weight 2 # add 2 points of prio if OK + { } + { "#comment" = "that's all" } + ++(* Variable: tcp_check ++ An example of a TCP health checker *) ++let tcp_check = "virtual_server 192.168.1.11 22 { ++ real_server 10.20.40.10 22 { ++ TCP_CHECK { ++ connect_timeout 3 ++ connect_port 22 ++ bindto 192.168.1.1 ++ } ++ } ++} ++" ++test Keepalived.lns get tcp_check = ++ { "virtual_server" ++ { "ip" = "192.168.1.11" } ++ { "port" = "22" } ++ { "real_server" ++ { "ip" = "10.20.40.10" } ++ { "port" = "22" } ++ { "TCP_CHECK" ++ { "connect_timeout" = "3" } ++ { "connect_port" = "22" } ++ { "bindto" = "192.168.1.1" } } } } ++ ++(* Variable: misc_check ++ An example of a MISC health checker *) ++let misc_check = "virtual_server 192.168.1.11 22 { ++ real_server 10.20.40.10 22 { ++ MISC_CHECK { ++ misc_path /usr/local/bin/server_test ++ misc_timeout 3 ++ misc_dynamic ++ } ++ } ++} ++" ++test Keepalived.lns get misc_check = ++ { "virtual_server" ++ { "ip" = "192.168.1.11" } ++ { "port" = "22" } ++ { "real_server" ++ { "ip" = "10.20.40.10" } ++ { "port" = "22" } ++ { "MISC_CHECK" ++ { "misc_path" = "/usr/local/bin/server_test" } ++ { "misc_timeout" = "3" } ++ { "misc_dynamic" } } } } ++ ++(* Variable: smtp_check ++ An example of an SMTP health checker *) ++let smtp_check = "virtual_server 192.168.1.11 22 { ++ real_server 10.20.40.10 22 { ++ SMTP_CHECK { ++ host { ++ connect_ip 10.20.40.11 ++ connect_port 587 ++ bindto 192.168.1.1 ++ } ++ connect_timeout 3 ++ retry 5 ++ delay_before_retry 10 ++ helo_name \"Testing Augeas\" ++ } ++ } ++} ++" ++test Keepalived.lns get smtp_check = ++ { "virtual_server" ++ { "ip" = "192.168.1.11" } ++ { "port" = "22" } ++ { "real_server" ++ { "ip" = "10.20.40.10" } ++ { "port" = "22" } ++ { "SMTP_CHECK" ++ { "host" ++ { "connect_ip" = "10.20.40.11" } ++ { "connect_port" = "587" } ++ { "bindto" = "192.168.1.1" } } ++ { "connect_timeout" = "3" } ++ { "retry" = "5" } ++ { "delay_before_retry" = "10" } ++ { "helo_name" = "\"Testing Augeas\"" } } } } ++ ++(* Variable: http_check ++ An example of an HTTP health checker *) ++let http_check = "virtual_server 192.168.1.11 22 { ++ real_server 10.20.40.10 22 { ++ HTTP_GET { ++ url { ++ path /mrtg2/ ++ digest 9b3a0c85a887a256d6939da88aabd8cd ++ status_code 200 ++ } ++ connect_timeout 3 ++ connect_port 8080 ++ nb_get_retry 5 ++ delay_before_retry 10 ++ } ++ SSL_GET { ++ connect_port 8443 ++ } ++ } ++} ++" ++test Keepalived.lns get http_check = ++ { "virtual_server" ++ { "ip" = "192.168.1.11" } ++ { "port" = "22" } ++ { "real_server" ++ { "ip" = "10.20.40.10" } ++ { "port" = "22" } ++ { "HTTP_GET" ++ { "url" ++ { "path" = "/mrtg2/" } ++ { "digest" = "9b3a0c85a887a256d6939da88aabd8cd" } ++ { "status_code" = "200" } } ++ { "connect_timeout" = "3" } ++ { "connect_port" = "8080" } ++ { "nb_get_retry" = "5" } ++ { "delay_before_retry" = "10" } } ++ { "SSL_GET" ++ { "connect_port" = "8443" } } } } +-- +1.8.5.3 + diff --git a/SOURCES/0017-Krb5-permit-braces-in-values-when-not-in-sub-section.patch b/SOURCES/0017-Krb5-permit-braces-in-values-when-not-in-sub-section.patch new file mode 100644 index 0000000..1d54714 --- /dev/null +++ b/SOURCES/0017-Krb5-permit-braces-in-values-when-not-in-sub-section.patch @@ -0,0 +1,87 @@ +From 1ac63d941a60816799b7c70941fefbafdb4d79de Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Tue, 25 Feb 2014 16:19:51 +0000 +Subject: [PATCH 3/3] Krb5: permit braces in values when not in sub-section + +Fixes RHBZ#1066419 + +(cherry picked from commit d9465ab8e88f91cb5a29eb9f04044876ce45a2d9) + +Conflicts: + NEWS +--- + lenses/krb5.aug | 15 ++++++++------- + lenses/tests/test_krb5.aug | 7 +++++++ + 2 files changed, 15 insertions(+), 7 deletions(-) + +diff --git a/lenses/krb5.aug b/lenses/krb5.aug +index 8d26cfe..8b4ebe4 100644 +--- a/lenses/krb5.aug ++++ b/lenses/krb5.aug +@@ -25,16 +25,17 @@ let realm_re = /[A-Z][.a-zA-Z0-9-]*/ + let app_re = /[a-z][a-zA-Z0-9_]*/ + let name_re = /[.a-zA-Z0-9_-]+/ + +-let value = store /[^;# \t\r\n{}]+/ +-let entry (kw:regexp) (sep:lens) (comment:lens) ++let value_br = store /[^;# \t\r\n{}]+/ ++let value = store /[^;# \t\r\n]+/ ++let entry (kw:regexp) (sep:lens) (value:lens) (comment:lens) + = [ indent . key kw . sep . value . (comment|eol) ] | comment + + let subsec_entry (kw:regexp) (sep:lens) (comment:lens) +- = ( entry kw sep comment ) | empty ++ = ( entry kw sep value_br comment ) | empty + + let simple_section (n:string) (k:regexp) = + let title = Inifile.indented_title n in +- let entry = entry k eq comment in ++ let entry = entry k eq value comment in + Inifile.record title entry + + let record (t:string) (e:lens) = +@@ -59,7 +60,7 @@ let enctype_list (nr:regexp) (ns:string) = + . (comment|eol) . [ label "#eol" ] + + let libdefaults = +- let option = entry (name_re - ("v4_name_convert" |enctypes)) eq comment in ++ let option = entry (name_re - ("v4_name_convert" |enctypes)) eq value comment in + let enctype_lists = enctype_list /permitted_enctypes/i "permitted_enctypes" + | enctype_list /default_tgs_enctypes/i "default_tgs_enctypes" + | enctype_list /default_tkt_enctypes/i "default_tkt_enctypes" in +@@ -73,7 +74,7 @@ let login = + simple_section "login" keys + + let appdefaults = +- let option = entry (name_re - ("realm" | "application")) eq comment in ++ let option = entry (name_re - ("realm" | "application")) eq value_br comment in + let realm = [ indent . label "realm" . store realm_re . + eq_openbr . (option|empty)* . closebr . eol ] in + let app = [ indent . label "application" . store app_re . +@@ -117,7 +118,7 @@ let logging = + let capaths = + let realm = [ indent . key realm_re . + eq_openbr . +- (entry realm_re eq comment)* . closebr . eol ] in ++ (entry realm_re eq value_br comment)* . closebr . eol ] in + record "capaths" (realm|comment) + + let dbdefaults = +diff --git a/lenses/tests/test_krb5.aug b/lenses/tests/test_krb5.aug +index 0547b65..b0ec6d6 100644 +--- a/lenses/tests/test_krb5.aug ++++ b/lenses/tests/test_krb5.aug +@@ -995,3 +995,10 @@ test Krb5.lns get v4_name_convert = + (* Ticket #288: semicolons for comments *) + test Krb5.lns get "; AD : This Kerberos configuration is for CERN's Active Directory realm.\n" = + { "#comment" = "AD : This Kerberos configuration is for CERN's Active Directory realm." } ++ ++(* RHBZ#1066419: braces in values *) ++test Krb5.lns get "[libdefaults]\n ++default_ccache_name = KEYRING:persistent:%{uid}\n" = ++ { "libdefaults" ++ { } ++ { "default_ccache_name" = "KEYRING:persistent:%{uid}" } } +-- +1.8.5.3 + diff --git a/SOURCES/0018-Exports-permit-colons-for-IPv6-client-addresses.patch b/SOURCES/0018-Exports-permit-colons-for-IPv6-client-addresses.patch new file mode 100644 index 0000000..fb14b33 --- /dev/null +++ b/SOURCES/0018-Exports-permit-colons-for-IPv6-client-addresses.patch @@ -0,0 +1,45 @@ +From 8fb02d5decac12c9b06b5e420e36e9d46c538c54 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Sat, 5 Oct 2013 17:04:15 +0100 +Subject: [PATCH] Exports: permit colons for IPv6 client addresses + +Fixes ticket #366 + +(cherry picked from commit 68955992ae548f9a65a4fb4cdbf2ffbe5520a50e) +--- + lenses/exports.aug | 2 +- + lenses/tests/test_exports.aug | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lenses/exports.aug b/lenses/exports.aug +index 4e134c8..3de0de1 100644 +--- a/lenses/exports.aug ++++ b/lenses/exports.aug +@@ -76,7 +76,7 @@ About: Limitations + module Exports = + autoload xfm + +- let client_re = /[a-zA-Z0-9.@*?\/-]+/ ++ let client_re = /[a-zA-Z0-9.@*?\/:-]+/ + + let eol = Util.eol + let lbracket = Util.del_str "(" +diff --git a/lenses/tests/test_exports.aug b/lenses/tests/test_exports.aug +index 14a51e8..3d0e9c2 100644 +--- a/lenses/tests/test_exports.aug ++++ b/lenses/tests/test_exports.aug +@@ -8,6 +8,7 @@ let s = "/local 172.31.0.0/16(rw,sync) \t + /local2 somehost(rw,sync) + /local3 some-host(rw,sync) + /local3 an-other-host(rw,sync) ++/local4 2000:123:456::/64(rw) + " + + test Exports.lns get s = +@@ -43,3 +44,6 @@ test Exports.lns get s = + { "client" = "an-other-host" + { "option" = "rw" } + { "option" = "sync" } } } ++ { "dir" = "/local4" ++ { "client" = "2000:123:456::/64" ++ { "option" = "rw" } } } diff --git a/SOURCES/0019-Added-chrony-lense.patch b/SOURCES/0019-Added-chrony-lense.patch new file mode 100644 index 0000000..14d80e6 --- /dev/null +++ b/SOURCES/0019-Added-chrony-lense.patch @@ -0,0 +1,468 @@ +From f6d87cb468845c498e42e7285099d5b295ee936b Mon Sep 17 00:00:00 2001 +From: Pat Riehecky <riehecky@fnal.gov> +Date: Wed, 12 Feb 2014 11:43:16 -0600 +Subject: [PATCH] Added chrony lense + +(cherry picked from commit 319e30fcbea54aadc97430809cea6fb7b398b4b6) +--- + doc/naturaldocs/conf/lenses/Menu.txt | 2 + + lenses/chrony.aug | 266 +++++++++++++++++++++++++++++++++++ + lenses/tests/test_chrony.aug | 143 +++++++++++++++++++ + tests/Makefile.am | 1 + + 4 files changed, 412 insertions(+) + create mode 100644 lenses/chrony.aug + create mode 100644 lenses/tests/test_chrony.aug + +diff --git a/doc/naturaldocs/conf/lenses/Menu.txt b/doc/naturaldocs/conf/lenses/Menu.txt +index a6fa0f0..34e0bf6 100644 +--- a/doc/naturaldocs/conf/lenses/Menu.txt ++++ b/doc/naturaldocs/conf/lenses/Menu.txt +@@ -74,6 +74,7 @@ Group: Specific Modules { + File: Cgconfig (no auto-title, cgconfig.aug) + File: Cgrules (no auto-title, cgrules.aug) + File: Channels (channels.aug) ++ File: Chrony (chrony.aug) + File: Collectd (collectd.aug) + File: Cron (cron.aug) + File: Crypttab (crypttab.aug) +@@ -191,6 +192,7 @@ Group: Tests and Examples { + File: Test_Build (tests/test_build.aug) + File: Test_Carbon (tests/test_carbon.aug) + File: Test_Channels (tests/test_channels.aug) ++ File: Test_Chrony (tests/test_chrony.aug) + File: Test_Collectd (tests/test_collectd.aug) + File: Test_Cups (tests/test_cups.aug) + File: Test_Dovecot (tests/test_dovecot.aug) +diff --git a/lenses/chrony.aug b/lenses/chrony.aug +new file mode 100644 +index 0000000..ede2c94 +--- /dev/null ++++ b/lenses/chrony.aug +@@ -0,0 +1,266 @@ ++(* ++Module: Chrony ++ Parses the chrony config file ++ ++Author: Pat Riehecky <riehecky@fnal.gov> ++ ++About: Reference ++ This lens tries to keep as close as possible to chrony config syntax ++ ++ See http://chrony.tuxfamily.org/manual.html#Configuration-file ++ ++About: Limitations ++ Does not (currently) support ++ - include ++ - manual ++ - refclock ++ - tempcomp ++ ++About: License ++ This file is licenced under the LGPL v2+, like the rest of Augeas. ++ ++About: Lens Usage ++ To be documented ++ ++About: Configuration files ++ This lens applies to /etc/chrony.conf ++ ++ See <filter>. ++*) ++ ++module Chrony = ++ autoload xfm ++ ++(************************************************************************ ++ * Group: Import provided expressions ++ ************************************************************************) ++ (* View: empty *) ++ let empty = Util.empty ++ ++ (* View: eol *) ++ let eol = Util.eol ++ ++ (* View: space *) ++ let space = Sep.space ++ ++ (* Variable: email_addr *) ++ let email_addr = Rx.email_addr ++ ++ (* Variable: word *) ++ let word = Rx.word ++ ++ (* Variable: integer *) ++ let integer = Rx.integer ++ ++ (* Variable: decimal *) ++ let decimal = Rx.decimal ++ ++ (* Variable: ip *) ++ let ip = Rx.ip ++ ++(************************************************************************ ++ * Group: Create required expressions ++ ************************************************************************) ++ (* Variable: number *) ++ let number = integer | decimal ++ ++ (* Variable: address_re *) ++ let address_re = Rx.ip | Rx.hostname ++ ++ (* ++ View: comment ++ from 4.2.1 of the upstream doc ++ Chrony comments start with: ! ; # or % and must be on their own line ++ *) ++ let comment = Util.comment_generic /[ \t]*[!;#%][ \t]*/ "# " ++ ++ (* Variable: no_space ++ No spaces or comment characters ++ *) ++ let no_space = /[^ \t\r\n!;#%]+/ ++ ++ (* Variable: cmd_options ++ Server/Peer options with values ++ *) ++ let cmd_options = "key" ++ | /maxdelay((dev)?ratio)?/ ++ | /(min|max)poll/ ++ | "polltarget" ++ | "port" ++ | "presend" ++ ++ (* Variable: cmd_flags ++ Server/Peer options without values ++ *) ++ let cmd_flags = "auto_offline"|"iburst"|"noselect"|"offline"|"prefer" ++ ++ (* Variable: server_peer ++ Server/Peer key names ++ *) ++ let server_peer = "server"|"peer" ++ ++ (* Variable: flags ++ Options without values ++ *) ++ let flags = "dumponexit" ++ | "generatecommandkey" ++ | "lock_all" ++ | "noclientlog" ++ | "rtconutc" ++ | "rtcsync" ++ ++ (* Variable: log_flags ++ log has a specific options list ++ *) ++ let log_flags = /measurments|statistics|tracking|rtc|refclocks|tempcomp/ ++ ++ (* Variable: simple_keys ++ Options with single values ++ *) ++ let simple_keys = "acquisitionport" | "allow" | "bindaddress" ++ | "bindcmdaddress" | "cmdallow" | "cmddeny" ++ | "combinelimit" | "commandkey" | "cmdport" ++ | "corrtimeratio" | "deny" | "driftfile" ++ | "dumpdir" | "keyfile" | "leapsectz" | "linux_hz" ++ | "linux_freq_scale" | "logbanner" | "logchange" ++ | "logdir" | "maxclockerror" | "maxsamples" ++ | "maxupdateskew" | "minsamples" | "clientloglimit" ++ | "pidfile" | "port" | "reselectdist" | "rtcdevice" ++ | "rtcfile" | "sched_priority" | "stratumweight" | "user" ++ ++(************************************************************************ ++ * Group: Make some sub-lenses for use in later lenses ++ ************************************************************************) ++ (* View: host_flags *) ++ let host_flags = [ space . key cmd_flags ] ++ (* View: host_options *) ++ let host_options = [ space . key cmd_options . space . store integer ] ++ (* View: log_flag_list *) ++ let log_flag_list = [ space . key log_flags ] ++ (* View: store_address *) ++ let store_address = [ label "address" . store address_re ] ++ ++(************************************************************************ ++ * Group: Lenses for parsing out sections ++ ************************************************************************) ++ (* View: all_flags ++ match all flags using Build.flag_line ++ *) ++ let all_flags = Build.flag_line flags ++ ++ (* View: kv ++ options with only one arg can be directly mapped to key = value ++ *) ++ let kv = Build.key_value_line_comment simple_keys space (store no_space) comment ++ ++ (* Property: Options with multiple values ++ ++ Each of these gets their own parsing block ++ - server|peer <address> <options> ++ - log <options> ++ - broadcast <interval> <address> <optional port> ++ - fallbackdrift <min> <max> ++ - initstepslew <threshold> <addr> <optional extra addrs> ++ - local stratum <int> ++ - mailonchange <emailaddress> <threshold> ++ - makestep <threshold> <limit> ++ - maxchange <threshold> <delay> <limit> ++ *) ++ ++ (* View: host_list ++ Find all ntp servers/peers and their flags/options ++ *) ++ let host_list = [ Util.indent . key server_peer ++ . space . store address_re ++ . ( host_flags | host_options )* ++ . eol ] ++ ++ (* View: log_list ++ log has a specific options list ++ *) ++ let log_list = [ Util.indent . key "log" . log_flag_list+ . eol ] ++ ++ (* View: bcast ++ broadcast has specific syntax ++ *) ++ let bcast = [ Util.indent . key "broadcast" ++ . space . [ label "interval" . store integer ] ++ . space . store_address ++ . ( space . [ label "port" . store integer] | eol) ] ++ ++ (* View: fdrift ++ fallbackdrift has specific syntax ++ *) ++ let fdrift = [ Util.indent . key "fallbackdrift" ++ . space . [ label "min" . store integer ] ++ . space . [ label "max" . store integer ] ++ . eol ] ++ ++ (* View: istepslew ++ initstepslew has specific syntax ++ *) ++ let istepslew = [ Util.indent . key "initstepslew" ++ . space . [ label "threshold" . store number ] ++ . ( space . store_address )+ ++ . eol ] ++ ++ (* View: local ++ local has specific syntax ++ *) ++ let local = [ Util.indent . key "local" . space ++ . [ key "stratum" . space . store integer ] ++ . eol ] ++ ++ (* View: email ++ mailonchange has specific syntax ++ *) ++ let email = [ Util.indent . key "mailonchange" . space ++ . [ label "emailaddress" . store email_addr ] ++ . space ++ . [ label "threshold" . store number ] ++ . eol ] ++ ++ (* View: makestep ++ makestep has specific syntax ++ *) ++ let makestep = [ Util.indent . key "makestep" ++ . space ++ . [ label "threshold" . store number ] ++ . space ++ . [ label "limit" . store integer ] ++ . eol ] ++ ++ (* View: maxchange ++ maxchange has specific syntax ++ *) ++ let maxchange = [ Util.indent . key "maxchange" ++ . space ++ . [ label "threshold" . store number ] ++ . space ++ . [ label "delay" . store integer ] ++ . space ++ . [ label "limit" . store integer ] ++ . eol ] ++ ++(************************************************************************ ++ * Group: Final lense summary ++ ************************************************************************) ++(* View: settings ++ * All supported chrony settings ++ *) ++let settings = host_list | log_list | bcast | fdrift | istepslew ++ | local | email | makestep | maxchange | kv | all_flags ++ ++(* ++ * View: lns ++ * The crony lens ++ *) ++let lns = ( empty | comment | settings )* ++ ++(* View: filter ++ * The files parsed by default ++ *) ++let filter = incl "/etc/chrony.conf" ++ ++let xfm = transform lns filter ++ +diff --git a/lenses/tests/test_chrony.aug b/lenses/tests/test_chrony.aug +new file mode 100644 +index 0000000..4917358 +--- /dev/null ++++ b/lenses/tests/test_chrony.aug +@@ -0,0 +1,143 @@ ++(* ++Module: Test_Chrony ++ Provides unit tests and examples for the <Chrony> lens. ++*) ++ ++module Test_Chrony = ++ ++ let exampleconf = "# Comment ++#Comment ++! Comment ++!Comment ++; Comment ++;Comment ++% Comment ++%Comment ++ ++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 ntp6.example.com maxdelay 2 iburst presend 2 ++server ntp7.example.com iburst presend 2 offline ++peer ntpc1.example.com ++stratumweight 0 ++driftfile /var/lib/chrony/drift ++rtcsync ++makestep 10 3 ++bindcmdaddress 127.0.0.1 ++bindcmdaddress ::1 ++local stratum 10 ++keyfile /etc/chrony.keys ++commandkey 1 ++generatecommandkey ++noclientlog ++logchange 0.5 ++logdir /var/log/chrony ++log rtc ++leapsectz right/UTC ++broadcast 10 192.168.1.255 ++broadcast 10 192.168.100.255 123 ++fallbackdrift 16 19 ++mailonchange root@localhost 0.5 ++maxchange 1000 1 2 ++initstepslew 30 foo.bar.com ++initstepslew 30 foo.bar.com baz.quz.com ++" ++ ++ test Chrony.lns get exampleconf = ++ { "#comment" = "Comment" } ++ { "#comment" = "Comment" } ++ { "#comment" = "Comment" } ++ { "#comment" = "Comment" } ++ { "#comment" = "Comment" } ++ { "#comment" = "Comment" } ++ { "#comment" = "Comment" } ++ { "#comment" = "Comment" } ++ { } ++ { "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" = "ntp6.example.com" ++ { "maxdelay" = "2" } ++ { "iburst" } ++ { "presend" = "2" } ++ } ++ { "server" = "ntp7.example.com" ++ { "iburst" } ++ { "presend" = "2" } ++ { "offline" } ++ } ++ { "peer" = "ntpc1.example.com" } ++ { "stratumweight" = "0" } ++ { "driftfile" = "/var/lib/chrony/drift" } ++ { "rtcsync" } ++ { "makestep" ++ { "threshold" = "10" } ++ { "limit" = "3" } ++ } ++ { "bindcmdaddress" = "127.0.0.1" } ++ { "bindcmdaddress" = "::1" } ++ { "local" ++ { "stratum" = "10" } ++ } ++ { "keyfile" = "/etc/chrony.keys" } ++ { "commandkey" = "1" } ++ { "generatecommandkey" } ++ { "noclientlog" } ++ { "logchange" = "0.5" } ++ { "logdir" = "/var/log/chrony" } ++ { "log" ++ { "rtc" } ++ } ++ { "leapsectz" = "right/UTC" } ++ { "broadcast" ++ { "interval" = "10" } ++ { "address" = "192.168.1.255" } ++ } ++ { "broadcast" ++ { "interval" = "10" } ++ { "address" = "192.168.100.255" } ++ { "port" = "123" } ++ } ++ { } ++ { "fallbackdrift" ++ { "min" = "16" } ++ { "max" = "19" } ++ } ++ { "mailonchange" ++ { "emailaddress" = "root@localhost" } ++ { "threshold" = "0.5" } ++ } ++ { "maxchange" ++ { "threshold" = "1000" } ++ { "delay" = "1" } ++ { "limit" = "2" } ++ } ++ { "initstepslew" ++ { "threshold" = "30" } ++ { "address" = "foo.bar.com" } ++ } ++ { "initstepslew" ++ { "threshold" = "30" } ++ { "address" = "foo.bar.com" } ++ { "address" = "baz.quz.com" } ++ } ++ ++ ++(* Local Variables: *) ++(* mode: caml *) ++(* End: *) +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 180a19d..1b79629 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -41,6 +41,7 @@ lens_tests = \ + lens-cgconfig.sh \ + lens-cgrules.sh \ + lens-channels.sh \ ++ lens-chrony.sh \ + lens-cobblersettings.sh \ + lens-cobblermodules.sh \ + lens-collectd.sh \ diff --git a/SOURCES/0020-Fixes-27-Automounter-lens-does-not-handle-hostnames-.patch b/SOURCES/0020-Fixes-27-Automounter-lens-does-not-handle-hostnames-.patch new file mode 100644 index 0000000..6c755e3 --- /dev/null +++ b/SOURCES/0020-Fixes-27-Automounter-lens-does-not-handle-hostnames-.patch @@ -0,0 +1,60 @@ +From ed0594ef0bfd796bcebd8ac38e54c991553d509a Mon Sep 17 00:00:00 2001 +From: Jan Vansteenkiste <jan@vstone.eu> +Date: Thu, 27 Jun 2013 14:10:26 +0200 +Subject: [PATCH] Fixes #27: Automounter lens does not handle hostnames with + dashes in them + +(cherry picked from commit e6643d81a480d99886070243455456e5d0147885) +--- + lenses/automounter.aug | 2 +- + lenses/tests/test_automounter.aug | 16 +++++++++++++++- + 2 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/lenses/automounter.aug b/lenses/automounter.aug +index 029acbf..f830c7d 100644 +--- a/lenses/automounter.aug ++++ b/lenses/automounter.aug +@@ -40,7 +40,7 @@ let comment = Util.comment + let path = /[^-+#: \t\n][^#: \t\n]*/ + + (* View: hostname *) +-let hostname = /[^-:#\(\), \n\t]+/ ++let hostname = /[^-:#\(\), \n\t][^:#\(\), \n\t]*/ + + (* An option label can't contain comma, comment, equals, or space *) + let optlabel = /[^,#:\(\)= \n\t]+/ +diff --git a/lenses/tests/test_automounter.aug b/lenses/tests/test_automounter.aug +index 7c2db86..c84fc0a 100644 +--- a/lenses/tests/test_automounter.aug ++++ b/lenses/tests/test_automounter.aug +@@ -25,6 +25,8 @@ server -rw,hard,intr / -ro myserver.me.org:/ \ + /usr myserver.me.org:/usr \ + /home myserver.me.org:/home + ++server -rw,hard,intr / -ro my-with-dash-server.me.org:/ ++ + # included maps + +auto_home + " +@@ -148,8 +150,20 @@ server -rw,hard,intr / -ro myserver.me.org:/ \ + { "host" = "myserver.me.org" } + { "path" = "/home" } } } } } } + { } ++ { "11" = "server" ++ { "opt" = "rw" } ++ { "opt" = "hard" } ++ { "opt" = "intr" } ++ { "mount" ++ { "1" = "/" ++ { "opt" = "ro" } ++ { "location" ++ { "1" ++ { "host" = "my-with-dash-server.me.org" } ++ { "path" = "/" } } } } } } ++ { } + { "#comment" = "included maps" } +- { "11" = "+" ++ { "12" = "+" + { "map" = "auto_home" } } + + (* Local Variables: *) diff --git a/SOURCES/0021-Systemd-parse-etc-sysconfig-.systemd-as-used-in-389-.patch b/SOURCES/0021-Systemd-parse-etc-sysconfig-.systemd-as-used-in-389-.patch new file mode 100644 index 0000000..0a91778 --- /dev/null +++ b/SOURCES/0021-Systemd-parse-etc-sysconfig-.systemd-as-used-in-389-.patch @@ -0,0 +1,42 @@ +From 2f5770c038c9fdb158b456ca105276968d84514e Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Wed, 9 Jul 2014 09:45:19 +0100 +Subject: [PATCH] Systemd: parse /etc/sysconfig/*.systemd as used in 389-ds + +Fixes RHBZ#1083022 + +(cherry picked from commit 9073aa57a7003bad3f8b9886675f155e5b374892) + +Conflicts: + NEWS +--- + lenses/shellvars.aug | 3 ++- + lenses/systemd.aug | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index eff933a..784ce6e 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -212,7 +212,8 @@ module Shellvars = + sc_excl "SuSEfirewall2.d" . + sc_incl "SuSEfirewall2.d/cobbler" . + sc_incl "SuSEfirewall2.d/services/*" . +- sc_excl "SuSEfirewall2.d/services/TEMPLATE" ++ sc_excl "SuSEfirewall2.d/services/TEMPLATE" . ++ sc_excl "*.systemd" + + let filter_default = incl "/etc/default/*" + . excl "/etc/default/grub_installdevice*" +diff --git a/lenses/systemd.aug b/lenses/systemd.aug +index aba1001..c7f9f9d 100644 +--- a/lenses/systemd.aug ++++ b/lenses/systemd.aug +@@ -159,6 +159,7 @@ let filter = incl "/lib/systemd/system/*" + . incl "/lib/systemd/system/*/*" + . incl "/etc/systemd/system/*" + . incl "/etc/systemd/system/*/*" ++ . incl "/etc/sysconfig/*.systemd" + . Util.stdexcl + + let xfm = transform lns filter diff --git a/SOURCES/0022-src-augeas.c-unlink_removed_files-ensure-aug_save-re.patch b/SOURCES/0022-src-augeas.c-unlink_removed_files-ensure-aug_save-re.patch new file mode 100644 index 0000000..97fbf4b --- /dev/null +++ b/SOURCES/0022-src-augeas.c-unlink_removed_files-ensure-aug_save-re.patch @@ -0,0 +1,82 @@ +From 4d69d88f20a7aa87d81004db44c1094ad1afea80 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Thu, 4 Sep 2014 08:44:20 +0100 +Subject: [PATCH] * src/augeas.c (unlink_removed_files): ensure aug_save + returns non-zero result when unable to delete files + +Fixes RHBZ#1091143 + +(cherry picked from commit b61a78d2e629e4f1395270a1ee72876e27b12990) + +Conflicts: + NEWS +--- + src/augeas.c | 3 ++- + tests/test-save.c | 26 ++++++++++++++++++++++++++ + 2 files changed, 28 insertions(+), 1 deletion(-) + +diff --git a/src/augeas.c b/src/augeas.c +index 3c12443..014e145 100644 +--- a/src/augeas.c ++++ b/src/augeas.c +@@ -1488,7 +1488,8 @@ static int unlink_removed_files(struct augeas *aug, + for (struct tree *t = pathx_first(px); + t != NULL; + t = pathx_next(px)) { +- remove_file(aug, t); ++ if (remove_file(aug, t) < 0) ++ result = -1; + } + free_pathx(px); + } else if (tf->dirty && ! tree_child(tm, "path")) { +diff --git a/tests/test-save.c b/tests/test-save.c +index f28f626..1dac75d 100644 +--- a/tests/test-save.c ++++ b/tests/test-save.c +@@ -29,6 +29,7 @@ + #include <sys/stat.h> + #include <sys/types.h> + #include <sys/wait.h> ++#include <unistd.h> + + const char *abs_top_srcdir; + const char *abs_top_builddir; +@@ -70,6 +71,30 @@ static void teardown(ATTRIBUTE_UNUSED CuTest *tc) { + root = NULL; + } + ++static void testRemoveNoPermission(CuTest *tc) { ++ if (getuid() == 0) { ++ puts("pending (testRemoveNoPermission): can't test permissions under root account"); ++ return; ++ } ++ ++ int r; ++ const char *errmsg; ++ ++ // Prevent deletion of files ++ run(tc, "chmod 0500 %s/etc", root); ++ ++ r = aug_rm(aug, "/files/etc/hosts"); ++ CuAssertTrue(tc, r > 0); ++ ++ r = aug_save(aug); ++ CuAssertIntEquals(tc, -1, r); ++ ++ r = aug_get(aug, "/augeas/files/etc/hosts/error", &errmsg); ++ CuAssertIntEquals(tc, 1, r); ++ CuAssertPtrNotNull(tc, errmsg); ++ CuAssertStrEquals(tc, "unlink_orig", errmsg); ++} ++ + static void testSaveNewFile(CuTest *tc) { + int r; + +@@ -285,6 +310,7 @@ int main(void) { + CuSuiteSetup(suite, setup, teardown); + + SUITE_ADD_TEST(suite, testSaveNewFile); ++ SUITE_ADD_TEST(suite, testRemoveNoPermission); + SUITE_ADD_TEST(suite, testNonExistentLens); + SUITE_ADD_TEST(suite, testMultipleXfm); + SUITE_ADD_TEST(suite, testMtime); diff --git a/SOURCES/0023-src-augtool.c-add-command-aliases-to-autocomplete.patch b/SOURCES/0023-src-augtool.c-add-command-aliases-to-autocomplete.patch new file mode 100644 index 0000000..377d363 --- /dev/null +++ b/SOURCES/0023-src-augtool.c-add-command-aliases-to-autocomplete.patch @@ -0,0 +1,28 @@ +From f153c132ad5b8987c86b472eb73b1607a5223f42 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 2 Jun 2014 13:35:30 +0100 +Subject: [PATCH] * src/augtool.c: add command aliases to autocomplete + +Fixes RHBZ#1100184 + +(cherry picked from commit 0d540378e3e319607a078bcce520dd74e2f71013) + +Conflicts: + NEWS +--- + src/augtool.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/augtool.c b/src/augtool.c +index 9ec3839..54fc507 100644 +--- a/src/augtool.c ++++ b/src/augtool.c +@@ -171,7 +171,7 @@ static char *readline_command_generator(const char *text, int state) { + "get", "label", "ins", "load", "ls", "match", + "mv", "rename", "print", "dump-xml", "rm", "save", "set", "setm", + "clearm", "span", "store", "retrieve", "transform", +- "help", NULL }; ++ "help", "touch", "insert", "move", "copy", NULL }; + + static int current = 0; + const char *name; diff --git a/SOURCES/0024-man-augtool.pod-update-man-page-with-new-commands.patch b/SOURCES/0024-man-augtool.pod-update-man-page-with-new-commands.patch new file mode 100644 index 0000000..c7cf657 --- /dev/null +++ b/SOURCES/0024-man-augtool.pod-update-man-page-with-new-commands.patch @@ -0,0 +1,260 @@ +From 24fb307289750ec948dad249020d69143b98303a Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 2 Jun 2014 14:14:18 +0100 +Subject: [PATCH] * man/augtool.pod: update man page with new commands + +Fixes RHBZ#1100077 + +(cherry picked from commit 242acb210d87e94f6244d85f22301caa630885c0) + +Conflicts: + NEWS + man/augtool.1 + man/augtool.pod + +* man/augtool.pod: update man page with --span option + +(cherry picked from commit 3c5a185afbfee4e3156ba9e0c6e2a5b32233b0cf) + +Conflicts: + NEWS + man/augtool.1 +--- + man/augtool.pod | 169 +++++++++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 124 insertions(+), 45 deletions(-) + +diff --git a/man/augtool.pod b/man/augtool.pod +index c145032..28f8563 100644 +--- a/man/augtool.pod ++++ b/man/augtool.pod +@@ -92,6 +92,11 @@ creates no entries under C</augeas/load> whatsoever; to read any files, + they need to be set up manually and loading must be initiated with a + C<load> command. Using this option gives the fastest startup. + ++=item B<--span> ++ ++Load span positions for nodes in the tree, as they relate to the original ++file. Enables the use of the B<span> command to retrieve position data. ++ + =item B<--version> + + Print version information and exit. The version is also in the tree under +@@ -111,12 +116,69 @@ be distinguished by appending C<[N]> to their label to match the N-th + sibling with such a label. The last sibling with a specific label can be + reached as C<[last()]>. See L</EXAMPLES> for some examples of this. + ++=head2 ADMIN COMMANDS ++ ++The following commands control the behavior of Augeas and augtool itself. ++ + =over 4 + ++=item B<help> ++ ++Print this help text ++ ++=item B<load> ++ ++Load files according to the transforms in C</augeas/load>. ++ + =item B<quit> + + Exit the program + ++=item B<retrieve> E<lt>LENSE<gt> E<lt>NODE_INE<gt> E<lt>PATHE<gt> E<lt>NODE_OUTE<gt> ++ ++Transform tree at PATH back into text using lens LENS and store the ++resulting string at NODE_OUT. Assume that the tree was initially read in ++with the same lens and the string stored at NODE_IN as input. ++ ++=item B<save> ++ ++Save all pending changes to disk. Unless either the B<-b> or B<-n> ++command line options are given, files are changed in place. ++ ++=item B<store> E<lt>LENSE<gt> E<lt>NODEE<gt> E<lt>PATHE<gt> ++ ++Parse NODE using LENS and store the resulting tree at PATH. ++ ++=item B<transform> E<lt>LENSE<gt> E<lt>FILTERE<gt> E<lt>FILEE<gt> ++ ++Add a transform for FILE using LENS. The LENS may be a module name or a ++full lens name. If a module name is given, then "lns" will be the lens ++assumed. The FILTER must be either "incl" or "excl". If the filter is ++"incl", the FILE will be parsed by the LENS. If the filter is "excl", ++the FILE will be excluded from the LENS. FILE may contain wildcards. ++ ++=back ++ ++=head2 READ COMMANDS ++ ++The following commands are used to retrieve data from the Augeas tree. ++ ++=over 4 ++ ++=item B<dump-xml> I<[E<lt>PATHE<gt>]> I<[E<lt>FILENAMEE<gt>]> ++ ++Print entries in the tree as XML. If PATH is given, printing starts there, ++otherwise the whole tree is printed. If FILENAME is given, the XML is saved ++to the given file. ++ ++=item B<get> E<lt>PATHE<gt> ++ ++Print the value associated with PATH ++ ++=item B<label> E<lt>PATHE<gt> ++ ++Get and print the label associated with PATH ++ + =item B<ls> E<lt>PATHE<gt> + + List the direct children of PATH +@@ -126,67 +188,91 @@ List the direct children of PATH + Find all paths that match PATTERN. If VALUE is given, only the matching + paths whose value equals VALUE are printed + +-=item B<rm> E<lt>PATHE<gt> ++=item B<print> I<[E<lt>PATHE<gt>]> + +-Delete PATH and all its children from the tree ++Print entries in the tree. If PATH is given, printing starts there, ++otherwise the whole tree is printed + +-=item B<mv> E<lt>SRCE<gt> E<lt>DSTE<gt> ++=item B<span> E<lt>PATHE<gt> + +-Move node SRC to DST. SRC must match exactly one node in the tree. DST +-must either match exactly one node in the tree, or may not exist yet. If +-DST exists already, it and all its descendants are deleted. If DST does not +-exist yet, it and all its missing ancestors are created. ++Print the name of the file from which the node PATH was generated, as well ++as information about the positions in the file corresponding to the label, ++the value, and the entire node. PATH must match exactly one node. + +-=item B<set> E<lt>PATHE<gt> E<lt>VALUEE<gt> ++You need to run 'set /augeas/span enable' prior to loading files to enable ++recording of span information. It is disabled by default. + +-Associate VALUE with PATH. If PATH is not in the tree yet, +-it and all its ancestors will be created. ++=back ++ ++=head2 WRITE COMMANDS ++ ++The following commands are used to modify the Augeas tree. ++ ++=over 4 + + =item B<clear> E<lt>PATHE<gt> + + Set the value for PATH to NULL. If PATH is not in the tree yet, it and all + its ancestors will be created. + +-=item B<setm> E<lt>BASEE<gt> E<lt>SUBE<gt> E<lt>VALUEE<gt> ++=item B<clearm> E<lt>BASEE<gt> E<lt>SUBE<gt> + +-Set multiple nodes in one operation. Find or create a node matching SUB by +-interpreting SUB as a path expression relative to each node matching ++Clear multiple nodes values in one operation. Find or create a node matching SUB ++by interpreting SUB as a path expression relative to each node matching + BASE. If SUB is '.', the nodes matching BASE will be modified. + +-=item B<get> E<lt>PATHE<gt> ++=item B<ins> I<E<lt>LABELE<gt>> I<E<lt>WHEREE<gt>> I<E<lt>PATHE<gt>> + +-Print the value associated with PATH ++Insert a new node with label LABEL right before or after PATH into the ++tree. WHERE must be either 'before' or 'after'. + +-=item B<print> I<[E<lt>PATHE<gt>]> ++=item B<insert> I<E<lt>LABELE<gt>> I<E<lt>WHEREE<gt>> I<E<lt>PATHE<gt>> + +-Print entries in the tree. If PATH is given, printing starts there, +-otherwise the whole tree is printed ++Alias of B<ins>. + +-=item B<dump-xml> I<[E<lt>PATHE<gt>]> I<[E<lt>FILENAMEE<gt>]> ++=item B<mv> E<lt>SRCE<gt> E<lt>DSTE<gt> + +-Print entries in the tree as XML. If PATH is given, printing starts there, +-otherwise the whole tree is printed. If FILENAME is given, the XML is saved +-to the given file. ++Move node SRC to DST. SRC must match exactly one node in the tree. DST ++must either match exactly one node in the tree, or may not exist yet. If ++DST exists already, it and all its descendants are deleted. If DST does not ++exist yet, it and all its missing ancestors are created. + +-=item B<ins> I<E<lt>LABELE<gt>> I<E<lt>WHEREE<gt>> I<E<lt>PATHE<gt>> ++=item B<move> E<lt>SRCE<gt> E<lt>DSTE<gt> + +-Insert a new node with label LABEL right before or after PATH into the +-tree. WHERE must be either 'before' or 'after'. ++Alias of B<move>. + +-=item B<save> ++=item B<rename> E<lt>SRCE<gt> E<lt>LBLE<gt> + +-Save all pending changes to disk. Unless either the B<-b> or B<-n> +-command line options are given, files are changed in place. ++Rename the label of all nodes matching SRC to LBL. + +-=item B<load> ++=item B<rm> E<lt>PATHE<gt> + +-Load files according to the transforms in C</augeas/load>. ++Delete PATH and all its children from the tree + +-=item B<defvar> E<lt>NAMEE<gt> E<lt>EXPRE<gt> ++=item B<set> E<lt>PATHE<gt> E<lt>VALUEE<gt> + +-Define the variable NAME to the result of evaluating EXPR. The variable +-can be used in path expressions as $NAME. Note that EXPR is evaluated when +-the variable is defined, not when it is used. ++Associate VALUE with PATH. If PATH is not in the tree yet, ++it and all its ancestors will be created. ++ ++=item B<setm> E<lt>BASEE<gt> E<lt>SUBE<gt> [E<lt>VALUEE<gt>] ++ ++Set multiple nodes in one operation. Find or create a node matching SUB by ++interpreting SUB as a path expression relative to each node matching ++BASE. If SUB is '.', the nodes matching BASE will be modified. ++ ++=item B<touch> E<lt>PATHE<gt> ++ ++Create PATH with the value NULL if it is not in the tree yet. All its ++ancestors will also be created. These new tree entries will appear ++last amongst their siblings. ++ ++=back ++ ++=head2 PATH EXPRESSION COMMANDS ++ ++The following commands help when working with path expressions. ++ ++=over 4 + + =item B<defnode> E<lt>NAMEE<gt> E<lt>EXPRE<gt> [E<lt>VALUEE<gt>] + +@@ -196,18 +282,11 @@ refer to it. If VALUE is given, this is the same as 'set EXPR VALUE'; if + VALUE is not given, the node is created as if with 'clear EXPR' would and + NAME refers to that node. + +-=item B<span> E<lt>PATHE<gt> +- +-Print the name of the file from which the node PATH was generated, as well +-as information about the positions in the file corresponding to the label, +-the value, and the entire node. PATH must match exactly one node. +- +-You need to run 'set /augeas/span enable' prior to loading files to enable +-recording of span information. It is disabled by default. +- +-=item B<help> ++=item B<defvar> E<lt>NAMEE<gt> E<lt>EXPRE<gt> + +-Print this help text ++Define the variable NAME to the result of evaluating EXPR. The variable ++can be used in path expressions as $NAME. Note that EXPR is evaluated when ++the variable is defined, not when it is used. + + =back + diff --git a/SOURCES/0025-src-augrun.c-remove-unused-filename-argument-from-du.patch b/SOURCES/0025-src-augrun.c-remove-unused-filename-argument-from-du.patch new file mode 100644 index 0000000..bf0c781 --- /dev/null +++ b/SOURCES/0025-src-augrun.c-remove-unused-filename-argument-from-du.patch @@ -0,0 +1,80 @@ +From ada0cd07eb449eb48b2fdf78f8e32f8a0a7199c9 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 2 Jun 2014 16:05:30 +0100 +Subject: [PATCH] * src/augrun.c: remove unused "filename" argument from + dump-xml command + +Fixes RHBZ#1100106 + +(cherry picked from commit e775e5f85183a76c584219b14963368a66171375) + +Conflicts: + NEWS +--- + man/augtool.pod | 5 ++--- + src/augrun.c | 11 ++--------- + 2 files changed, 4 insertions(+), 12 deletions(-) + +diff --git a/man/augtool.pod b/man/augtool.pod +index 28f8563..44695ba 100644 +--- a/man/augtool.pod ++++ b/man/augtool.pod +@@ -165,11 +165,10 @@ The following commands are used to retrieve data from the Augeas tree. + + =over 4 + +-=item B<dump-xml> I<[E<lt>PATHE<gt>]> I<[E<lt>FILENAMEE<gt>]> ++=item B<dump-xml> I<[E<lt>PATHE<gt>]> + + Print entries in the tree as XML. If PATH is given, printing starts there, +-otherwise the whole tree is printed. If FILENAME is given, the XML is saved +-to the given file. ++otherwise the whole tree is printed. + + =item B<get> E<lt>PATHE<gt> + +diff --git a/src/augrun.c b/src/augrun.c +index 024d1fc..fd96409 100644 +--- a/src/augrun.c ++++ b/src/augrun.c +@@ -895,30 +895,23 @@ static const struct command_def cmd_print_def = { + + static void cmd_dump_xml(struct command *cmd) { + const char *path = arg_value(cmd, "path"); +- const char *filename = arg_value(cmd, "filename"); + xmlNodePtr xmldoc; + int r; + + r = aug_to_xml(cmd->aug, path, &xmldoc, 0); + if (r < 0) + ERR_REPORT(cmd, AUG_ECMDRUN, +- "XML export of path %s to file %s failed", path, filename); ++ "XML export of path %s failed", path); + + xmlElemDump(stdout, NULL, xmldoc); + printf("\n"); + +- if (filename != NULL) { +- printf("Saving to %s\n", filename); +- } +- + xmlFreeNode(xmldoc); + } + + static const struct command_opt_def cmd_dump_xml_opts[] = { + { .type = CMD_PATH, .name = "path", .optional = true, + .help = "print this subtree" }, +- { .type = CMD_NONE, .name = "filename", .optional = true, +- .help = "save to this file" }, + CMD_OPT_DEF_LAST + }; + +@@ -927,7 +920,7 @@ static const struct command_def cmd_dump_xml_def = { + .opts = cmd_dump_xml_opts, + .handler = cmd_dump_xml, + .synopsis = "print a subtree as XML", +- .help = "Export entries in the tree as XML. If PATH is given, printing starts there,\n otherwise the whole tree is printed. If FILENAME is given, the XML is saved\n to the given file." ++ .help = "Export entries in the tree as XML. If PATH is given, printing starts there,\n otherwise the whole tree is printed." + }; + + static void cmd_transform(struct command *cmd) { diff --git a/SOURCES/0026-Systemd-allow-quoted-Environment-key-value-pairs.patch b/SOURCES/0026-Systemd-allow-quoted-Environment-key-value-pairs.patch new file mode 100644 index 0000000..4a64a17 --- /dev/null +++ b/SOURCES/0026-Systemd-allow-quoted-Environment-key-value-pairs.patch @@ -0,0 +1,64 @@ +From ff36da46e07b819cf178f66c284a2672f547b6cb Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Wed, 9 Jul 2014 09:22:44 +0100 +Subject: [PATCH] Systemd: allow quoted Environment key=value pairs + +Fixes RHBZ#1100547 + +(cherry picked from commit 5226ae7d162691c20e00096ae8023e74b912ace0) + +Conflicts: + NEWS +--- + lenses/systemd.aug | 9 +++++++-- + lenses/tests/test_systemd.aug | 6 +++++- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/lenses/systemd.aug b/lenses/systemd.aug +index c7f9f9d..370945b 100644 +--- a/lenses/systemd.aug ++++ b/lenses/systemd.aug +@@ -125,8 +125,13 @@ let entry_command = + (* View: entry_env + Entry that takes a space separated set of ENV=value key/value pairs *) + let entry_env = +- let envkv = [ key env_key . Util.del_str "=" . ( sto_value )? ] +- in entry_fn entry_env_kw ( Build.opt_list envkv value_sep ) ++ 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\\]/)?) ++ (* 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 ] | [ quoted ] ++ in entry_fn entry_env_kw ( Build.opt_list envkv_quoted value_sep ) + + + (************************************************************************ +diff --git a/lenses/tests/test_systemd.aug b/lenses/tests/test_systemd.aug +index a531230..b1574e1 100644 +--- a/lenses/tests/test_systemd.aug ++++ b/lenses/tests/test_systemd.aug +@@ -203,6 +203,7 @@ Environment=LANG=C FOO=BAR + Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= + Environment=LANG=C\ + FOO=BAR ++Environment=\"LANG=foo bar\" FOO=BAR + " + (* Test: Systemd.lns *) + test Systemd.lns get env = +@@ -234,6 +235,10 @@ test Systemd.lns get env = + { "LANG" = "C" } + { "FOO" = "BAR" } + } ++ { "Environment" ++ { "LANG" = "foo bar" } ++ { "FOO" = "BAR" } ++ } + } + + (* Variable: unit *) +@@ -302,4 +307,3 @@ test Systemd.entry_command get "ExecStart=/usr/bin/find /var/lib/sudo -exec /usr + { "7" = "\073" } + } + } +- diff --git a/SOURCES/0027-Rmt-new-lens-to-parse-etc-default-rmt.patch b/SOURCES/0027-Rmt-new-lens-to-parse-etc-default-rmt.patch new file mode 100644 index 0000000..335cf18 --- /dev/null +++ b/SOURCES/0027-Rmt-new-lens-to-parse-etc-default-rmt.patch @@ -0,0 +1,145 @@ +From f56f8fd3bc9e94931c9f5690e6cb4f49e93e119b Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Wed, 9 Jul 2014 10:44:21 +0100 +Subject: [PATCH] Rmt: new lens to parse /etc/default/rmt + +Fixes RHBZ#1100549 + +(cherry picked from commit c59d33dc430a9db5be3c67b1d5730f185283f208) + +Conflicts: + NEWS +--- + doc/naturaldocs/conf/lenses/Menu.txt | 2 ++ + lenses/rmt.aug | 30 ++++++++++++++++++++++++++++ + lenses/shellvars.aug | 1 + + lenses/tests/test_rmt.aug | 38 ++++++++++++++++++++++++++++++++++++ + tests/Makefile.am | 1 + + 5 files changed, 72 insertions(+) + create mode 100644 lenses/rmt.aug + create mode 100644 lenses/tests/test_rmt.aug + +diff --git a/doc/naturaldocs/conf/lenses/Menu.txt b/doc/naturaldocs/conf/lenses/Menu.txt +index 34e0bf6..2a9af26 100644 +--- a/doc/naturaldocs/conf/lenses/Menu.txt ++++ b/doc/naturaldocs/conf/lenses/Menu.txt +@@ -141,6 +141,7 @@ Group: Specific Modules { + File: Redis (redis.aug) + File: Reprepro_Uploaders (reprepro_uploaders.aug) + File: Resolv (resolv.aug) ++ File: Rmt (rmt.aug) + File: Rsyslog (rsyslog.aug) + File: Schroot (schroot.aug) + File: Services (services.aug) +@@ -230,6 +231,7 @@ Group: Tests and Examples { + File: Test_Rabbitmq (tests/test_rabbitmq.aug) + File: Test_Redis (tests/test_redis.aug) + File: Test_Reprepro_Uploaders (tests/test_reprepro_uploaders.aug) ++ File: Test_Rmt (tests/test_rmt.aug) + File: Test_Rsyslog (tests/test_rsyslog.aug) + File: Test_Simplelines (tests/test_simplelines.aug) + File: Test_Simplevars (tests/test_simplevars.aug) +diff --git a/lenses/rmt.aug b/lenses/rmt.aug +new file mode 100644 +index 0000000..36ed2d3 +--- /dev/null ++++ b/lenses/rmt.aug +@@ -0,0 +1,30 @@ ++(* ++Module: Rmt ++ Parses rmt's configuration file ++ ++Author: Dominic Cleal <dcleal@redhat.com> ++ ++About: Reference ++ This lens is based on rmt(1) ++ ++About: License ++ This file is licensed under the LGPL v2+, like the rest of Augeas. ++*) ++ ++module Rmt = ++ autoload xfm ++ ++let sto_to_tab = store Rx.no_spaces ++ ++let debug = Build.key_value_line "DEBUG" Sep.equal ( store Rx.fspath ) ++let user = Build.key_value_line "USER" Sep.equal sto_to_tab ++let access = Build.key_value_line "ACCESS" Sep.equal ++ ( [ label "name" . sto_to_tab ] . Sep.tab . ++ [ label "host" . sto_to_tab ] . Sep.tab . ++ [ label "path" . sto_to_tab ] ) ++ ++let lns = ( debug | user | access | Util.comment | Util.empty )* ++ ++let filter = incl "/etc/default/rmt" ++ ++let xfm = transform lns filter +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index 784ce6e..815e4f1 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -217,6 +217,7 @@ module Shellvars = + + let filter_default = incl "/etc/default/*" + . excl "/etc/default/grub_installdevice*" ++ . excl "/etc/default/rmt" + . excl "/etc/default/whoopsie" + let filter_misc = incl "/etc/arno-iptables-firewall/debconf.cfg" + . incl "/etc/cron-apt/config" +diff --git a/lenses/tests/test_rmt.aug b/lenses/tests/test_rmt.aug +new file mode 100644 +index 0000000..4bb7d68 +--- /dev/null ++++ b/lenses/tests/test_rmt.aug +@@ -0,0 +1,38 @@ ++module Test_rmt = ++ ++let conf = "#ident @(#)rmt.dfl 1.2 05/08/09 Copyr 2000 J. Schilling ++# ++# This file is /etc/default/rmt ++ ++DEBUG=/tmp/RMT ++USER=* ++ ++ACCESS=rtape sparky /dev/rmt/* ++ACCESS=* * /dev/rmt/* ++ ++# Historically, Red Hat rmt was not so ^^ restrictive. ++ACCESS=* * * ++" ++ ++test Rmt.lns get conf = ++ { "#comment" = "ident @(#)rmt.dfl 1.2 05/08/09 Copyr 2000 J. Schilling" } ++ { } ++ { "#comment" = "This file is /etc/default/rmt" } ++ { } ++ { "DEBUG" = "/tmp/RMT" } ++ { "USER" = "*" } ++ { } ++ { "ACCESS" ++ { "name" = "rtape" } ++ { "host" = "sparky" } ++ { "path" = "/dev/rmt/*" } } ++ { "ACCESS" ++ { "name" = "*" } ++ { "host" = "*" } ++ { "path" = "/dev/rmt/*" } } ++ { } ++ { "#comment" = "Historically, Red Hat rmt was not so ^^ restrictive." } ++ { "ACCESS" ++ { "name" = "*" } ++ { "host" = "*" } ++ { "path" = "*" } } +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 1b79629..7b06472 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -151,6 +151,7 @@ lens_tests = \ + lens-redis.sh \ + lens-reprepro_uploaders.sh \ + lens-resolv.sh \ ++ lens-rmt.sh \ + lens-rsyncd.sh \ + lens-rsyslog.sh \ + lens-rx.sh \ diff --git a/SOURCES/0028-Shellvars-support-.-arithmetic-expansion-in-variable.patch b/SOURCES/0028-Shellvars-support-.-arithmetic-expansion-in-variable.patch new file mode 100644 index 0000000..0830da6 --- /dev/null +++ b/SOURCES/0028-Shellvars-support-.-arithmetic-expansion-in-variable.patch @@ -0,0 +1,58 @@ +From 909c71ba2ce1fd294acc0c456e22514fd6262e39 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Wed, 9 Jul 2014 09:22:57 +0100 +Subject: [PATCH] Shellvars: support $(( .. )) arithmetic expansion in variable + assignment + +Fixes RHBZ#1100550 + +(cherry picked from commit 5ef5e32c7e9e3c220325542ee9b0174f151c615d) + +Conflicts: + NEWS + lenses/shellvars.aug + lenses/tests/test_shellvars.aug +--- + lenses/shellvars.aug | 5 +++-- + lenses/tests/test_shellvars.aug | 5 +++++ + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index 815e4f1..511b045 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -37,7 +37,8 @@ module Shellvars = + let bquot = /`[^`\n]*`/ + (* dbquot don't take spaces or semi-colons *) + let dbquot = /``[^` \t\n;]+``/ +- let dollar_assign = /\$\([^\)#\n]*\)/ ++ let dollar_assign = /\$\([^\(\)#\n]*\)/ ++ let dollar_arithm = /\$\(\([^\)#\n]*\)\)/ + + let sto_to_semicol = store /[^#; \t\n][^#;\n]+[^#; \t\n]|[^#; \t\n]+/ + +@@ -56,7 +57,7 @@ module Shellvars = + let simple_value = + let empty_array = /\([ \t]*\)/ in + store (char* | (dquot | squot)+ +- | bquot | dbquot | dollar_assign | empty_array) ++ | bquot | dbquot | dollar_assign | dollar_arithm | empty_array) + + let export = [ key "export" . Util.del_ws_spc ] + let kv = Util.indent . export? . key key_re +diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug +index 18fd361..be852ae 100644 +--- a/lenses/tests/test_shellvars.aug ++++ b/lenses/tests/test_shellvars.aug +@@ -457,6 +457,11 @@ esac\n" = + { "@case_entry" = "1" + { "TestVar" = "\"test1\"" } } } + ++ (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *) ++ test lns get "export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\n" = ++ { "MALLOC_PERTURB_" = "$(($RANDOM % 255 + 1))" ++ { "export" } } ++ + (* Local Variables: *) + (* mode: caml *) + (* End: *) diff --git a/SOURCES/0029-Allow-continued-lines-inside-quoted-value-GH-issue-1.patch b/SOURCES/0029-Allow-continued-lines-inside-quoted-value-GH-issue-1.patch new file mode 100644 index 0000000..d30717e --- /dev/null +++ b/SOURCES/0029-Allow-continued-lines-inside-quoted-value-GH-issue-1.patch @@ -0,0 +1,54 @@ +From 6141f6134e8ee32a154c5ee2c8e7249f8e3aca7e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= <raphael.pinson@camptocamp.com> +Date: Wed, 16 Apr 2014 08:06:32 +0200 +Subject: [PATCH] Allow continued lines inside quoted value (GH issue #104) + +(cherry picked from commit 3b88ba6d897ab62dfa14cd9b627a5d497e45e3c1) + +Conflicts: + NEWS + lenses/tests/test_httpd.aug +--- + lenses/httpd.aug | 10 ++++++++-- + lenses/tests/test_httpd.aug | 10 ++++++++++ + 2 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/lenses/httpd.aug b/lenses/httpd.aug +index caea9b6..979ff40 100644 +--- a/lenses/httpd.aug ++++ b/lenses/httpd.aug +@@ -61,8 +61,14 @@ let indent = Util.indent + (* borrowed from shellvars.aug *) + let char_arg_dir = /[^ '"\t\r\n]|\\\\"|\\\\'/ + let char_arg_sec = /[^ '"\t\r\n>]|\\\\"|\\\\'/ +-let dquot = /"([^"\\\r\n]|\\\\.)*"/ +-let squot = /'([^'\\\r\n]|\\\\.)*'/ ++let cdot = /\\\\./ ++let cl = /\\\\\n/ ++let dquot = ++ let no_dquot = /[^"\\\r\n]/ ++ in /"/ . (no_dquot|cdot|cl)* . /"/ ++let squot = ++ let no_squot = /[^'\\\r\n]/ ++ in /'/ . (no_squot|cdot|cl)* . /'/ + + (****************************************************************** + * Attributes +diff --git a/lenses/tests/test_httpd.aug b/lenses/tests/test_httpd.aug +index af6cdc1..14347f1 100644 +--- a/lenses/tests/test_httpd.aug ++++ b/lenses/tests/test_httpd.aug +@@ -339,3 +339,13 @@ test Httpd.lns get conf2 = + { } + } + ++(* Test: Httpd.lns ++ Newlines inside quoted value (GH issue #104) *) ++test Httpd.lns get "Single 'Foo\\ ++bar' ++Double \"Foo\\ ++bar\"\n" = ++ { "directive" = "Single" ++ { "arg" = "'Foo\\\nbar'" } } ++ { "directive" = "Double" ++ { "arg" = "\"Foo\\\nbar\"" } } diff --git a/SOURCES/0030-Fix-NagiosCfg-lense-so-etc-nagios-nrpe.cfg-is-parsed.patch b/SOURCES/0030-Fix-NagiosCfg-lense-so-etc-nagios-nrpe.cfg-is-parsed.patch new file mode 100644 index 0000000..d84c05c --- /dev/null +++ b/SOURCES/0030-Fix-NagiosCfg-lense-so-etc-nagios-nrpe.cfg-is-parsed.patch @@ -0,0 +1,28 @@ +From ef4f4f7c1276a55d0171bde4bc3693b63e12b24f Mon Sep 17 00:00:00 2001 +From: Yanis Guenane <yguenane@gmail.com> +Date: Sat, 7 Sep 2013 17:24:34 -0400 +Subject: [PATCH] Fix NagiosCfg lense so /etc/nagios/nrpe.cfg is parsed by Nrpe + and not NagiosCfg + +Currently NagiosCfg lense is in charge of parsing all files under /etc/nagios/*.cfg +but /etc/nagios/commands.cfg. /etc/nagios/nrpe.cfg should be also added as an exception +since it needs to be parsed by the Nrpe lense. This issue currently causes the following +error : "Lenses @NagiosCfg and @Nrpe could be used to load this file" + +(cherry picked from commit 7efe87199ec254a5cfd2c34968220c4dc4e05643) +--- + lenses/nagioscfg.aug | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lenses/nagioscfg.aug b/lenses/nagioscfg.aug +index a2180f6..31220c4 100644 +--- a/lenses/nagioscfg.aug ++++ b/lenses/nagioscfg.aug +@@ -68,6 +68,7 @@ let filter = incl "/etc/nagios3/*.cfg" + . incl "/etc/icinga/*.cfg" + . excl "/etc/nagios3/commands.cfg" + . excl "/etc/nagios/commands.cfg" ++ . excl "/etc/nagios/nrpe.cfg" + . incl "/etc/icinga/commands.cfg" + + let xfm = transform lns filter diff --git a/SOURCES/0031-Ldso-handle-hwcap-lines.patch b/SOURCES/0031-Ldso-handle-hwcap-lines.patch new file mode 100644 index 0000000..ba339c6 --- /dev/null +++ b/SOURCES/0031-Ldso-handle-hwcap-lines.patch @@ -0,0 +1,57 @@ +From f4319839a1cef860a8943c74032fdbf023f13104 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 2 Jun 2014 13:25:09 +0100 +Subject: [PATCH] Ldso: handle "hwcap" lines + +Fixes #100 + +(cherry picked from commit a8bd97a2a336319220eab92268ccb3029627ae86) + +Conflicts: + NEWS +--- + lenses/ldso.aug | 8 +++++++- + lenses/tests/test_ldso.aug | 6 ++++++ + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/lenses/ldso.aug b/lenses/ldso.aug +index ef0ee4c..d362573 100644 +--- a/lenses/ldso.aug ++++ b/lenses/ldso.aug +@@ -27,8 +27,14 @@ let path = [ label "path" . store /[^# \t\n][^ \t\n]*/ . Util.eol ] + (* View: include *) + let include = Build.key_value_line "include" Sep.space (store Rx.fspath) + ++(* View: hwcap *) ++let hwcap = ++ let hwcap_val = [ label "bit" . store Rx.integer ] . Sep.space . ++ [ label "name" . store Rx.word ] ++ in Build.key_value_line "hwcap" Sep.space hwcap_val ++ + (* View: lns *) +-let lns = (Util.empty | Util.comment | path | include)* ++let lns = (Util.empty | Util.comment | path | include | hwcap)* + + (* Variable: filter *) + let filter = incl "/etc/ld.so.conf" +diff --git a/lenses/tests/test_ldso.aug b/lenses/tests/test_ldso.aug +index 5270f25..70ee07d 100644 +--- a/lenses/tests/test_ldso.aug ++++ b/lenses/tests/test_ldso.aug +@@ -10,6 +10,8 @@ let conf = "include /etc/ld.so.conf.d/*.conf + + # libc default configuration + /usr/local/lib ++ ++hwcap 1 nosegneg + " + + (* Test: Ldso.lns *) +@@ -18,3 +20,7 @@ test Ldso.lns get conf = + { } + { "#comment" = "libc default configuration" } + { "path" = "/usr/local/lib" } ++ { } ++ { "hwcap" ++ { "bit" = "1" } ++ { "name" = "nosegneg" } } diff --git a/SOURCES/0032-Add-other-valid-controllers-to-cgconfig-lens.patch b/SOURCES/0032-Add-other-valid-controllers-to-cgconfig-lens.patch new file mode 100644 index 0000000..d88138b --- /dev/null +++ b/SOURCES/0032-Add-other-valid-controllers-to-cgconfig-lens.patch @@ -0,0 +1,89 @@ +From 341c2c039d0f34a0a304e5be84f925cbfd5bf2a6 Mon Sep 17 00:00:00 2001 +From: Andy Grimm <agrimm@redhat.com> +Date: Mon, 23 Jun 2014 12:51:35 -0400 +Subject: [PATCH] Add other valid controllers to cgconfig lens + +(cherry picked from commit 45ed30e0a48e56091c5c43aefef46984dde142df) + +Conflicts: + NEWS +--- + AUTHORS | 1 + + lenses/cgconfig.aug | 2 +- + lenses/tests/test_cgconfig.aug | 41 +++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 43 insertions(+), 1 deletion(-) + +diff --git a/AUTHORS b/AUTHORS +index 5f646eb..514ad45 100644 +--- a/AUTHORS ++++ b/AUTHORS +@@ -34,6 +34,7 @@ Contributions by: + Michal Filka <michal.filka@suse.cz> + Marc Fournier <marc.fournier@camptocamp.com> + Davide Guerri <davide.guerri@gmail.com> ++ Andy Grimm <agrimm@redhat.com> + Travis Groth <tgroth@gmail.com> + Adam Helms <helms.adam@gmail.com> + Harald Hoyer <harald@redhat.com> +diff --git a/lenses/cgconfig.aug b/lenses/cgconfig.aug +index 9f960d2..0180a99 100644 +--- a/lenses/cgconfig.aug ++++ b/lenses/cgconfig.aug +@@ -28,7 +28,7 @@ module Cgconfig = + + let id = /[a-zA-Z0-9_\/.-]+/ + let name = /[^#= \n\t{}\/]+/ +- let cont_name = /(cpuacct|cpu|devices|ns|cpuset|memory|freezer|net_cls)/ ++ let cont_name = /(cpuacct|cpu|devices|ns|cpuset|memory|freezer|net_cls|blkio|hugetlb|perf_event)/ + let role_name = /(admin|task)/ + let id_name = /(uid|gid)/ + let address = /[^#; \n\t{}]+/ +diff --git a/lenses/tests/test_cgconfig.aug b/lenses/tests/test_cgconfig.aug +index 458e074..42b0848 100644 +--- a/lenses/tests/test_cgconfig.aug ++++ b/lenses/tests/test_cgconfig.aug +@@ -257,3 +257,44 @@ test Cgconfig.lns get group4 = + test Cgconfig.lns put "group tst {memory {}}" after + set "/group" "tst2" + = "group tst2 {memory {}}" ++ ++let group5=" ++group user { ++ cpuacct {} ++ cpu {} ++ cpuset {} ++ devices {} ++ freezer {} ++ memory {} ++ net_cls {} ++ blkio {} ++ hugetlb {} ++ perf_event {} ++}" ++ ++test Cgconfig.lns get group5 = ++ { } ++ { "group" = "user" ++ { } ++ { "controller" = "cpuacct" } ++ { } ++ { "controller" = "cpu" } ++ { } ++ { "controller" = "cpuset" } ++ { } ++ { "controller" = "devices" } ++ { } ++ { "controller" = "freezer" } ++ { } ++ { "controller" = "memory" } ++ { } ++ { "controller" = "net_cls" } ++ { } ++ { "controller" = "blkio" } ++ { } ++ { "controller" = "hugetlb" } ++ { } ++ { "controller" = "perf_event" } ++ { } ++ } ++ diff --git a/SOURCES/0033-Services-permit-colons-in-service-name.patch b/SOURCES/0033-Services-permit-colons-in-service-name.patch new file mode 100644 index 0000000..f2cc9e8 --- /dev/null +++ b/SOURCES/0033-Services-permit-colons-in-service-name.patch @@ -0,0 +1,44 @@ +From 8d7929bdae06fcfc06eeb24448f2af5fd78821cc Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 21 Jul 2014 08:15:06 +0100 +Subject: [PATCH] Services: permit colons in service name + +Fixes RHBZ#1121263 + +(cherry picked from commit a32a5a395bc63094ba59857fd5dc329c28ddee32) + +Conflicts: + NEWS +--- + lenses/services.aug | 2 +- + lenses/tests/test_services.aug | 7 +++++++ + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/lenses/services.aug b/lenses/services.aug +index 338737d..bad590f 100644 +--- a/lenses/services.aug ++++ b/lenses/services.aug +@@ -47,7 +47,7 @@ let comment = Util.comment + let comment_or_eol = Util.comment_or_eol + let empty = Util.empty + let protocol_re = /[a-zA-Z]+/ +-let word_re = /[a-zA-Z0-9_.+*\/-]+/ ++let word_re = /[a-zA-Z0-9_.+*\/:-]+/ + let num_re = /[0-9]+/ + + (* Group: Separators *) +diff --git a/lenses/tests/test_services.aug b/lenses/tests/test_services.aug +index aef5143..28725fe 100644 +--- a/lenses/tests/test_services.aug ++++ b/lenses/tests/test_services.aug +@@ -79,3 +79,10 @@ z39.50 210/tcp z3950 wais # NISO Z39.50 database \n" + { "end" = "6063" } + { "protocol" = "tcp" } + { "#comment" = "X Window System" } } ++ ++ (* Colons permitted in service names, RHBZ#1121263 *) ++ test Services.lns get "SWRPC.ACCESS.BSS:BS_rmq 48102/tcp # SWIFTAlliance_SWRPC ACCESS\n" = ++ { "service-name" = "SWRPC.ACCESS.BSS:BS_rmq" ++ { "port" = "48102" } ++ { "protocol" = "tcp" } ++ { "#comment" = "SWIFTAlliance_SWRPC ACCESS" } } diff --git a/SOURCES/0034-Fix-Trac-364.-Syslog-lense-accept-UDP-and-TCP-protoc.patch b/SOURCES/0034-Fix-Trac-364.-Syslog-lense-accept-UDP-and-TCP-protoc.patch new file mode 100644 index 0000000..2377390 --- /dev/null +++ b/SOURCES/0034-Fix-Trac-364.-Syslog-lense-accept-UDP-and-TCP-protoc.patch @@ -0,0 +1,135 @@ +From b87ebdaaab6ca72c734f2226068dd69790558125 Mon Sep 17 00:00:00 2001 +From: Yanis Guenane <yguenane@gmail.com> +Date: Sun, 8 Sep 2013 09:30:17 -0400 +Subject: [PATCH] Fix Trac#364. Syslog lense accept UDP(@) and TCP(@@) protocol + +Currently the syslog lense only accept sending log to another host +via UDP - a single @ -, and was discarding TCP - a double @ -. This +PR fixes that. + +Fix test_rsyslog.aug + +Remove unused variable at + +(cherry picked from commit c0837e9d6ab45b2ace276355e146711b2266d10d) + +Restored Augeas 1.1.0 tree compatibility for UDP hosts, which don't require +the { "protocol" = "@" } node, it's only used for TCP hosts. +--- + lenses/syslog.aug | 16 +++++++++++----- + lenses/tests/test_rsyslog.aug | 11 +++++++++++ + lenses/tests/test_syslog.aug | 17 +++++++++++++++++ + 3 files changed, 39 insertions(+), 5 deletions(-) + +diff --git a/lenses/syslog.aug b/lenses/syslog.aug +index eeee702..caa1ce0 100644 +--- a/lenses/syslog.aug ++++ b/lenses/syslog.aug +@@ -59,10 +59,10 @@ module Syslog = + Deletes a semicolon and default to it + *) + let semicolon = sep_tab_opt . Util.del_str ";" . sep_tab_opt +- (* Variable: at +- Deletes a at and default to it +- *) +- let at = Util.del_str "@" ++ (* Variable: at ++ Deletes a at and default to it ++ *) ++ let at = Util.del_str "@" + (* Variable: dot + Deletes a dot and default to it + *) +@@ -101,6 +101,12 @@ module Syslog = + *) + let comparison = /(!|[<=>]+|![<=>]+)/ + ++ (* Variable: protocol ++ @ means UDP (removed, no protocol node is used in this backport) ++ @@ means TCP ++ *) ++ let protocol = /@@/ ++ + (* Variable: token + alphanum or "*" + *) +@@ -175,7 +181,7 @@ module Syslog = + (* View: loghost + a loghost is an @ sign followed by the hostname and a possible port + *) +- let loghost = at . [ label "hostname" . store loghost_r ] . ++ let loghost = ([label "protocol" . store protocol] | at) . [ label "hostname" . store loghost_r ] . + (colon . [ label "port" . store /[0-9]+/ ] )? + + (* View: users +diff --git a/lenses/tests/test_rsyslog.aug b/lenses/tests/test_rsyslog.aug +index 82413ff..bf85129 100644 +--- a/lenses/tests/test_rsyslog.aug ++++ b/lenses/tests/test_rsyslog.aug +@@ -20,6 +20,7 @@ $IncludeConfig /etc/rsyslog.d/*.conf + authpriv.* /var/log/secure + *.emerg * + *.* @2.7.4.1 ++*.* @@2.7.4.1 + *.emerg :omusrmsg:* + *.emerg :omusrmsg:foo,bar + " +@@ -91,6 +92,16 @@ test Rsyslog.lns get conf = + { "entry" + { "selector" + { "facility" = "*" } ++ { "level" = "*" } ++ } ++ { "action" ++ { "protocol" = "@@" } ++ { "hostname" = "2.7.4.1" } ++ } ++ } ++ { "entry" ++ { "selector" ++ { "facility" = "*" } + { "level" = "emerg" } + } + { "action" +diff --git a/lenses/tests/test_syslog.aug b/lenses/tests/test_syslog.aug +index da138ca..8fe24c3 100644 +--- a/lenses/tests/test_syslog.aug ++++ b/lenses/tests/test_syslog.aug +@@ -13,6 +13,8 @@ daemon.<=info /var/log/foo + daemon.!<=info /var/log/foo + *.* @syslog.far.away + *.* @syslog.far.away:123 ++*.* @@syslog.far.away ++*.* @@syslog.far.away:123 + *.* foo,bar + *.* |\"/usr/bin/soft arg\" + !startslip +@@ -95,6 +97,14 @@ daemon.info /var/log/cvsupd.log + } + { "entry" + { "selector" { "facility" = "*" } { "level" = "*" } } ++ { "action" { "protocol" = "@@" } { "hostname" = "syslog.far.away" } } ++ } ++ { "entry" ++ { "selector" { "facility" = "*" } { "level" = "*" } } ++ { "action" { "protocol" = "@@" } { "hostname" = "syslog.far.away" } { "port" = "123" } } ++ } ++ { "entry" ++ { "selector" { "facility" = "*" } { "level" = "*" } } + { "action" { "user" = "foo" } { "user" = "bar" } } + } + { "entry" +@@ -246,6 +256,13 @@ daemon.info /var/log/cvsupd.log + set "/entry/action/hostname" "far.far.away" + = "*.* @far.far.away\n" + ++ (* changing file to remote host *) ++ test Syslog.lns put "*.* /var/lib\n" after ++ rm "/entry/action/file" ; ++ set "/entry/action/protocol" "@@" ; ++ set "/entry/action/hostname" "far.far.away" ++ = "*.* @@far.far.away\n" ++ + (* changing file to * *) + test Syslog.lns put "*.* /var\n" after + rm "/entry/action/file" ; diff --git a/SOURCES/0035-Syslog-permit-IPv6-loghost-addresses.patch b/SOURCES/0035-Syslog-permit-IPv6-loghost-addresses.patch new file mode 100644 index 0000000..e5b71be --- /dev/null +++ b/SOURCES/0035-Syslog-permit-IPv6-loghost-addresses.patch @@ -0,0 +1,53 @@ +From 46460e6d15a217dd0b73e515f8edd480cd95654f Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Wed, 3 Sep 2014 16:27:41 +0100 +Subject: [PATCH] Syslog: permit IPv6 loghost addresses + +Fixes RHBZ#1129388 + +(cherry picked from commit a94ad3e6ca467acd03b38c9964f9c3c773a646a5) + +Conflicts: + NEWS +--- + lenses/syslog.aug | 3 ++- + lenses/tests/test_syslog.aug | 5 +++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/lenses/syslog.aug b/lenses/syslog.aug +index caa1ce0..97c721e 100644 +--- a/lenses/syslog.aug ++++ b/lenses/syslog.aug +@@ -120,7 +120,8 @@ module Syslog = + (* Variable: loghost_r + Matches a hostname, that is labels speparated by dots, labels can't + start or end with a "-". maybe a bit too complicated for what it's worth *) +- let loghost_r = /[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*/ ++ let loghost_r = /[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*/ | ++ "[" . Rx.ipv6 . "]" + + (* Group: Function *) + +diff --git a/lenses/tests/test_syslog.aug b/lenses/tests/test_syslog.aug +index 8fe24c3..51f1e2d 100644 +--- a/lenses/tests/test_syslog.aug ++++ b/lenses/tests/test_syslog.aug +@@ -15,6 +15,7 @@ daemon.!<=info /var/log/foo + *.* @syslog.far.away:123 + *.* @@syslog.far.away + *.* @@syslog.far.away:123 ++*.* @[2001::1]:514 + *.* foo,bar + *.* |\"/usr/bin/soft arg\" + !startslip +@@ -105,6 +106,10 @@ daemon.info /var/log/cvsupd.log + } + { "entry" + { "selector" { "facility" = "*" } { "level" = "*" } } ++ { "action" { "hostname" = "[2001::1]" } { "port" = "514" } } ++ } ++ { "entry" ++ { "selector" { "facility" = "*" } { "level" = "*" } } + { "action" { "user" = "foo" } { "user" = "bar" } } + } + { "entry" diff --git a/SOURCES/0036-Rsyslog-parse-property-filters-and-file-actions-with.patch b/SOURCES/0036-Rsyslog-parse-property-filters-and-file-actions-with.patch new file mode 100644 index 0000000..3f3fb96 --- /dev/null +++ b/SOURCES/0036-Rsyslog-parse-property-filters-and-file-actions-with.patch @@ -0,0 +1,110 @@ +From 71550a96fb273e8da723e9cf6ac77bbea8480695 Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Mon, 2 Jun 2014 12:51:19 +0100 +Subject: [PATCH] Rsyslog: parse property filters and file actions with complex + templates + +Fixes RHBZ#1083016 + +(cherry picked from commit 74816cdcf599cf005b78d9a686dcedc84faf38b4) + +Conflicts: + NEWS +--- + lenses/rsyslog.aug | 24 ++++++++++++++++++++---- + lenses/syslog.aug | 2 +- + lenses/tests/test_rsyslog.aug | 22 ++++++++++++++++++++++ + 3 files changed, 43 insertions(+), 5 deletions(-) + +diff --git a/lenses/rsyslog.aug b/lenses/rsyslog.aug +index 6a1b03a..943847f 100644 +--- a/lenses/rsyslog.aug ++++ b/lenses/rsyslog.aug +@@ -23,16 +23,21 @@ module Rsyslog = + + autoload xfm + +-let macro = [ key /$[A-Za-z0-9]+/ . Sep.space . store Rx.neg1 . Util.comment_or_eol ] ++let macro_rx = /[^,# \n\t][^#\n]*[^,# \n\t]|[^,# \n\t]/ ++let macro = [ key /$[A-Za-z0-9]+/ . Sep.space . store macro_rx . Util.comment_or_eol ] + + (* View: users + Map :omusrmsg: and a list of users, or a single * + *) +-let omusrmsg = Util.del_str ":omusrmsg:" . ++let omusrmsg = Util.del_str ":omusrmsg:" . + Syslog.label_opt_list_or "omusrmsg" (store Syslog.word) + Syslog.comma "*" + +-let action = Syslog.action | omusrmsg ++(* View: file_tmpl ++ File action with a specified template *) ++let file_tmpl = Syslog.file . [ label "template" . Util.del_str ";" . store Rx.word ] ++ ++let action = Syslog.action | omusrmsg | file_tmpl + + (* View: entry + An entry contains selectors and an action +@@ -40,7 +45,18 @@ let action = Syslog.action | omusrmsg + let entry = [ label "entry" . Syslog.selectors . Syslog.sep_tab . + [ label "action" . action ] . Util.eol ] + +-let entries = ( Syslog.empty | Syslog.comment | entry | macro )* ++(* View: prop_filter ++ Parses property-based filters, which start with ":" and the property name *) ++let prop_filter = ++ let sep = Sep.comma . Util.del_ws_spc ++ 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 ] ++ ++let entries = ( Syslog.empty | Syslog.comment | entry | macro | prop_filter )* + + let lns = entries . ( Syslog.program | Syslog.hostname )* + +diff --git a/lenses/syslog.aug b/lenses/syslog.aug +index 97c721e..47f52e9 100644 +--- a/lenses/syslog.aug ++++ b/lenses/syslog.aug +@@ -115,7 +115,7 @@ module Syslog = + (* Variable: file_r + a file begins with a / and get almost anything else after + *) +- let file_r = /\/[^ \t\n]+/ ++ let file_r = /\/[^ \t\n;]+/ + + (* Variable: loghost_r + Matches a hostname, that is labels speparated by dots, labels can't +diff --git a/lenses/tests/test_rsyslog.aug b/lenses/tests/test_rsyslog.aug +index bf85129..46b24c3 100644 +--- a/lenses/tests/test_rsyslog.aug ++++ b/lenses/tests/test_rsyslog.aug +@@ -117,3 +117,25 @@ test Rsyslog.lns get conf = + { "omusrmsg" = "foo" } + { "omusrmsg" = "bar" } } + } ++ ++(* Parse complex $template lines, RHBZ#1083016 *) ++test Rsyslog.lns get "$template SpiceTmpl,\"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\\n\"\n" = ++ { "$template" = "SpiceTmpl,\"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\\n\"" } ++ ++(* Parse property-based filters, RHBZ#1083016 *) ++test Rsyslog.lns get ":programname, startswith, \"spice-vdagent\" /var/log/spice-vdagent.log;SpiceTmpl\n" = ++ { "filter" ++ { "property" = "programname" } ++ { "operation" = "startswith" } ++ { "value" = "spice-vdagent" } ++ { "action" ++ { "file" = "/var/log/spice-vdagent.log" } ++ { "template" = "SpiceTmpl" } } } ++ ++test Rsyslog.lns get ":msg, !contains, \"error\" /var/log/noterror.log\n" = ++ { "filter" ++ { "property" = "msg" } ++ { "operation" = "!contains" } ++ { "value" = "error" } ++ { "action" ++ { "file" = "/var/log/noterror.log" } } } diff --git a/SOURCES/0037-Kdump-parse-new-options-permit-EOL-comments-refactor.patch b/SOURCES/0037-Kdump-parse-new-options-permit-EOL-comments-refactor.patch new file mode 100644 index 0000000..d708875 --- /dev/null +++ b/SOURCES/0037-Kdump-parse-new-options-permit-EOL-comments-refactor.patch @@ -0,0 +1,250 @@ +From 8cd29c1a058fff13f7da8ba8820642e7a44b57ca Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Tue, 9 Sep 2014 09:12:28 +0100 +Subject: [PATCH] Kdump: parse new options, permit EOL comments, refactor + +Fixes RHBZ#1139298 + +(cherry picked from commit a8d43f617a8238107b71c498136800cb561b6246) + +Conflicts: + NEWS + +Test_Kdump: fix test of complete config file + +(cherry picked from commit 0951590aa50c37f0ea89f71e9509a7ccff587cd2) +--- + doc/naturaldocs/conf/lenses/Menu.txt | 1 + + lenses/kdump.aug | 64 +++++++++++++---------- + lenses/tests/test_kdump.aug | 99 ++++++++++++++++++++++++++++-------- + 3 files changed, 116 insertions(+), 48 deletions(-) + +diff --git a/doc/naturaldocs/conf/lenses/Menu.txt b/doc/naturaldocs/conf/lenses/Menu.txt +index 2a9af26..af0d421 100644 +--- a/doc/naturaldocs/conf/lenses/Menu.txt ++++ b/doc/naturaldocs/conf/lenses/Menu.txt +@@ -208,6 +208,7 @@ Group: Tests and Examples { + File: Test_JettyRealm (tests/test_jettyrealm.aug) + File: Test_JMXAccess (tests/test_jmxaccess.aug) + File: Test_JMXPassword (tests/test_jmxpassword.aug) ++ File: Test_Kdump (tests/test_kdump.aug) + File: Test_Keepalived (tests/test_keepalived.aug) + File: Test_Ldso (tests/test_ldso.aug) + File: Test_Lightdm (tests/test_lightdm.aug) +diff --git a/lenses/kdump.aug b/lenses/kdump.aug +index b8f4055..ddf50ed 100644 +--- a/lenses/kdump.aug ++++ b/lenses/kdump.aug +@@ -17,16 +17,36 @@ About: Configuration files + module Kdump = + autoload xfm + ++(************************************************************************ ++ * Group: USEFUL PRIMITIVES ++ *************************************************************************) ++ + let empty = Util.empty + let comment = Util.comment +-let value_to_eol = store Rx.space_in ++let value_to_eol = store /[^ \t\n#][^\n#]*[^ \t\n#]|[^ \t\n#]/ ++let int_to_eol = store Rx.integer + let delimiter = Util.del_ws_spc + let eol = Util.eol +-let value_to_spc = store Rx.no_spaces ++let value_to_spc = store Rx.neg1 + let key_to_space = key /[A-Za-z0-9_.\$-]+/ +-let eq = Util.del_str "=" ++let eq = Sep.equal ++ ++(************************************************************************ ++ * Group: ENTRY TYPES ++ *************************************************************************) ++ ++let list (kw:string) = counter kw ++ . Build.key_value_line_comment kw delimiter ++ (Build.opt_list [ seq kw . value_to_spc ] delimiter) ++ comment ++ ++let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ] ++let mdl_options = [ key_to_space . mdl_key_value+ ] ++let mod_options = [ key "options" . delimiter . mdl_options . (comment|eol) ] + +-let simple_entry (kw:string) = [ key kw . delimiter . value_to_eol . eol ] ++(************************************************************************ ++ * Group: ENTRIES ++ *************************************************************************) + + (* Got from mount(8) *) + let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent" +@@ -37,32 +57,20 @@ let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent" + | "smbfs" | "sysv" | "tmpfs" | "ubifs" | "udf" | "ufs" | "umsdos" + | "usbfs" | "vfat" | "xenix" | "xfs" | "xiafs" + +-let fs = [ key fs_types . delimiter . value_to_eol . eol ] +- +-let bin = [ seq "bin" . delimiter . value_to_spc ] +-let extra_bins = [ key "extra_bins" . (bin)+ . eol ] +- +-let mdl = [ seq "module" . delimiter . value_to_spc ] +-let extra_modules = [ key "extra_modules" . (mdl)+ . eol ] ++let simple_kws = "raw" | "net" | "path" | "core_collector" | "kdump_post" ++ | "kdump_pre" | "default" | "ssh" | "sshkey" | "dracut_args" ++ | "fence_kdump_args" + ++let int_kws = "force_rebuild" | "override_resettable" | "debug_mem_level" ++ | "link_delay" | "disk_timeout" + +-let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ] +-let mdl_options = [ key_to_space . mdl_key_value+ ] +-let mod_options = [ key "options" . delimiter . mdl_options . eol ] +- +- +-let option = simple_entry "raw" +- | simple_entry "net" +- | simple_entry "path" +- | simple_entry "disk_timeout" +- | simple_entry "core_collector" +- | simple_entry "link_delay" +- | simple_entry "kdump_post" +- | simple_entry "kdump_pre" +- | simple_entry "default" +- | fs +- | extra_bins +- | extra_modules ++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 ++ | list "extra_bins" ++ | list "extra_modules" ++ | list "blacklist" ++ | list "fence_kdump_nodes" + | mod_options + + (* View: lns +diff --git a/lenses/tests/test_kdump.aug b/lenses/tests/test_kdump.aug +index 7057782..51c79a3 100644 +--- a/lenses/tests/test_kdump.aug ++++ b/lenses/tests/test_kdump.aug +@@ -1,6 +1,9 @@ +-(* Test for kdump lens *) ++(* ++Module: Test_Kdump ++ Provides unit tests and examples for the <Kdump> lens. ++*) + +-module Test_kdump = ++module Test_Kdump = + + let conf = "# this is a comment + #another commented line +@@ -8,36 +11,92 @@ module Test_kdump = + #comment after empty line + # + #comment after empty comment +-path /var/crash ++path /var/crash #comment after entry + core_collector makedumpfile -c + default poweroff + raw /dev/sda5 + ext3 /dev/sda3 + net my.server.com:/export/tmp ++nfs my.server.com:/export/tmp + net user@my.server.com ++ssh user@my.server.com + link_delay 60 ++kdump_pre /var/crash/scripts/kdump-pre.sh + kdump_post /var/crash/scripts/kdump-post.sh + #extra_bins /usr/bin/lftp /a/b/c +-extra_bins /usr/bin/lftp /a/b/c ++extra_bins /usr/bin/lftp /a/b/c # comment + disk_timeout 30 + extra_modules gfs2 extra modules more + options babla labl kbak df=dfg + options babla labl kbak df=dfg +-options babla labl kbak df=dfg +-" +- +- let conf2 = "#comment +-kdump_post /var/crash/scripts/kdump-post.sh +-extra_modules gfs2 extra modules more ++options babla labl kbak df=dfg # comment ++sshkey /root/.ssh/kdump_id_rsa ++force_rebuild 1 ++override_resettable 1 ++dracut_args --omit-drivers \"cfg80211 snd\" --add-drivers \"ext2 ext3\" ++fence_kdump_args -p 7410 -f auto ++fence_kdump_nodes 192.168.1.10 10.34.63.155 ++debug_mem_level 3 ++blacklist gfs2 + " + +-(* test Kdump.lns get conf = ?*) +- test Kdump.lns get conf2 = +- { "#comment" = "comment" } +- { "kdump_post" = "/var/crash/scripts/kdump-post.sh" } +- { "extra_modules" +- { "1" = "gfs2" } +- { "2" = "extra" } +- { "3" = "modules" } +- { "4" = "more" } +- } ++ (* Test: Kdump.lns ++ Check whole config file *) ++ test Kdump.lns get conf = ++ { "#comment" = "this is a comment" } ++ { "#comment" = "another commented line" } ++ { } ++ { "#comment" = "comment after empty line" } ++ { } ++ { "#comment" = "comment after empty comment" } ++ { "path" = "/var/crash" ++ { "#comment" = "comment after entry" } } ++ { "core_collector" = "makedumpfile -c" } ++ { "default" = "poweroff" } ++ { "raw" = "/dev/sda5" } ++ { "ext3" = "/dev/sda3" } ++ { "net" = "my.server.com:/export/tmp" } ++ { "nfs" = "my.server.com:/export/tmp" } ++ { "net" = "user@my.server.com" } ++ { "ssh" = "user@my.server.com" } ++ { "link_delay" = "60" } ++ { "kdump_pre" = "/var/crash/scripts/kdump-pre.sh" } ++ { "kdump_post" = "/var/crash/scripts/kdump-post.sh" } ++ { "#comment" = "extra_bins /usr/bin/lftp /a/b/c" } ++ { "extra_bins" ++ { "1" = "/usr/bin/lftp" } ++ { "2" = "/a/b/c" } ++ { "#comment" = "comment" } } ++ { "disk_timeout" = "30" } ++ { "extra_modules" ++ { "1" = "gfs2" } ++ { "2" = "extra" } ++ { "3" = "modules" } ++ { "4" = "more" } } ++ { "options" ++ { "babla" ++ { "labl" } ++ { "kbak" } ++ { "df" = "dfg" } } } ++ { "options" ++ { "babla" ++ { "labl" } ++ { "kbak" } ++ { "df" = "dfg" } } } ++ { "options" ++ { "babla" ++ { "labl" } ++ { "kbak" } ++ { "df" = "dfg" } } ++ { "#comment" = "comment" } } ++ { "sshkey" = "/root/.ssh/kdump_id_rsa" } ++ { "force_rebuild" = "1" } ++ { "override_resettable" = "1" } ++ { "dracut_args" = "--omit-drivers \"cfg80211 snd\" --add-drivers \"ext2 ext3\"" } ++ { "fence_kdump_args" = "-p 7410 -f auto" } ++ { "fence_kdump_nodes" ++ { "1" = "192.168.1.10" } ++ { "2" = "10.34.63.155" } } ++ { "debug_mem_level" = "3" } ++ { "blacklist" ++ { "1" = "gfs2" } } diff --git a/SOURCES/0038-Systemd-parse-semicolons-inside-entry-values-not-as-.patch b/SOURCES/0038-Systemd-parse-semicolons-inside-entry-values-not-as-.patch new file mode 100644 index 0000000..45ce3b2 --- /dev/null +++ b/SOURCES/0038-Systemd-parse-semicolons-inside-entry-values-not-as-.patch @@ -0,0 +1,132 @@ +From b8ea1456a156ffe54b2d8a972b14f89cc8f014eb Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Tue, 9 Sep 2014 11:29:25 +0100 +Subject: [PATCH] Systemd: parse semicolons inside entry values, not as EOL + comments + +Fixes RHBZ#1139498 + +(cherry picked from commit 414f049a8e65d84eb579d1e40dbf75045ed8d3bd) + +Conflicts: + NEWS +--- + lenses/systemd.aug | 24 ++++++++++++++---------- + lenses/tests/test_systemd.aug | 29 +++++++++++++++++++++++++++++ + 2 files changed, 43 insertions(+), 10 deletions(-) + +diff --git a/lenses/systemd.aug b/lenses/systemd.aug +index 370945b..e1d9e5a 100644 +--- a/lenses/systemd.aug ++++ b/lenses/systemd.aug +@@ -29,9 +29,13 @@ autoload xfm + (* View: eol *) + let eol = Util.eol + +-(* View: comment +- An <IniFile.comment> entry *) +-let comment = IniFile.comment IniFile.comment_re "#" ++(* View: eol_comment ++ An <IniFile.comment> entry for standalone comment lines (; or #) *) ++let comment = IniFile.comment IniFile.comment_re "#" ++ ++(* View: eol_comment ++ An <IniFile.comment> entry for end of line comments (# only) *) ++let eol_comment = IniFile.comment "#" "#" + + (* View: sep + An <IniFile.sep> entry *) +@@ -52,7 +56,7 @@ let entry_multi_kw = + in /[A-Za-z][A-Za-z0-9._-]+/ - forbidden + + (* Variable: value_single_re *) +-let value_single_re = /[^;# \t\n\\][^;#\n\\]*[^;# \t\n\\]|[^;# \t\n\\]/ ++let value_single_re = /[^# \t\n\\][^#\n\\]*[^# \t\n\\]|[^# \t\n\\]/ + + (* View: sto_value_single + Support multiline values with a backslash *) +@@ -61,7 +65,7 @@ let sto_value_single = Util.del_opt_ws "" + . (/\\\\\n/ . value_single_re)*) + + (* View: sto_value *) +-let sto_value = store /[^;# \t\n]*[^;# \t\n\\]/ ++let sto_value = store /[^# \t\n]*[^# \t\n\\]/ + + (* Variable: value_sep + Multi-value entries separated by whitespace or backslash and newline *) +@@ -69,7 +73,7 @@ let value_sep = del /[ \t]+|[ \t]*\\\\[ \t]*\n[ \t]*/ " " + + (* Variable: value_cmd_re + Don't parse @ and - prefix flags *) +-let value_cmd_re = /[^;#@ \t\n\\-][^;#@ \t\n\\-][^;# \t\n\\]*/ ++let value_cmd_re = /[^#@ \t\n\\-][^#@ \t\n\\-][^# \t\n\\]*/ + + (* Variable: env_key *) + let env_key = /[A-Za-z0-9_]+(\[[0-9]+\])?/ +@@ -89,7 +93,7 @@ Supported entry features, selected by key names: + (* View: entry_fn + Prototype for our various key=value lines, with optional comment *) + let entry_fn (kw:regexp) (val:lens) = +- [ key kw . sep . val . (comment|eol) ] ++ [ key kw . sep . val . (eol_comment|eol) ] + + (* View: entry_value + Store a value that doesn't contain spaces *) +@@ -127,9 +131,9 @@ let entry_command = + 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 = Quote.do_quote_opt (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 quoted = Quote.do_quote (envkv (store /[^#"'\n]*[ \t]+[^#"'\n]*/)) + in let envkv_quoted = [ bare ] | [ quoted ] + in entry_fn entry_env_kw ( Build.opt_list envkv_quoted value_sep ) + +@@ -145,7 +149,7 @@ let entry = entry_single | entry_multi | entry_command | entry_env | comment + (* View: include + Includes another file at this position *) + let include = [ key ".include" . Util.del_ws_spc . sto_value +- . (comment|eol) ] ++ . (eol_comment|eol) ] + + (* View: title + An <IniFile.title> *) +diff --git a/lenses/tests/test_systemd.aug b/lenses/tests/test_systemd.aug +index b1574e1..82516b3 100644 +--- a/lenses/tests/test_systemd.aug ++++ b/lenses/tests/test_systemd.aug +@@ -307,3 +307,32 @@ test Systemd.entry_command get "ExecStart=/usr/bin/find /var/lib/sudo -exec /usr + { "7" = "\073" } + } + } ++ ++let exec_tmux = "ExecStart=/usr/bin/tmux unbind-key -a; \ ++ kill-window -t anaconda:shell; \ ++ bind-key ? list-keys\n" ++ ++(* Test: Systemd.lns ++ Semicolons are permitted in entry values, e.g. as part of a command *) ++test Systemd.entry_command get exec_tmux = ++ { "ExecStart" ++ { "command" = "/usr/bin/tmux" } ++ { "arguments" ++ { "1" = "unbind-key" } ++ { "2" = "-a;" } ++ { "3" = "kill-window" } ++ { "4" = "-t" } ++ { "5" = "anaconda:shell;" } ++ { "6" = "bind-key" } ++ { "7" = "?" } ++ { "8" = "list-keys" } } } ++ ++(* Test: Systemd.lns ++ # and ; are OK for standalone comments, but # only for EOL comments *) ++test Systemd.lns get "[Service]\n# hash\n; semicolon\nExecStart=/bin/echo # hash\n" = ++ { "Service" ++ { "#comment" = "hash" } ++ { "#comment" = "semicolon" } ++ { "ExecStart" ++ { "command" = "/bin/echo" } ++ { "#comment" = "hash" } } } diff --git a/SOURCES/0039-Systemd-parse-environment-variables-where-only-value.patch b/SOURCES/0039-Systemd-parse-environment-variables-where-only-value.patch new file mode 100644 index 0000000..ca6d9a9 --- /dev/null +++ b/SOURCES/0039-Systemd-parse-environment-variables-where-only-value.patch @@ -0,0 +1,61 @@ +From ae413b03a9c05374ace146d2876d9bc11ad5648f Mon Sep 17 00:00:00 2001 +From: Dominic Cleal <dcleal@redhat.com> +Date: Fri, 5 Sep 2014 08:39:31 +0100 +Subject: [PATCH] Systemd: parse environment variables where only value is + quoted + +Fixes regression introduced in 5226ae7, which added support to parse fully +quoted "NAME=value" environment vars. To support both, this commit stores +the quotes in the value if it's only the value quoted. + +Fixes RHBZ#1138508 + +(cherry picked from commit f64d8bc7a7670f3af2549fdcefb64c2b5f22cd0d) +--- + lenses/systemd.aug | 4 +++- + lenses/tests/test_systemd.aug | 8 ++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/lenses/systemd.aug b/lenses/systemd.aug +index e1d9e5a..ade70d5 100644 +--- a/lenses/systemd.aug ++++ b/lenses/systemd.aug +@@ -132,9 +132,11 @@ 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\\]'/) + (* 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 ] | [ quoted ] ++ in let envkv_quoted = [ bare ] | [ bare_dqval ] | [ bare_sqval ] | [ quoted ] + in entry_fn entry_env_kw ( Build.opt_list envkv_quoted value_sep ) + + +diff --git a/lenses/tests/test_systemd.aug b/lenses/tests/test_systemd.aug +index 82516b3..3397456 100644 +--- a/lenses/tests/test_systemd.aug ++++ b/lenses/tests/test_systemd.aug +@@ -204,6 +204,8 @@ Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETA + Environment=LANG=C\ + FOO=BAR + Environment=\"LANG=foo bar\" FOO=BAR ++Environment=OPTIONS=\"-LS0-6d\" ++Environment=OPTIONS='-LS0-6d' + " + (* Test: Systemd.lns *) + test Systemd.lns get env = +@@ -239,6 +241,12 @@ test Systemd.lns get env = + { "LANG" = "foo bar" } + { "FOO" = "BAR" } + } ++ { "Environment" ++ { "OPTIONS" = "\"-LS0-6d\"" } ++ } ++ { "Environment" ++ { "OPTIONS" = "'-LS0-6d'" } ++ } + } + + (* Variable: unit *) diff --git a/SOURCES/0040-Shellvars-exclude-etc-sysconfig-ip-tables.save-files.patch b/SOURCES/0040-Shellvars-exclude-etc-sysconfig-ip-tables.save-files.patch new file mode 100644 index 0000000..057fa48 --- /dev/null +++ b/SOURCES/0040-Shellvars-exclude-etc-sysconfig-ip-tables.save-files.patch @@ -0,0 +1,46 @@ +From d9ad7205af14dfb7620b9283ad363741695a8cc6 Mon Sep 17 00:00:00 2001 +From: David Lutterkort <lutter@watzmann.net> +Date: Wed, 4 Dec 2013 12:02:57 -0800 +Subject: [PATCH] Shellvars: exclude /etc/sysconfig/ip*tables.save files + +(cherry picked from commit 7830adc726d2da9f3d350aa3a74a7a865f57bd4f) + +Shellvars: fix syntax error in filter + +(cherry picked from commit 69eb611785da41d540b75b37ca92fecd5406d67e) + +Iptables: parse /etc/sysconfig/iptables.save + +Fixes RHBZ#1144651 + +(cherry picked from commit 85904f7b819ac6a604873954138bbf647e98bfec) + +Conflicts: + NEWS +--- + lenses/iptables.aug | 1 + + lenses/shellvars.aug | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/lenses/iptables.aug b/lenses/iptables.aug +index e0f9450..8ad2aef 100644 +--- a/lenses/iptables.aug ++++ b/lenses/iptables.aug +@@ -83,4 +83,5 @@ let table = [ del /\*/ "*" . label "table" . store /[a-z]+/ . eol . + + let lns = (comment|empty|table)* + let xfm = transform lns (incl "/etc/sysconfig/iptables" ++ . incl "/etc/sysconfig/iptables.save" + . incl "/etc/iptables-save") +diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug +index 511b045..11aa2c2 100644 +--- a/lenses/shellvars.aug ++++ b/lenses/shellvars.aug +@@ -189,6 +189,7 @@ module Shellvars = + sc_excl "hw-uuid" . + sc_excl "hwconf" . + sc_excl "ip*tables" . ++ sc_excl "ip*tables.save" . + sc_excl "kernel" . + sc_excl "*.pub" . + sc_excl "sysstat.ioconf" . diff --git a/SOURCES/0041-Add-a-lens-for-etc-shadow-file-format.patch b/SOURCES/0041-Add-a-lens-for-etc-shadow-file-format.patch new file mode 100644 index 0000000..ec8fbf6 --- /dev/null +++ b/SOURCES/0041-Add-a-lens-for-etc-shadow-file-format.patch @@ -0,0 +1,208 @@ +From 864bb50f577b719411ca47bb088e342d8e89f498 Mon Sep 17 00:00:00 2001 +From: "Lorenzo M. Catucci" <lorenzo@sancho.ccd.uniroma2.it> +Date: Sat, 10 May 2014 15:35:15 +0200 +Subject: [PATCH] Add a lens for /etc/shadow file format + +and wire-up its test to the runner's list in Makefile.am + +Also add a mock /etc/shadow in tests/root + +(cherry picked from commit 03f24b24ed13fb1d01717a9247bf8a2cea5f0b71) + +Add a little bit of ducumentation + +for both the shadow and the gshadow lenses + +(cherry picked from commit b6090f1782e6093666f60d60ad7d79fd488cc8d0) + +Conflicts: + lenses/gshadow.aug +--- + doc/naturaldocs/conf/lenses/Menu.txt | 1 + + lenses/shadow.aug | 72 ++++++++++++++++++++++++++++++++++++ + lenses/tests/test_shadow.aug | 45 ++++++++++++++++++++++ + tests/Makefile.am | 1 + + tests/root/etc/shadow | 19 ++++++++++ + 5 files changed, 138 insertions(+) + create mode 100644 lenses/shadow.aug + create mode 100644 lenses/tests/test_shadow.aug + create mode 100644 tests/root/etc/shadow + +diff --git a/doc/naturaldocs/conf/lenses/Menu.txt b/doc/naturaldocs/conf/lenses/Menu.txt +index af0d421..fbbcfed 100644 +--- a/doc/naturaldocs/conf/lenses/Menu.txt ++++ b/doc/naturaldocs/conf/lenses/Menu.txt +@@ -145,6 +145,7 @@ Group: Specific Modules { + File: Rsyslog (rsyslog.aug) + File: Schroot (schroot.aug) + File: Services (services.aug) ++ File: Shadow (shadow.aug) + File: Shells (shells.aug) + File: Shellvars (shellvars.aug) + File: Simplelines (simplelines.aug) +diff --git a/lenses/shadow.aug b/lenses/shadow.aug +new file mode 100644 +index 0000000..dc2ace3 +--- /dev/null ++++ b/lenses/shadow.aug +@@ -0,0 +1,72 @@ ++(* ++ Module: Shadow ++ Parses /etc/shadow ++ ++ Author: Lorenzo M. Catucci <catucci@ccd.uniroma2.it> ++ ++ Original Author: Free Ekanayaka <free@64studio.com> ++ ++ About: Reference ++ ++ - man 5 shadow ++ - man 3 getspnam ++ ++ About: License ++ This file is licensed under the LGPL v2+, like the rest of Augeas. ++ ++ About: ++ ++ Each line in the shadow files represents the additional shadow-defined attributes ++ for the corresponding user, as defined in the passwd file. ++ ++*) ++ ++module Shadow = ++ ++ autoload xfm ++ ++(************************************************************************ ++ * USEFUL PRIMITIVES ++ *************************************************************************) ++ ++let eol = Util.eol ++let comment = Util.comment ++let empty = Util.empty ++let dels = Util.del_str ++ ++let colon = Sep.colon ++ ++let word = Rx.word ++let integer = Rx.integer ++ ++let sto_to_col = Passwd.sto_to_col ++let sto_to_eol = Passwd.sto_to_eol ++ ++(************************************************************************ ++ * Group: ENTRIES ++ *************************************************************************) ++ ++(* View: entry *) ++let entry = [ key word ++ . colon ++ . [ label "password" . sto_to_col? . colon ] ++ . [ label "lastchange_date" . store integer? . colon ] ++ . [ label "minage_days" . store integer? . colon ] ++ . [ label "maxage_days" . store integer? . colon ] ++ . [ label "warn_days" . store integer? . colon ] ++ . [ label "inactive_days" . store integer? . colon ] ++ . [ label "expire_date" . store integer? . colon ] ++ . [ label "flag" . store integer? ] ++ . eol ] ++ ++(************************************************************************ ++ * LENS ++ *************************************************************************) ++ ++let lns = (comment|empty|entry) * ++ ++let filter ++ = incl "/etc/shadow" ++ . Util.stdexcl ++ ++let xfm = transform lns filter +diff --git a/lenses/tests/test_shadow.aug b/lenses/tests/test_shadow.aug +new file mode 100644 +index 0000000..44b5a94 +--- /dev/null ++++ b/lenses/tests/test_shadow.aug +@@ -0,0 +1,45 @@ ++module Test_Shadow = ++ ++let conf = "root:x:0:0:999999:7::: ++libuuid:*:0:0:0:::: ++expired:$6$INVALID:0:0:0:::100: ++locked:!$6$INVALID:0:0:0:::: ++" ++ ++test Shadow.lns get conf = ++ { "root" ++ { "password" = "x" } ++ { "lastchange_date" = "0" } ++ { "minage_days" = "0" } ++ { "maxage_days" = "999999" } ++ { "warn_days" = "7" } ++ { "inactive_days" = "" } ++ { "expire_date" = "" } ++ { "flag" = "" } } ++ { "libuuid" ++ { "password" = "*" } ++ { "lastchange_date" = "0" } ++ { "minage_days" = "0" } ++ { "maxage_days" = "0" } ++ { "warn_days" = "" } ++ { "inactive_days" = "" } ++ { "expire_date" = "" } ++ { "flag" = "" } } ++ { "expired" ++ { "password" = "$6$INVALID" } ++ { "lastchange_date" = "0" } ++ { "minage_days" = "0" } ++ { "maxage_days" = "0" } ++ { "warn_days" = "" } ++ { "inactive_days" = "" } ++ { "expire_date" = "100" } ++ { "flag" = "" } } ++ { "locked" ++ { "password" = "!$6$INVALID" } ++ { "lastchange_date" = "0" } ++ { "minage_days" = "0" } ++ { "maxage_days" = "0" } ++ { "warn_days" = "" } ++ { "inactive_days" = "" } ++ { "expire_date" = "" } ++ { "flag" = "" } } +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 7b06472..9f6b5c1 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -158,6 +158,7 @@ lens_tests = \ + lens-samba.sh \ + lens-securetty.sh \ + lens-services.sh \ ++ lens-shadow.sh \ + lens-shells.sh \ + lens-shellvars.sh \ + lens-shellvars_list.sh \ +diff --git a/tests/root/etc/shadow b/tests/root/etc/shadow +new file mode 100644 +index 0000000..fe6fd3f +--- /dev/null ++++ b/tests/root/etc/shadow +@@ -0,0 +1,19 @@ ++root:$5$rounds=1000$TMTRLLOM$h24vGZsHaf6aNdz3dsUuE4z/fy5at1Luuu.FBI6D6M:16200::999999:7::: ++bin:x:16200::999999:7::: ++daemon:x:16200::999999:7::: ++adm:x:16200::999999:7::: ++lp:x:16200::999999:7::: ++sync:x:16200::999999:7::: ++shutdown:x:16200::999999:7::: ++halt:x:16200::999999:7::: ++mail:x:16200::999999:7::: ++uucp:x:16200::999999:7::: ++operator:x:16200::999999:7::: ++games:x:16200::999999:7::: ++gopher:x:16200::999999:7::: ++ftp:x:16200::999999:7::: ++nobody:x:16200::999999:7::: ++vcsa:x:16200::999999:7::: ++rpc:x:16200::999999:7::: ++rpcuser:x:16200::999999:7::: ++nfsnobody:x:16200::999999:7::: diff --git a/SOURCES/0042-LVM-support-negative-numbers.patch b/SOURCES/0042-LVM-support-negative-numbers.patch new file mode 100644 index 0000000..c9c2438 --- /dev/null +++ b/SOURCES/0042-LVM-support-negative-numbers.patch @@ -0,0 +1,81 @@ +From 685ec9cefc3c745ad1b342ba790d915adf99946a Mon Sep 17 00:00:00 2001 +From: Pino Toscano <ptoscano@redhat.com> +Date: Tue, 26 Aug 2014 17:31:21 +0200 +Subject: [PATCH] LVM: support negative numbers + +Use Rx.relinteger instead of Rx.integer so negative numbers as values +can be read. + +(cherry picked from commit ae8da966f6d29fb3977e6004a98a25774928c946) + +Conflicts: + AUTHORS + NEWS + +LVM: handle also /etc/lvm/lvm.conf + +The syntax should be the same, so use the lvm lens also for the main +lvm2 configuration file. + +(cherry picked from commit 6b15f76f731df1022d1ca8ceec0bced683bccf88) + +Conflicts: + NEWS +--- + AUTHORS | 1 + + lenses/lvm.aug | 3 ++- + lenses/tests/test_lvm.aug | 4 ++++ + 3 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/AUTHORS b/AUTHORS +index 514ad45..36e045e 100644 +--- a/AUTHORS ++++ b/AUTHORS +@@ -93,3 +93,4 @@ Contributions by: + Brian Harrington <bharrington@redhat.com> + Mathieu Alorent <malorent@kumy.net> + Rob Tucker <rtucker@mozilla.com> ++ Pino Toscano <ptoscano@redhat.com> +diff --git a/lenses/lvm.aug b/lenses/lvm.aug +index 1636e9e..40cdc6a 100644 +--- a/lenses/lvm.aug ++++ b/lenses/lvm.aug +@@ -26,7 +26,7 @@ module LVM = + (* strings can contain backslash-escaped dquotes, but I don't know + * how to get the message across to augeas *) + let str = [label "str". Quote.do_dquote (store /([^\"]|\\\\.)*/)] +- let int = [label "int". store Rx.integer] ++ let int = [label "int". store Rx.relinteger] + (* View: flat_literal + * A literal without structure *) + let flat_literal = int|str +@@ -69,6 +69,7 @@ module LVM = + let filter = + incl "/etc/lvm/archive/*.vg" + . incl "/etc/lvm/backup/*" ++ . incl "/etc/lvm/lvm.conf" + . Util.stdexcl + + let xfm = transform lns filter +diff --git a/lenses/tests/test_lvm.aug b/lenses/tests/test_lvm.aug +index 869fbfc..8ee2377 100644 +--- a/lenses/tests/test_lvm.aug ++++ b/lenses/tests/test_lvm.aug +@@ -24,6 +24,7 @@ VG1 { + extent_size = 8192 # 4 Megabytes + max_lv = 0 + max_pv = 0 ++ process_priority = -18 + + physical_volumes { + pv0 { +@@ -150,6 +151,9 @@ test LVM.lns get conf = + { "max_pv" + { "int" = "0" } + } ++ { "process_priority" ++ { "int" = "-18" } ++ } + {} + { "physical_volumes" + { "dict" diff --git a/SOURCES/0043-Device_map-Parse-all-device.map-files-under-boot.patch b/SOURCES/0043-Device_map-Parse-all-device.map-files-under-boot.patch new file mode 100644 index 0000000..f591aec --- /dev/null +++ b/SOURCES/0043-Device_map-Parse-all-device.map-files-under-boot.patch @@ -0,0 +1,37 @@ +From 666ad8a3c7a422ff8a3cde321fb34492cde90a36 Mon Sep 17 00:00:00 2001 +From: Mike Latimer <mlatimer@suse.com> +Date: Mon, 5 May 2014 13:08:14 -0600 +Subject: [PATCH] Device_map: Parse all device.map files under /boot + +(cherry picked from commit 6ee12b6a705cc5da3558847fe4782e2ac30bcc10) + +Conflicts: + AUTHORS + NEWS +--- + AUTHORS | 1 + + lenses/device_map.aug | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/AUTHORS b/AUTHORS +index 36e045e..146c691 100644 +--- a/AUTHORS ++++ b/AUTHORS +@@ -94,3 +94,4 @@ Contributions by: + Mathieu Alorent <malorent@kumy.net> + Rob Tucker <rtucker@mozilla.com> + Pino Toscano <ptoscano@redhat.com> ++ Mike Latimer <mlatimer@suse.com> +diff --git a/lenses/device_map.aug b/lenses/device_map.aug +index cb43206..bd1825d 100644 +--- a/lenses/device_map.aug ++++ b/lenses/device_map.aug +@@ -21,7 +21,7 @@ module Device_map = + + let lns = ( empty | comment | map ) * + +- let xfm = transform lns (incl "/boot/grub/device.map") ++ let xfm = transform lns (incl "/boot/*/device.map") + + (* Local Variables: *) + (* mode: caml *) diff --git a/SOURCES/augeas-1.1.0-cve-2013-6412-umask.patch b/SOURCES/augeas-1.1.0-cve-2013-6412-umask.patch deleted file mode 100644 index 1496bc0..0000000 --- a/SOURCES/augeas-1.1.0-cve-2013-6412-umask.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 0f7c1ef8e06413679928746c7206786210d3df1e Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Mon, 2 Dec 2013 17:49:35 +0000 -Subject: [PATCH] Fix umask handling when creating new files - - * src/transform.c (transform_save): faulty umask arithmetic would cause - overly-open file modes when the umask contains "7", as the umask was - incorrectly subtracted from the target file mode - -Fixes CVE-2013-6412, RHBZ#1034261 - -(cherry picked from commit f5b4fc0ceb0e5a2be5f3a19f63ad936897a3ac26) ---- - src/transform.c | 2 +- - tests/test-save.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 49 insertions(+), 1 deletion(-) - -diff --git a/src/transform.c b/src/transform.c -index ccbe422..b0288fc 100644 ---- a/src/transform.c -+++ b/src/transform.c -@@ -1144,7 +1144,7 @@ int transform_save(struct augeas *aug, struct tree *xfm, - mode_t curumsk = umask(022); - umask(curumsk); - -- if (fchmod(fileno(fp), 0666 - curumsk) < 0) { -+ if (fchmod(fileno(fp), 0666 & ~curumsk) < 0) { - err_status = "create_chmod"; - return -1; - } -diff --git a/tests/test-save.c b/tests/test-save.c -index 617ef31..f28f626 100644 ---- a/tests/test-save.c -+++ b/tests/test-save.c -@@ -26,6 +26,7 @@ - #include "cutest.h" - - #include <stdio.h> -+#include <sys/stat.h> - #include <sys/types.h> - #include <sys/wait.h> - -@@ -51,6 +52,7 @@ static void setup(CuTest *tc) { - if (asprintf(&lensdir, "%s/lenses", abs_top_srcdir) < 0) - CuFail(tc, "asprintf lensdir failed"); - -+ umask(0022); - run(tc, "test -d %s && chmod -R u+w %s || :", root, root); - run(tc, "rm -rf %s", root); - run(tc, "mkdir -p %s", root); -@@ -221,6 +223,49 @@ static void testDoubleSlashPath(CuTest *tc) { - CuAssertIntEquals(tc, 1, r); - } - -+/* Check the umask is followed when creating files -+ */ -+static void testUmask(CuTest *tc, int tumask, mode_t expected_mode) { -+ int r; -+ struct stat buf; -+ char* fpath = NULL; -+ -+ if (asprintf(&fpath, "%s/etc/test", root) < 0) { -+ CuFail(tc, "failed to set root"); -+ } -+ -+ umask(tumask); -+ -+ r = aug_rm(aug, "/augeas/load/*"); -+ CuAssertPositive(tc, r); -+ -+ r = aug_set(aug, "/augeas/load/Test/lens", "Simplelines.lns"); -+ CuAssertRetSuccess(tc, r); -+ r = aug_set(aug, "/augeas/load/Test/incl", "/etc/test"); -+ CuAssertRetSuccess(tc, r); -+ r = aug_load(aug); -+ CuAssertRetSuccess(tc, r); -+ r = aug_set(aug, "/files/etc/test/1", "test"); -+ CuAssertRetSuccess(tc, r); -+ -+ r = aug_save(aug); -+ CuAssertRetSuccess(tc, r); -+ r = aug_match(aug, "/augeas//error", NULL); -+ CuAssertIntEquals(tc, 0, r); -+ -+ CuAssertIntEquals(tc, 0, stat(fpath, &buf)); -+ CuAssertIntEquals(tc, expected_mode, buf.st_mode & 0777); -+} -+static void testUmask077(CuTest *tc) { -+ testUmask(tc, 0077, 0600); -+} -+static void testUmask027(CuTest *tc) { -+ testUmask(tc, 0027, 0640); -+} -+static void testUmask022(CuTest *tc) { -+ testUmask(tc, 0022, 0644); -+} -+ - int main(void) { - char *output = NULL; - CuSuite* suite = CuSuiteNew(); -@@ -245,6 +290,9 @@ int main(void) { - SUITE_ADD_TEST(suite, testMtime); - SUITE_ADD_TEST(suite, testRelPath); - SUITE_ADD_TEST(suite, testDoubleSlashPath); -+ SUITE_ADD_TEST(suite, testUmask077); -+ SUITE_ADD_TEST(suite, testUmask027); -+ SUITE_ADD_TEST(suite, testUmask022); - - CuSuiteRun(suite); - CuSuiteSummary(suite, &output); --- -1.8.4.2 - diff --git a/SOURCES/augeas-1.1.0-dovecot-mailbox.patch b/SOURCES/augeas-1.1.0-dovecot-mailbox.patch deleted file mode 100644 index 136102e..0000000 --- a/SOURCES/augeas-1.1.0-dovecot-mailbox.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 24364f9c9955ea10b094d6892e8c91d6b308ffe2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20Haslgr=C3=BCbler?= <work-michael@haslgruebler.eu> -Date: Wed, 21 Aug 2013 23:19:04 +0200 -Subject: [PATCH 1/3] dovecot enchancement and bug fixes - -* add mailbox to block_names -* fix for block_args in quotes -* fix for block's brackets upon write -* fixes broken tests for mailbox -* fixes indention -* test case for block_args with " -* fixes broken indention - -(cherry picked from commit e6ff9449e5af1759d6b7828ceb118882e955dca4) - -Use Quote module in dovecot - -* use Quote.dquote_spaces for quoting - -(cherry picked from commit 735caf587959019d214a51a7c0cce57da9bb88f6) ---- - lenses/dovecot.aug | 37 +++++++++++++++++++++++++++++++++---- - lenses/tests/test_dovecot.aug | 6 ++++++ - 2 files changed, 39 insertions(+), 4 deletions(-) - -diff --git a/lenses/dovecot.aug b/lenses/dovecot.aug -index 6e5ccc9..e3558d0 100644 ---- a/lenses/dovecot.aug -+++ b/lenses/dovecot.aug -@@ -56,9 +56,6 @@ let value = any . (Rx.space . any)* - (* View: command_start *) - let command_start = Util.del_str "!" - --(* View: block_args --Map block arguments after block name and before "{" *) --let block_args = Sep.space . store /[A-Za-z0-9\/\\_-]+/ - - (****************************************************************** - * Group: ENTRIES -@@ -82,11 +79,43 @@ let entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ] - Map commands started with "!". *) - let command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ] - -+(* -+View: dquote_spaces -+ Make double quotes mandatory if value contains spaces, -+ and optional if value doesn't contain spaces. -+ -+Based off Quote.dquote_spaces -+ -+Parameters: -+ lns1:lens - the lens before -+ lns2:lens - the lens after -+*) -+let dquote_spaces (lns1:lens) (lns2:lens) = -+ (* bare has no spaces, and is optionally quoted *) -+ let bare = Quote.do_dquote_opt (store /[^" \t\n]+/) -+ (* quoted has at least one space, and must be quoted *) -+ in let quoted = Quote.do_dquote (store /[^"\n]*[ \t]+[^"\n]*/) -+ in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ] -+ -+let mailbox = indent -+ . dquote_spaces -+ (key /mailbox/ . Sep.space) -+ (Build.block_newlines (entry) comment . eol) -+ -+let block_ldelim_newlines_re = /[ \t]+\{([ \t\n]*\n)?/ -+ -+let block_newlines (entry:lens) (comment:lens) = -+ let indent = del Rx.opt_space "\t" -+ in del block_ldelim_newlines_re Build.block_ldelim_default -+ . ((entry | comment) . (Util.empty | entry | comment)*)? -+ . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default -+ - (* View: block - Map block enclosed in brackets recursively. - Block may be indented and have optional argument. - Block body may have entries, comments, empty lines, and nested blocks recursively. *) --let rec block = [ indent . key block_names . block_args? . Build.block_newlines (entry|block) comment . eol ] -+let rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store /[\/A-Za-z0-9_-]+/))? . block_newlines (entry|block|mailbox) comment . eol ] -+ - - (****************************************************************** - * Group: LENS AND FILTER -diff --git a/lenses/tests/test_dovecot.aug b/lenses/tests/test_dovecot.aug -index 2201735..33ea16f 100644 ---- a/lenses/tests/test_dovecot.aug -+++ b/lenses/tests/test_dovecot.aug -@@ -465,6 +465,9 @@ namespace { - hidden = no - list = yes - subscriptions = yes -+ mailbox \"Sent Messages\" { -+ special_use = \Sent -+ } - } - - # Example shared namespace configuration -@@ -533,6 +536,9 @@ test Dovecot.lns get mail_conf = - { "hidden" = "no" } - { "list" = "yes" } - { "subscriptions" = "yes" } -+ { "mailbox" = "Sent Messages" -+ { "special_use" = "\Sent" } -+ } - } - { } - { "#comment" = "Example shared namespace configuration" } --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-grub-foreground.patch b/SOURCES/augeas-1.1.0-grub-foreground.patch deleted file mode 100644 index cebb6dc..0000000 --- a/SOURCES/augeas-1.1.0-grub-foreground.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 2556648fdd45887246658579dd576b25e7af874d Mon Sep 17 00:00:00 2001 -From: Miguel Armas <kuko@canarytek.com> -Date: Thu, 30 Jan 2014 09:23:27 +0000 -Subject: [PATCH 3/5] Grub: handle "foreground" option - -Fixes RHBZ#1059383 - -(cherry picked from commit a370d9ccfbd0b6b6f927880014b29569c58b03c0) ---- - lenses/grub.aug | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lenses/grub.aug b/lenses/grub.aug -index 9f8d6af..81fb9d3 100644 ---- a/lenses/grub.aug -+++ b/lenses/grub.aug -@@ -145,6 +145,7 @@ module Grub = - | kw_menu_arg "timeout" - | kw_menu_arg "splashimage" - | kw_menu_arg "gfxmenu" -+ | kw_menu_arg "foreground" - | kw_menu_arg "background" - | serial - | terminal --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-grub-setkey.patch b/SOURCES/augeas-1.1.0-grub-setkey.patch deleted file mode 100644 index 5cc956a..0000000 --- a/SOURCES/augeas-1.1.0-grub-setkey.patch +++ /dev/null @@ -1,160 +0,0 @@ -From bc46ce8269a89a55b87a906226cfe8b54e9e5d11 Mon Sep 17 00:00:00 2001 -From: Matthew Booth <mbooth@redhat.com> -Date: Tue, 27 Aug 2013 15:24:48 +0100 -Subject: [PATCH 1/3] Grub: support the 'setkey' directive - ---- - lenses/grub.aug | 7 +++++++ - lenses/tests/test_grub.aug | 6 ++++++ - 2 files changed, 13 insertions(+) - -diff --git a/lenses/grub.aug b/lenses/grub.aug -index 2c19ffa..d8fd5ed 100644 ---- a/lenses/grub.aug -+++ b/lenses/grub.aug -@@ -132,6 +132,12 @@ module Grub = - |[ spc . switch_arg /timeout|lines/ ])* . - [ spc . key /console|serial|hercules/ ]* . eol ] - -+ (* View: setkey *) -+ let setkey = [ command "setkey" "" . -+ ( spc . [ label "to" . store Rx.no_spaces ] . -+ spc . [ label "from" . store Rx.no_spaces ] )? . -+ eol ] -+ - (* View: menu_setting *) - let menu_setting = kw_menu_arg "default" - | kw_menu_arg "fallback" -@@ -145,6 +151,7 @@ module Grub = - | password_arg - | color - | device -+ | setkey - - (* View: title *) - let title = del /title[ \t=]+/ "title " . value_to_eol . eol -diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug -index 3eba710..e4dc228 100644 ---- a/lenses/tests/test_grub.aug -+++ b/lenses/tests/test_grub.aug -@@ -12,6 +12,8 @@ module Test_grub = - device (hd0) HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4) - password --md5 $1$M9NLj$p2gs87vwNv48BUu.wAfVw0 - default=0 -+setkey -+setkey less backquote - background 103332 - timeout=5 - splashimage=(hd0,0)/grub/splash.xpm.gz -@@ -54,6 +56,10 @@ title othermenu - { "password" = "$1$M9NLj$p2gs87vwNv48BUu.wAfVw0" - { "md5" } } - { "default" = "0" } -+ { "setkey" } -+ { "setkey" -+ { "to" = "less" } -+ { "from" = "backquote" } } - { "background" = "103332" } - { "timeout" = "5" } - { "splashimage" = "(hd0,0)/grub/splash.xpm.gz" } --- -1.8.3.1 - - -From f55175ed0e17a5a4f50a32d9ad5cba5f486eb577 Mon Sep 17 00:00:00 2001 -From: Matthew Booth <mbooth@redhat.com> -Date: Tue, 27 Aug 2013 15:24:49 +0100 -Subject: [PATCH 2/3] Grub: NFC fix whitespace errors introduced by 4e09d15 - -Kill tabs! ---- - lenses/grub.aug | 6 +++--- - lenses/tests/test_grub.aug | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/lenses/grub.aug b/lenses/grub.aug -index d8fd5ed..a64a572 100644 ---- a/lenses/grub.aug -+++ b/lenses/grub.aug -@@ -102,8 +102,8 @@ module Grub = - * This is a shell-only directive in upstream grub; the grub versions - * in at least Fedora/RHEL use this to find devices for UEFI boot *) - let device = -- [ command "device" "" . Sep.space . store /\([A-Za-z0-9_.-]+\)/ . spc . -- [ label "file" . value_to_eol ] . Util.eol ] -+ [ command "device" "" . Sep.space . store /\([A-Za-z0-9_.-]+\)/ . spc . -+ [ label "file" . value_to_eol ] . Util.eol ] - - (* View: color *) - let color = -@@ -150,7 +150,7 @@ module Grub = - | terminal - | password_arg - | color -- | device -+ | device - | setkey - - (* View: title *) -diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug -index e4dc228..87bb243 100644 ---- a/lenses/tests/test_grub.aug -+++ b/lenses/tests/test_grub.aug -@@ -52,7 +52,7 @@ title othermenu - { "#comment" = "initrd /initrd-version.img" } - { "#comment" = "boot=/dev/sda" } - { "device" = "(hd0)" -- { "file" = "HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)" } } -+ { "file" = "HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)" } } - { "password" = "$1$M9NLj$p2gs87vwNv48BUu.wAfVw0" - { "md5" } } - { "default" = "0" } --- -1.8.3.1 - - -From e3f1c15155fba5c10e74b400f2b06c8a31372420 Mon Sep 17 00:00:00 2001 -From: Matthew Booth <mbooth@redhat.com> -Date: Tue, 27 Aug 2013 15:24:50 +0100 -Subject: [PATCH 3/3] Grub: support the 'lock' directive - ---- - lenses/grub.aug | 1 + - lenses/tests/test_grub.aug | 2 ++ - 2 files changed, 3 insertions(+) - -diff --git a/lenses/grub.aug b/lenses/grub.aug -index a64a572..9f8d6af 100644 ---- a/lenses/grub.aug -+++ b/lenses/grub.aug -@@ -216,6 +216,7 @@ module Grub = - | configfile - | module_line - | map_line -+ | kw_pres "lock" - - (* View: boot *) - let boot = -diff --git a/lenses/tests/test_grub.aug b/lenses/tests/test_grub.aug -index 87bb243..de6397d 100644 ---- a/lenses/tests/test_grub.aug -+++ b/lenses/tests/test_grub.aug -@@ -38,6 +38,7 @@ title Fedora (2.6.24.3-34.fc8) - initrd /initrd-2.6.24.3-34.fc8.img - map (hd0) (hd1) - title othermenu -+ lock - configfile /boot/grub/othergrub.conf - " - -@@ -88,6 +89,7 @@ title othermenu - { "initrd" = "/initrd-2.6.24.3-34.fc8.img" } - { "map" { "from" = "(hd0)" } { "to" = "(hd1)" } } } - { "title" = "othermenu" -+ { "lock" } - { "configfile" = "/boot/grub/othergrub.conf" } } - - --- -1.8.3.1 - diff --git a/SOURCES/augeas-1.1.0-incl-double-slash.patch b/SOURCES/augeas-1.1.0-incl-double-slash.patch deleted file mode 100644 index 58c9b54..0000000 --- a/SOURCES/augeas-1.1.0-incl-double-slash.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 361adbf9e520d695ae13efe6084cbcdebe4779e2 Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Tue, 19 Nov 2013 09:39:23 +0000 -Subject: [PATCH] * src/transform.c (filter_matches): wrap fnmatch to ensure - that an incl pattern containing "//" matches file paths - -Fixes RHBZ#1031084 ---- - src/transform.c | 38 ++++++++++++++++++++++++++++++++++---- - tests/test-save.c | 39 +++++++++++++++++++++++++++++++++++++++ - 2 files changed, 73 insertions(+), 4 deletions(-) - -diff --git a/src/transform.c b/src/transform.c -index 1ee8da8..ccbe422 100644 ---- a/src/transform.c -+++ b/src/transform.c -@@ -142,6 +142,33 @@ static char *mtime_as_string(struct augeas *aug, const char *fname) { - return NULL; - } - -+/* fnmatch(3) which will match // in a pattern to a path, like glob(3) does */ -+static int fnmatch_normalize(const char *pattern, const char *string, int flags) { -+ int i, j, r; -+ char *pattern_norm = NULL; -+ -+ r = ALLOC_N(pattern_norm, strlen(pattern) + 1); -+ if (r < 0) -+ goto error; -+ -+ for (i = 0, j = 0; i < strlen(pattern); i++) { -+ if (pattern[i] != '/' || pattern[i+1] != '/') { -+ pattern_norm[j] = pattern[i]; -+ j++; -+ } -+ } -+ pattern_norm[j] = 0; -+ -+ r = fnmatch(pattern_norm, string, flags); -+ FREE(pattern_norm); -+ return r; -+ -+ error: -+ if (pattern_norm != NULL) -+ FREE(pattern_norm); -+ return -1; -+} -+ - static bool file_current(struct augeas *aug, const char *fname, - struct tree *finfo) { - struct tree *mtime = tree_child(finfo, s_mtime); -@@ -217,9 +244,12 @@ static int filter_generate(struct tree *xfm, const char *root, - - if (strchr(e->value, SEP) == NULL) - path = pathbase(path); -- if ((r = fnmatch(e->value, path, fnm_flags)) == 0) { -+ -+ r = fnmatch_normalize(e->value, path, fnm_flags); -+ if (r < 0) -+ goto error; -+ else if (r == 0) - include = false; -- } - } - - if (include) -@@ -254,7 +284,7 @@ static int filter_generate(struct tree *xfm, const char *root, - static int filter_matches(struct tree *xfm, const char *path) { - int found = 0; - list_for_each(f, xfm->children) { -- if (is_incl(f) && fnmatch(f->value, path, fnm_flags) == 0) { -+ if (is_incl(f) && fnmatch_normalize(f->value, path, fnm_flags) == 0) { - found = 1; - break; - } -@@ -262,7 +292,7 @@ static int filter_matches(struct tree *xfm, const char *path) { - if (! found) - return 0; - list_for_each(f, xfm->children) { -- if (is_excl(f) && (fnmatch(f->value, path, fnm_flags) == 0)) -+ if (is_excl(f) && (fnmatch_normalize(f->value, path, fnm_flags) == 0)) - return 0; - } - return 1; -diff --git a/tests/test-save.c b/tests/test-save.c -index 04b86f7..617ef31 100644 ---- a/tests/test-save.c -+++ b/tests/test-save.c -@@ -183,6 +183,44 @@ static void testRelPath(CuTest *tc) { - CuAssertIntEquals(tc, 1, r); - } - -+/* Check that loading and saving a file with // in the incl pattern works. -+ * RHBZ#1031084 -+ */ -+static void testDoubleSlashPath(CuTest *tc) { -+ int r; -+ -+ r = aug_rm(aug, "/augeas/load/*"); -+ CuAssertPositive(tc, r); -+ -+ r = aug_set(aug, "/augeas/load/Hosts/lens", "Hosts.lns"); -+ CuAssertRetSuccess(tc, r); -+ r = aug_set(aug, "/augeas/load/Hosts/incl", "/etc//hosts"); -+ CuAssertRetSuccess(tc, r); -+ r = aug_load(aug); -+ CuAssertRetSuccess(tc, r); -+ -+ r = aug_match(aug, "/files/etc/hosts/1/alias[ . = 'new']", NULL); -+ CuAssertIntEquals(tc, 0, r); -+ -+ r = aug_set(aug, "/files/etc/hosts/1/alias[last() + 1]", "new"); -+ CuAssertRetSuccess(tc, r); -+ -+ r = aug_save(aug); -+ CuAssertRetSuccess(tc, r); -+ r = aug_match(aug, "/augeas//error", NULL); -+ CuAssertIntEquals(tc, 0, r); -+ -+ /* Force reloading the file */ -+ r = aug_rm(aug, "/augeas/files//mtime"); -+ CuAssertPositive(tc, r); -+ -+ r = aug_load(aug); -+ CuAssertRetSuccess(tc, r); -+ -+ r = aug_match(aug, "/files/etc/hosts/1/alias[. = 'new']", NULL); -+ CuAssertIntEquals(tc, 1, r); -+} -+ - int main(void) { - char *output = NULL; - CuSuite* suite = CuSuiteNew(); -@@ -206,6 +244,7 @@ int main(void) { - SUITE_ADD_TEST(suite, testMultipleXfm); - SUITE_ADD_TEST(suite, testMtime); - SUITE_ADD_TEST(suite, testRelPath); -+ SUITE_ADD_TEST(suite, testDoubleSlashPath); - - CuSuiteRun(suite); - CuSuiteSummary(suite, &output); --- -1.8.3.1 - diff --git a/SOURCES/augeas-1.1.0-iproute2-dsfield-hex.patch b/SOURCES/augeas-1.1.0-iproute2-dsfield-hex.patch deleted file mode 100644 index 1cf85e1..0000000 --- a/SOURCES/augeas-1.1.0-iproute2-dsfield-hex.patch +++ /dev/null @@ -1,59 +0,0 @@ -From e27a4f34800d8420a01ee3e7d4182c1d48489182 Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Wed, 12 Feb 2014 09:49:03 +0000 -Subject: [PATCH 1/2] IPRoute2: handle hex IDs and hyphens in names, as present - in rt_dsfield - -Fixes RHBZ#1063961 - -(cherry picked from commit 2686edf4bcc0a2110ef5a2e8c01045ab0081b04e) - -Conflicts: - NEWS ---- - lenses/iproute2.aug | 3 ++- - lenses/tests/test_iproute2.aug | 10 ++++++++++ - 2 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/lenses/iproute2.aug b/lenses/iproute2.aug -index 66b4a2c..6f6b1ba 100644 ---- a/lenses/iproute2.aug -+++ b/lenses/iproute2.aug -@@ -2,7 +2,8 @@ module IPRoute2 = - autoload xfm - - let empty = [ del /[ \t]*#?[ \t]*\n/ "\n" ] -- let record = [ store /[0-9]+/ . del /[ \t]+/ "\t" . key /[a-zA-Z0-9]+/ . Util.comment_or_eol ] -+ let id = Rx.hex | Rx.integer -+ let record = [ store id . del /[ \t]+/ "\t" . key /[a-zA-Z0-9-]+/ . Util.comment_or_eol ] - - let lns = ( empty | Util.comment | record ) * - -diff --git a/lenses/tests/test_iproute2.aug b/lenses/tests/test_iproute2.aug -index cbd7802..cc24efe 100644 ---- a/lenses/tests/test_iproute2.aug -+++ b/lenses/tests/test_iproute2.aug -@@ -19,6 +19,11 @@ let conf = " - 203 adsl3 - 204 adsl4 - 205 wifi0 -+# -+# From rt_dsfield -+# -+0x00 default -+0x80 flash-override - " - - test IPRoute2.lns get conf = -@@ -41,3 +46,8 @@ test IPRoute2.lns get conf = - { "adsl3" = "203" } - { "adsl4" = "204" } - { "wifi0" = "205" } -+ { } -+ { "#comment" = "From rt_dsfield" } -+ { } -+ { "default" = "0x00" } -+ { "flash-override" = "0x80" } --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-iproute2-protos-slash.patch b/SOURCES/augeas-1.1.0-iproute2-protos-slash.patch deleted file mode 100644 index 2756eae..0000000 --- a/SOURCES/augeas-1.1.0-iproute2-protos-slash.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 13a5a36d4da2cb456b338b94025150d8e3847a5f Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Wed, 12 Feb 2014 10:19:21 +0000 -Subject: [PATCH 2/2] IPRoute2: handle "/" in protocol names, swap ID and name - fields - -This is an incompatible change. - -Fixes RHBZ#1063968 - -(cherry picked from commit bd6c783dc05ccf66af02fe24af703737823a99ad) - -Conflicts: - NEWS ---- - lenses/iproute2.aug | 2 +- - lenses/tests/test_iproute2.aug | 34 ++++++++++++++++++++++------------ - 2 files changed, 23 insertions(+), 13 deletions(-) - -diff --git a/lenses/iproute2.aug b/lenses/iproute2.aug -index 6f6b1ba..fa3dcb7 100644 ---- a/lenses/iproute2.aug -+++ b/lenses/iproute2.aug -@@ -3,7 +3,7 @@ module IPRoute2 = - - let empty = [ del /[ \t]*#?[ \t]*\n/ "\n" ] - let id = Rx.hex | Rx.integer -- let record = [ store id . del /[ \t]+/ "\t" . key /[a-zA-Z0-9-]+/ . Util.comment_or_eol ] -+ let record = [ key id . del /[ \t]+/ "\t" . store /[a-zA-Z0-9\/-]+/ . Util.comment_or_eol ] - - let lns = ( empty | Util.comment | record ) * - -diff --git a/lenses/tests/test_iproute2.aug b/lenses/tests/test_iproute2.aug -index cc24efe..2acd367 100644 ---- a/lenses/tests/test_iproute2.aug -+++ b/lenses/tests/test_iproute2.aug -@@ -24,6 +24,11 @@ let conf = " - # - 0x00 default - 0x80 flash-override -+ -+# From rt_protos -+# -+254 gated/aggr -+253 gated/bgp - " - - test IPRoute2.lns get conf = -@@ -32,22 +37,27 @@ test IPRoute2.lns get conf = - { } - { "#comment" = "reserved values" } - { } -- { "local" = "255" } -- { "main" = "254" } -- { "default" = "253" } -- { "unspec" = "0" } -+ { "255" = "local" } -+ { "254" = "main" } -+ { "253" = "default" } -+ { "0" = "unspec" } - { } - { "#comment" = "local" } - { } - { "#comment" = "1 inr.ruhep" } -- { "h3g0" = "200" } -- { "adsl1" = "201" } -- { "adsl2" = "202" } -- { "adsl3" = "203" } -- { "adsl4" = "204" } -- { "wifi0" = "205" } -+ { "200" = "h3g0" } -+ { "201" = "adsl1" } -+ { "202" = "adsl2" } -+ { "203" = "adsl3" } -+ { "204" = "adsl4" } -+ { "205" = "wifi0" } - { } - { "#comment" = "From rt_dsfield" } - { } -- { "default" = "0x00" } -- { "flash-override" = "0x80" } -+ { "0x00" = "default" } -+ { "0x80" = "flash-override" } -+ { } -+ { "#comment" = "From rt_protos" } -+ { } -+ { "254" = "gated/aggr" } -+ { "253" = "gated/bgp" } --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-kdump-new-options.patch b/SOURCES/augeas-1.1.0-kdump-new-options.patch deleted file mode 100644 index d708875..0000000 --- a/SOURCES/augeas-1.1.0-kdump-new-options.patch +++ /dev/null @@ -1,250 +0,0 @@ -From 8cd29c1a058fff13f7da8ba8820642e7a44b57ca Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Tue, 9 Sep 2014 09:12:28 +0100 -Subject: [PATCH] Kdump: parse new options, permit EOL comments, refactor - -Fixes RHBZ#1139298 - -(cherry picked from commit a8d43f617a8238107b71c498136800cb561b6246) - -Conflicts: - NEWS - -Test_Kdump: fix test of complete config file - -(cherry picked from commit 0951590aa50c37f0ea89f71e9509a7ccff587cd2) ---- - doc/naturaldocs/conf/lenses/Menu.txt | 1 + - lenses/kdump.aug | 64 +++++++++++++---------- - lenses/tests/test_kdump.aug | 99 ++++++++++++++++++++++++++++-------- - 3 files changed, 116 insertions(+), 48 deletions(-) - -diff --git a/doc/naturaldocs/conf/lenses/Menu.txt b/doc/naturaldocs/conf/lenses/Menu.txt -index 2a9af26..af0d421 100644 ---- a/doc/naturaldocs/conf/lenses/Menu.txt -+++ b/doc/naturaldocs/conf/lenses/Menu.txt -@@ -208,6 +208,7 @@ Group: Tests and Examples { - File: Test_JettyRealm (tests/test_jettyrealm.aug) - File: Test_JMXAccess (tests/test_jmxaccess.aug) - File: Test_JMXPassword (tests/test_jmxpassword.aug) -+ File: Test_Kdump (tests/test_kdump.aug) - File: Test_Keepalived (tests/test_keepalived.aug) - File: Test_Ldso (tests/test_ldso.aug) - File: Test_Lightdm (tests/test_lightdm.aug) -diff --git a/lenses/kdump.aug b/lenses/kdump.aug -index b8f4055..ddf50ed 100644 ---- a/lenses/kdump.aug -+++ b/lenses/kdump.aug -@@ -17,16 +17,36 @@ About: Configuration files - module Kdump = - autoload xfm - -+(************************************************************************ -+ * Group: USEFUL PRIMITIVES -+ *************************************************************************) -+ - let empty = Util.empty - let comment = Util.comment --let value_to_eol = store Rx.space_in -+let value_to_eol = store /[^ \t\n#][^\n#]*[^ \t\n#]|[^ \t\n#]/ -+let int_to_eol = store Rx.integer - let delimiter = Util.del_ws_spc - let eol = Util.eol --let value_to_spc = store Rx.no_spaces -+let value_to_spc = store Rx.neg1 - let key_to_space = key /[A-Za-z0-9_.\$-]+/ --let eq = Util.del_str "=" -+let eq = Sep.equal -+ -+(************************************************************************ -+ * Group: ENTRY TYPES -+ *************************************************************************) -+ -+let list (kw:string) = counter kw -+ . Build.key_value_line_comment kw delimiter -+ (Build.opt_list [ seq kw . value_to_spc ] delimiter) -+ comment -+ -+let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ] -+let mdl_options = [ key_to_space . mdl_key_value+ ] -+let mod_options = [ key "options" . delimiter . mdl_options . (comment|eol) ] - --let simple_entry (kw:string) = [ key kw . delimiter . value_to_eol . eol ] -+(************************************************************************ -+ * Group: ENTRIES -+ *************************************************************************) - - (* Got from mount(8) *) - let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent" -@@ -37,32 +57,20 @@ let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent" - | "smbfs" | "sysv" | "tmpfs" | "ubifs" | "udf" | "ufs" | "umsdos" - | "usbfs" | "vfat" | "xenix" | "xfs" | "xiafs" - --let fs = [ key fs_types . delimiter . value_to_eol . eol ] -- --let bin = [ seq "bin" . delimiter . value_to_spc ] --let extra_bins = [ key "extra_bins" . (bin)+ . eol ] -- --let mdl = [ seq "module" . delimiter . value_to_spc ] --let extra_modules = [ key "extra_modules" . (mdl)+ . eol ] -+let simple_kws = "raw" | "net" | "path" | "core_collector" | "kdump_post" -+ | "kdump_pre" | "default" | "ssh" | "sshkey" | "dracut_args" -+ | "fence_kdump_args" - -+let int_kws = "force_rebuild" | "override_resettable" | "debug_mem_level" -+ | "link_delay" | "disk_timeout" - --let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ] --let mdl_options = [ key_to_space . mdl_key_value+ ] --let mod_options = [ key "options" . delimiter . mdl_options . eol ] -- -- --let option = simple_entry "raw" -- | simple_entry "net" -- | simple_entry "path" -- | simple_entry "disk_timeout" -- | simple_entry "core_collector" -- | simple_entry "link_delay" -- | simple_entry "kdump_post" -- | simple_entry "kdump_pre" -- | simple_entry "default" -- | fs -- | extra_bins -- | extra_modules -+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 -+ | list "extra_bins" -+ | list "extra_modules" -+ | list "blacklist" -+ | list "fence_kdump_nodes" - | mod_options - - (* View: lns -diff --git a/lenses/tests/test_kdump.aug b/lenses/tests/test_kdump.aug -index 7057782..51c79a3 100644 ---- a/lenses/tests/test_kdump.aug -+++ b/lenses/tests/test_kdump.aug -@@ -1,6 +1,9 @@ --(* Test for kdump lens *) -+(* -+Module: Test_Kdump -+ Provides unit tests and examples for the <Kdump> lens. -+*) - --module Test_kdump = -+module Test_Kdump = - - let conf = "# this is a comment - #another commented line -@@ -8,36 +11,92 @@ module Test_kdump = - #comment after empty line - # - #comment after empty comment --path /var/crash -+path /var/crash #comment after entry - core_collector makedumpfile -c - default poweroff - raw /dev/sda5 - ext3 /dev/sda3 - net my.server.com:/export/tmp -+nfs my.server.com:/export/tmp - net user@my.server.com -+ssh user@my.server.com - link_delay 60 -+kdump_pre /var/crash/scripts/kdump-pre.sh - kdump_post /var/crash/scripts/kdump-post.sh - #extra_bins /usr/bin/lftp /a/b/c --extra_bins /usr/bin/lftp /a/b/c -+extra_bins /usr/bin/lftp /a/b/c # comment - disk_timeout 30 - extra_modules gfs2 extra modules more - options babla labl kbak df=dfg - options babla labl kbak df=dfg --options babla labl kbak df=dfg --" -- -- let conf2 = "#comment --kdump_post /var/crash/scripts/kdump-post.sh --extra_modules gfs2 extra modules more -+options babla labl kbak df=dfg # comment -+sshkey /root/.ssh/kdump_id_rsa -+force_rebuild 1 -+override_resettable 1 -+dracut_args --omit-drivers \"cfg80211 snd\" --add-drivers \"ext2 ext3\" -+fence_kdump_args -p 7410 -f auto -+fence_kdump_nodes 192.168.1.10 10.34.63.155 -+debug_mem_level 3 -+blacklist gfs2 - " - --(* test Kdump.lns get conf = ?*) -- test Kdump.lns get conf2 = -- { "#comment" = "comment" } -- { "kdump_post" = "/var/crash/scripts/kdump-post.sh" } -- { "extra_modules" -- { "1" = "gfs2" } -- { "2" = "extra" } -- { "3" = "modules" } -- { "4" = "more" } -- } -+ (* Test: Kdump.lns -+ Check whole config file *) -+ test Kdump.lns get conf = -+ { "#comment" = "this is a comment" } -+ { "#comment" = "another commented line" } -+ { } -+ { "#comment" = "comment after empty line" } -+ { } -+ { "#comment" = "comment after empty comment" } -+ { "path" = "/var/crash" -+ { "#comment" = "comment after entry" } } -+ { "core_collector" = "makedumpfile -c" } -+ { "default" = "poweroff" } -+ { "raw" = "/dev/sda5" } -+ { "ext3" = "/dev/sda3" } -+ { "net" = "my.server.com:/export/tmp" } -+ { "nfs" = "my.server.com:/export/tmp" } -+ { "net" = "user@my.server.com" } -+ { "ssh" = "user@my.server.com" } -+ { "link_delay" = "60" } -+ { "kdump_pre" = "/var/crash/scripts/kdump-pre.sh" } -+ { "kdump_post" = "/var/crash/scripts/kdump-post.sh" } -+ { "#comment" = "extra_bins /usr/bin/lftp /a/b/c" } -+ { "extra_bins" -+ { "1" = "/usr/bin/lftp" } -+ { "2" = "/a/b/c" } -+ { "#comment" = "comment" } } -+ { "disk_timeout" = "30" } -+ { "extra_modules" -+ { "1" = "gfs2" } -+ { "2" = "extra" } -+ { "3" = "modules" } -+ { "4" = "more" } } -+ { "options" -+ { "babla" -+ { "labl" } -+ { "kbak" } -+ { "df" = "dfg" } } } -+ { "options" -+ { "babla" -+ { "labl" } -+ { "kbak" } -+ { "df" = "dfg" } } } -+ { "options" -+ { "babla" -+ { "labl" } -+ { "kbak" } -+ { "df" = "dfg" } } -+ { "#comment" = "comment" } } -+ { "sshkey" = "/root/.ssh/kdump_id_rsa" } -+ { "force_rebuild" = "1" } -+ { "override_resettable" = "1" } -+ { "dracut_args" = "--omit-drivers \"cfg80211 snd\" --add-drivers \"ext2 ext3\"" } -+ { "fence_kdump_args" = "-p 7410 -f auto" } -+ { "fence_kdump_nodes" -+ { "1" = "192.168.1.10" } -+ { "2" = "10.34.63.155" } } -+ { "debug_mem_level" = "3" } -+ { "blacklist" -+ { "1" = "gfs2" } } diff --git a/SOURCES/augeas-1.1.0-keepalived-virtual-servers.patch b/SOURCES/augeas-1.1.0-keepalived-virtual-servers.patch deleted file mode 100644 index a5d046d..0000000 --- a/SOURCES/augeas-1.1.0-keepalived-virtual-servers.patch +++ /dev/null @@ -1,279 +0,0 @@ -From 6eba1a21df59cc1638a2047f24080ebe657b497e Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Fri, 21 Feb 2014 10:56:57 +0000 -Subject: [PATCH 2/3] Keepalived: add more virtual/real server settings and - checks - -Fixes RHBZ#1064388 - -(cherry picked from commit 1f6ec69ffcd46a5b6937025973a2f2337df2727d) - -Conflicts: - NEWS ---- - lenses/keepalived.aug | 81 +++++++++++++++++++++++-- - lenses/tests/test_keepalived.aug | 128 +++++++++++++++++++++++++++++++++++++++ - 2 files changed, 203 insertions(+), 6 deletions(-) - -diff --git a/lenses/keepalived.aug b/lenses/keepalived.aug -index 1fe3aa2..9fd02ff 100644 ---- a/lenses/keepalived.aug -+++ b/lenses/keepalived.aug -@@ -83,6 +83,10 @@ let field (kw:regexp) (sto:lens) = indent . Build.key_value_line_comment kw sep_ - A single word *) - let flag (kw:regexp) = [ indent . key kw . comment_or_eol ] - -+(* View: ip_port -+ An IP <space> port pair *) -+let ip_port = [ label "ip" . sto_word ] . sep_spc . [ label "port" . sto_num ] -+ - (* View: lens_block - A generic block with a title lens. - The definition is very similar to Build.block_newlines -@@ -220,22 +224,87 @@ let vrrpd_conf = vrrp_sync_group | vrrp_instance | vrrp_script - - - (************************************************************************ -- * Group: LVS CONFIGURATION -+ * Group: REAL SERVER CHECKS CONFIGURATION - *************************************************************************) - - (* View: tcp_check_field *) --let tcp_check_field = field /connect_(timeout|port)/ sto_num -+let tcp_check_field = -+ let word_re = "bindto" -+ in let num_re = /connect_(timeout|port)/ -+ in field word_re sto_word -+ | field num_re sto_num -+ -+(* View: misc_check_field *) -+let misc_check_field = -+ let flag_re = "misc_dynamic" -+ in let num_re = "misc_timeout" -+ in let to_eol_re = "misc_path" -+ in field num_re sto_num -+ | flag flag_re -+ | field to_eol_re sto_to_eol -+ -+(* View: smtp_host_check_field *) -+let smtp_host_check_field = -+ let word_re = "connect_ip" | "bindto" -+ in let num_re = "connect_port" -+ in field word_re sto_word -+ | field num_re sto_num -+ -+(* View: smtp_check_field *) -+let smtp_check_field = -+ let word_re = "connect_ip" | "bindto" -+ in let num_re = "connect_timeout" | "retry" | "delay_before_retry" -+ in let to_eol_re = "helo_name" -+ in field word_re sto_word -+ | field num_re sto_num -+ | field to_eol_re sto_to_eol -+ | block "host" smtp_host_check_field -+ -+(* View: http_url_check_field *) -+let http_url_check_field = -+ let word_re = "digest" -+ in let num_re = "status_code" -+ in let to_eol_re = "path" -+ in field word_re sto_word -+ | field num_re sto_num -+ | field to_eol_re sto_to_eol -+ -+(* View: http_check_field *) -+let http_check_field = -+ let num_re = /connect_(timeout|port)/ | "nb_get_retry" | "delay_before_retry" -+ in field num_re sto_num -+ | block "url" http_url_check_field - - (* View: real_server_field *) --let real_server_field = field "weight" sto_num -- | block "TCP_CHECK" tcp_check_field -+let real_server_field = -+ let num_re = "weight" -+ in let flag_re = "inhibit_on_failure" -+ in let to_eol_re = /notify_(up|down)/ -+ in field num_re sto_num -+ | flag flag_re -+ | field to_eol_re sto_to_eol -+ | block "TCP_CHECK" tcp_check_field -+ | block "MISC_CHECK" misc_check_field -+ | block "SMTP_CHECK" smtp_check_field -+ | block /(HTTP|SSL)_GET/ http_check_field -+ -+(************************************************************************ -+ * Group: LVS CONFIGURATION -+ *************************************************************************) - - (* View: virtual_server_field *) - let virtual_server_field = -- let num_re = "delay_loop" -- in let word_re = /lb_(algo|kind)/ | "nat_mask" | "protocol" -+ let num_re = "delay_loop" | "persistence_timeout" | "quorum" | "hysteresis" -+ in let word_re = /lb_(algo|kind)/ | "nat_mask" | "protocol" | "persistence_granularity" -+ | "virtualhost" -+ in let flag_re = "ops" | "ha_suspend" | "alpha" | "omega" -+ in let to_eol_re = /quorum_(up|down)/ -+ in let ip_port_re = "sorry_server" - in field num_re sto_num - | field word_re sto_word -+ | flag flag_re -+ | field to_eol_re sto_to_eol -+ | field ip_port_re ip_port - | named_block_arg "real_server" "ip" "port" real_server_field - - (* View: virtual_server *) -diff --git a/lenses/tests/test_keepalived.aug b/lenses/tests/test_keepalived.aug -index 615509e..371df25 100644 ---- a/lenses/tests/test_keepalived.aug -+++ b/lenses/tests/test_keepalived.aug -@@ -118,6 +118,8 @@ virtual_server 192.168.1.11 22 { - - protocol TCP - -+ sorry_server 10.20.40.30 22 -+ - ! there can be as many real_server blocks as you need - - real_server 10.20.40.10 22 { -@@ -269,6 +271,10 @@ weight 2 # add 2 points of prio if OK - { } - { "protocol" = "TCP" } - { } -+ { "sorry_server" -+ { "ip" = "10.20.40.30" } -+ { "port" = "22" } } -+ { } - { "#comment" = "there can be as many real_server blocks as you need" } - { } - { "real_server" -@@ -312,3 +318,125 @@ weight 2 # add 2 points of prio if OK - { } - { "#comment" = "that's all" } - -+(* Variable: tcp_check -+ An example of a TCP health checker *) -+let tcp_check = "virtual_server 192.168.1.11 22 { -+ real_server 10.20.40.10 22 { -+ TCP_CHECK { -+ connect_timeout 3 -+ connect_port 22 -+ bindto 192.168.1.1 -+ } -+ } -+} -+" -+test Keepalived.lns get tcp_check = -+ { "virtual_server" -+ { "ip" = "192.168.1.11" } -+ { "port" = "22" } -+ { "real_server" -+ { "ip" = "10.20.40.10" } -+ { "port" = "22" } -+ { "TCP_CHECK" -+ { "connect_timeout" = "3" } -+ { "connect_port" = "22" } -+ { "bindto" = "192.168.1.1" } } } } -+ -+(* Variable: misc_check -+ An example of a MISC health checker *) -+let misc_check = "virtual_server 192.168.1.11 22 { -+ real_server 10.20.40.10 22 { -+ MISC_CHECK { -+ misc_path /usr/local/bin/server_test -+ misc_timeout 3 -+ misc_dynamic -+ } -+ } -+} -+" -+test Keepalived.lns get misc_check = -+ { "virtual_server" -+ { "ip" = "192.168.1.11" } -+ { "port" = "22" } -+ { "real_server" -+ { "ip" = "10.20.40.10" } -+ { "port" = "22" } -+ { "MISC_CHECK" -+ { "misc_path" = "/usr/local/bin/server_test" } -+ { "misc_timeout" = "3" } -+ { "misc_dynamic" } } } } -+ -+(* Variable: smtp_check -+ An example of an SMTP health checker *) -+let smtp_check = "virtual_server 192.168.1.11 22 { -+ real_server 10.20.40.10 22 { -+ SMTP_CHECK { -+ host { -+ connect_ip 10.20.40.11 -+ connect_port 587 -+ bindto 192.168.1.1 -+ } -+ connect_timeout 3 -+ retry 5 -+ delay_before_retry 10 -+ helo_name \"Testing Augeas\" -+ } -+ } -+} -+" -+test Keepalived.lns get smtp_check = -+ { "virtual_server" -+ { "ip" = "192.168.1.11" } -+ { "port" = "22" } -+ { "real_server" -+ { "ip" = "10.20.40.10" } -+ { "port" = "22" } -+ { "SMTP_CHECK" -+ { "host" -+ { "connect_ip" = "10.20.40.11" } -+ { "connect_port" = "587" } -+ { "bindto" = "192.168.1.1" } } -+ { "connect_timeout" = "3" } -+ { "retry" = "5" } -+ { "delay_before_retry" = "10" } -+ { "helo_name" = "\"Testing Augeas\"" } } } } -+ -+(* Variable: http_check -+ An example of an HTTP health checker *) -+let http_check = "virtual_server 192.168.1.11 22 { -+ real_server 10.20.40.10 22 { -+ HTTP_GET { -+ url { -+ path /mrtg2/ -+ digest 9b3a0c85a887a256d6939da88aabd8cd -+ status_code 200 -+ } -+ connect_timeout 3 -+ connect_port 8080 -+ nb_get_retry 5 -+ delay_before_retry 10 -+ } -+ SSL_GET { -+ connect_port 8443 -+ } -+ } -+} -+" -+test Keepalived.lns get http_check = -+ { "virtual_server" -+ { "ip" = "192.168.1.11" } -+ { "port" = "22" } -+ { "real_server" -+ { "ip" = "10.20.40.10" } -+ { "port" = "22" } -+ { "HTTP_GET" -+ { "url" -+ { "path" = "/mrtg2/" } -+ { "digest" = "9b3a0c85a887a256d6939da88aabd8cd" } -+ { "status_code" = "200" } } -+ { "connect_timeout" = "3" } -+ { "connect_port" = "8080" } -+ { "nb_get_retry" = "5" } -+ { "delay_before_retry" = "10" } } -+ { "SSL_GET" -+ { "connect_port" = "8443" } } } } --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-krb5-braces.patch b/SOURCES/augeas-1.1.0-krb5-braces.patch deleted file mode 100644 index 1d54714..0000000 --- a/SOURCES/augeas-1.1.0-krb5-braces.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 1ac63d941a60816799b7c70941fefbafdb4d79de Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Tue, 25 Feb 2014 16:19:51 +0000 -Subject: [PATCH 3/3] Krb5: permit braces in values when not in sub-section - -Fixes RHBZ#1066419 - -(cherry picked from commit d9465ab8e88f91cb5a29eb9f04044876ce45a2d9) - -Conflicts: - NEWS ---- - lenses/krb5.aug | 15 ++++++++------- - lenses/tests/test_krb5.aug | 7 +++++++ - 2 files changed, 15 insertions(+), 7 deletions(-) - -diff --git a/lenses/krb5.aug b/lenses/krb5.aug -index 8d26cfe..8b4ebe4 100644 ---- a/lenses/krb5.aug -+++ b/lenses/krb5.aug -@@ -25,16 +25,17 @@ let realm_re = /[A-Z][.a-zA-Z0-9-]*/ - let app_re = /[a-z][a-zA-Z0-9_]*/ - let name_re = /[.a-zA-Z0-9_-]+/ - --let value = store /[^;# \t\r\n{}]+/ --let entry (kw:regexp) (sep:lens) (comment:lens) -+let value_br = store /[^;# \t\r\n{}]+/ -+let value = store /[^;# \t\r\n]+/ -+let entry (kw:regexp) (sep:lens) (value:lens) (comment:lens) - = [ indent . key kw . sep . value . (comment|eol) ] | comment - - let subsec_entry (kw:regexp) (sep:lens) (comment:lens) -- = ( entry kw sep comment ) | empty -+ = ( entry kw sep value_br comment ) | empty - - let simple_section (n:string) (k:regexp) = - let title = Inifile.indented_title n in -- let entry = entry k eq comment in -+ let entry = entry k eq value comment in - Inifile.record title entry - - let record (t:string) (e:lens) = -@@ -59,7 +60,7 @@ let enctype_list (nr:regexp) (ns:string) = - . (comment|eol) . [ label "#eol" ] - - let libdefaults = -- let option = entry (name_re - ("v4_name_convert" |enctypes)) eq comment in -+ let option = entry (name_re - ("v4_name_convert" |enctypes)) eq value comment in - let enctype_lists = enctype_list /permitted_enctypes/i "permitted_enctypes" - | enctype_list /default_tgs_enctypes/i "default_tgs_enctypes" - | enctype_list /default_tkt_enctypes/i "default_tkt_enctypes" in -@@ -73,7 +74,7 @@ let login = - simple_section "login" keys - - let appdefaults = -- let option = entry (name_re - ("realm" | "application")) eq comment in -+ let option = entry (name_re - ("realm" | "application")) eq value_br comment in - let realm = [ indent . label "realm" . store realm_re . - eq_openbr . (option|empty)* . closebr . eol ] in - let app = [ indent . label "application" . store app_re . -@@ -117,7 +118,7 @@ let logging = - let capaths = - let realm = [ indent . key realm_re . - eq_openbr . -- (entry realm_re eq comment)* . closebr . eol ] in -+ (entry realm_re eq value_br comment)* . closebr . eol ] in - record "capaths" (realm|comment) - - let dbdefaults = -diff --git a/lenses/tests/test_krb5.aug b/lenses/tests/test_krb5.aug -index 0547b65..b0ec6d6 100644 ---- a/lenses/tests/test_krb5.aug -+++ b/lenses/tests/test_krb5.aug -@@ -995,3 +995,10 @@ test Krb5.lns get v4_name_convert = - (* Ticket #288: semicolons for comments *) - test Krb5.lns get "; AD : This Kerberos configuration is for CERN's Active Directory realm.\n" = - { "#comment" = "AD : This Kerberos configuration is for CERN's Active Directory realm." } -+ -+(* RHBZ#1066419: braces in values *) -+test Krb5.lns get "[libdefaults]\n -+default_ccache_name = KEYRING:persistent:%{uid}\n" = -+ { "libdefaults" -+ { } -+ { "default_ccache_name" = "KEYRING:persistent:%{uid}" } } --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-shellvars-case-semicolons.patch b/SOURCES/augeas-1.1.0-shellvars-case-semicolons.patch deleted file mode 100644 index eb87110..0000000 --- a/SOURCES/augeas-1.1.0-shellvars-case-semicolons.patch +++ /dev/null @@ -1,180 +0,0 @@ -From 0cce971fabef13af3a9592ef93a505378f73338a Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Wed, 29 Jan 2014 22:57:02 +0000 -Subject: [PATCH 5/5] Shellvars: handle case statements with same-line ;; - tokens - -Fixes RHBZ#1033799 - -(cherry picked from commit a1b9831d14f22f81cf7dc840160c08cc14234ee9) - -Conflicts: - NEWS - lenses/shellvars.aug ---- - lenses/shellvars.aug | 65 +++++++++++++++++++++++++---------------- - lenses/sysconfig.aug | 6 ++-- - lenses/tests/test_shellvars.aug | 11 +++++++ - 3 files changed, 54 insertions(+), 28 deletions(-) - -diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug -index 4111ee6..eff933a 100644 ---- a/lenses/shellvars.aug -+++ b/lenses/shellvars.aug -@@ -59,40 +59,37 @@ module Shellvars = - | bquot | dbquot | dollar_assign | empty_array) - - let export = [ key "export" . Util.del_ws_spc ] -- let kv = [ Util.indent . export? . key key_re -- . eq . (simple_value | array) . comment_or_eol ] -+ let kv = Util.indent . export? . key key_re -+ . eq . (simple_value | array) - - let var_action (name:string) = -- Util.indent . del name name . Util.del_ws_spc . -- [ label ("@" . name) . counter "var_action" -- . Build.opt_list [ seq "var_action" . store (key_re | matching_re) ] Util.del_ws_spc -- . comment_or_eol ] -+ Util.indent . del name name . Util.del_ws_spc -+ . label ("@" . name) . counter "var_action" -+ . Build.opt_list [ seq "var_action" . store (key_re | matching_re) ] Util.del_ws_spc - - let unset = var_action "unset" - let bare_export = var_action "export" - - let source = -- [ Util.indent -- . del /\.|source/ "." . label ".source" -- . Util.del_ws_spc . store /[^;=# \t\n]+/ . comment_or_eol ] -+ Util.indent -+ . del /\.|source/ "." . label ".source" -+ . Util.del_ws_spc . store /[^;=# \t\n]+/ - - let shell_builtin_cmds = "ulimit" | "shift" | "exit" - - let builtin = -- [ Util.indent . label "@builtin" -- . store shell_builtin_cmds -- . (Util.del_ws_spc -- . [ label "args" . sto_to_semicol ])? -- . comment_or_eol ] -+ Util.indent . label "@builtin" -+ . store shell_builtin_cmds -+ . (Util.del_ws_spc -+ . [ label "args" . sto_to_semicol ])? - - let keyword (kw:string) = Util.indent . Util.del_str kw - let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl - - let return = -- [ Util.indent . label "@return" -- . Util.del_str "return" -- . ( Util.del_ws_spc . store Rx.integer )? -- . comment_or_eol ] -+ Util.indent . label "@return" -+ . Util.del_str "return" -+ . ( Util.del_ws_spc . store Rx.integer )? - - - (************************************************************************ -@@ -128,11 +125,11 @@ module Shellvars = - let loop_select (entry:lens) = - generic_cond "select" "@select" "do" entry+ "done" - -- let case (entry:lens) = -+ let case (entry:lens) (entry_noeol:lens) = - let case_entry = [ label "@case_entry" - . Util.indent . store /[^ \t\n\)]+/ - . Util.del_str ")" . eol -- . entry* -+ . ( entry+ | entry_noeol )? - . Util.indent . Util.del_str ";;" . eol ] in - [ keyword_label "case" "@case" . Sep.space - . store (char+ | ("\"" . char+ . "\"")) -@@ -149,20 +146,38 @@ module Shellvars = - . entry+ - . Util.indent . Util.del_str "}" . eol ] - -+ let entry_eol = -+ let entry_eol_item (item:lens) = -+ [ item . comment_or_eol ] in -+ entry_eol_item source -+ | entry_eol_item kv -+ | entry_eol_item unset -+ | entry_eol_item bare_export -+ | entry_eol_item builtin -+ | entry_eol_item return -+ -+ let entry_noeol = -+ let entry_item (item:lens) = [ item ] in -+ entry_item source -+ | entry_item kv -+ | entry_item unset -+ | entry_item bare_export -+ | entry_item builtin -+ | entry_item return -+ - let rec rec_entry = -- let entry = comment | source | kv -- | unset | bare_export | builtin | return | rec_entry in -+ let entry = comment | entry_eol | rec_entry in - cond_if entry - | loop_for entry - | loop_select entry - | loop_while entry - | loop_until entry -- | case entry -+ | case entry entry_noeol - | function entry - -- let lns_norec = empty* . (comment | source | kv | unset | bare_export | builtin | return) * -+ let lns_norec = empty* . (comment | entry_eol) * - -- let lns = empty* . (comment | source | kv | unset | bare_export | builtin | return | rec_entry) * -+ let lns = empty* . (comment | entry_eol | rec_entry) * - - let sc_incl (n:string) = (incl ("/etc/sysconfig/" . n)) - let sc_excl (n:string) = (excl ("/etc/sysconfig/" . n)) -diff --git a/lenses/sysconfig.aug b/lenses/sysconfig.aug -index ee83af1..8c505b3 100644 ---- a/lenses/sysconfig.aug -+++ b/lenses/sysconfig.aug -@@ -55,10 +55,10 @@ module Sysconfig = - - let var_action = Shellvars.var_action - -- let unset = var_action "unset" -- let bare_export = var_action "export" -+ let unset = [ var_action "unset" . comment_or_eol ] -+ let bare_export = [ var_action "export" . comment_or_eol ] - -- let source = Shellvars.source -+ let source = [ Shellvars.source . comment_or_eol ] - - let lns = empty* . (comment | source | assign | unset | bare_export)* - -diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug -index 79a5a4e..18fd361 100644 ---- a/lenses/tests/test_shellvars.aug -+++ b/lenses/tests/test_shellvars.aug -@@ -446,6 +446,17 @@ esac\n" = - { "1" = "TestVar1" } - { "2" = "TestVar2" } } - -+ (* Support ;; on same line as a case statement entry, RHBZ#1033799 *) -+ test lns get "case $ARG in -+ 0) TestVar=\"test0\" ;; -+ 1) TestVar=\"test1\" ;; -+esac\n" = -+ { "@case" = "$ARG" -+ { "@case_entry" = "0" -+ { "TestVar" = "\"test0\"" } } -+ { "@case_entry" = "1" -+ { "TestVar" = "\"test1\"" } } } -+ - (* Local Variables: *) - (* mode: caml *) - (* End: *) --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-shellvars-firewalld.patch b/SOURCES/augeas-1.1.0-shellvars-firewalld.patch deleted file mode 100644 index 1d75bab..0000000 --- a/SOURCES/augeas-1.1.0-shellvars-firewalld.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 620d73fdec0aa82f2d04d9d3263e036f2bd6d9e2 Mon Sep 17 00:00:00 2001 -From: David Lutterkort <lutter@watzmann.net> -Date: Tue, 27 Aug 2013 10:39:45 -0700 -Subject: [PATCH 2/5] Shellvars: read /etc/firewalld/firewalld.conf - -Fixes https://fedorahosted.org/augeas/ticket/363 - -(cherry picked from commit 63e322699272dd26fc9014c672ea5ce9e4fb21e8) ---- - lenses/shellvars.aug | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug -index da19379..4111ee6 100644 ---- a/lenses/shellvars.aug -+++ b/lenses/shellvars.aug -@@ -205,6 +205,7 @@ module Shellvars = - let filter_misc = incl "/etc/arno-iptables-firewall/debconf.cfg" - . incl "/etc/cron-apt/config" - . incl "/etc/environment" -+ . incl "/etc/firewalld/firewalld.conf" - . incl "/etc/blkid.conf" - . incl "/etc/adduser.conf" - . incl "/etc/cowpoke.conf" --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-shellvars-multi-export.patch b/SOURCES/augeas-1.1.0-shellvars-multi-export.patch deleted file mode 100644 index 7ce0fad..0000000 --- a/SOURCES/augeas-1.1.0-shellvars-multi-export.patch +++ /dev/null @@ -1,132 +0,0 @@ -From c40fc2b24f9f3b104603e3d19ff2b0975b1af9cc Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Thu, 2 Jan 2014 13:50:41 +0000 -Subject: [PATCH] Shellvars, Sysconfig: map "bare" export and unset lines using - seq to handle multiple variables - -Fixes RHBZ#1033795 - -(cherry picked from commit 15ec3753b0ba82e155426288572f6b92c3cafc59) - -Conflicts: - NEWS - lenses/tests/test_shellvars.aug ---- - lenses/shellvars.aug | 6 ++++-- - lenses/tests/test_shellvars.aug | 21 ++++++++++++++++----- - lenses/tests/test_sysconfig.aug | 8 +++++--- - 3 files changed, 25 insertions(+), 10 deletions(-) - -diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug -index a88ad83..da19379 100644 ---- a/lenses/shellvars.aug -+++ b/lenses/shellvars.aug -@@ -63,8 +63,10 @@ module Shellvars = - . eq . (simple_value | array) . comment_or_eol ] - - let var_action (name:string) = -- [ Util.indent . xchgs name ("@" . name) . Util.del_ws_spc -- . store (key_re | matching_re) . comment_or_eol ] -+ Util.indent . del name name . Util.del_ws_spc . -+ [ label ("@" . name) . counter "var_action" -+ . Build.opt_list [ seq "var_action" . store (key_re | matching_re) ] Util.del_ws_spc -+ . comment_or_eol ] - - let unset = var_action "unset" - let bare_export = var_action "export" -diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug -index 9aea433..79a5a4e 100644 ---- a/lenses/tests/test_shellvars.aug -+++ b/lenses/tests/test_shellvars.aug -@@ -30,7 +30,8 @@ unset ONBOOT # We do not want this var - { "#comment" = "DHCP_HOSTNAME=host.example.com" } - { "NETMASK" = "255.255.255.0" } - { "NETWORK" = "172.31.0.0" } -- { "@unset" = "ONBOOT" -+ { "@unset" -+ { "1" = "ONBOOT" } - { "#comment" = "We do not want this var" } } - - test lns put eth_static after -@@ -147,7 +148,8 @@ unset ONBOOT # We do not want this var - - (* Bug 109: allow a bare export *) - test lns get "export FOO\n" = -- { "@export" = "FOO" } -+ { "@export" -+ { "1" = "FOO" } } - - (* Bug 73: allow ulimit builtin *) - test lns get "ulimit -c unlimited\n" = -@@ -259,7 +261,8 @@ esac\n" = - { "@case_entry" = "/tmp/file2" - { ".source" = "/tmp/file2" } } - { "@case_entry" = "*" -- { "@unset" = "f" } } } -+ { "@unset" -+ { "1" = "f" } } } } - - (* Select *) - test lns get "select i in a b c; do . /tmp/file$i -@@ -346,7 +349,8 @@ esac\n" = - { "#comment" = "comment before 2" } - { "@case_entry" = "*" - { "#comment" = "comment in 2" } -- { "@unset" = "f" } } -+ { "@unset" -+ { "1" = "f" } } } - { "#comment" = "comment after" } } - - (* Empty case *) -@@ -397,7 +401,8 @@ esac\n" = - - (* unset can be used on wildcard variables *) - test Shellvars.lns get "unset ${!LC_*}\n" = -- { "@unset" = "${!LC_*}" } -+ { "@unset" -+ { "1" = "${!LC_*}" } } - - (* Empty comment before entries *) - test Shellvars.lns get "# \nfoo=bar\n" = -@@ -435,6 +440,12 @@ esac\n" = - { "#comment" = "foo" } - { "foo" = "bar" } - -+ (* Export of multiple variables, RHBZ#1033795 *) -+ test lns get "export TestVar1 TestVar2\n" = -+ { "@export" -+ { "1" = "TestVar1" } -+ { "2" = "TestVar2" } } -+ - (* Local Variables: *) - (* mode: caml *) - (* End: *) -diff --git a/lenses/tests/test_sysconfig.aug b/lenses/tests/test_sysconfig.aug -index 539ad99..fa1601a 100644 ---- a/lenses/tests/test_sysconfig.aug -+++ b/lenses/tests/test_sysconfig.aug -@@ -30,8 +30,9 @@ unset ONBOOT # We do not want this var - { "#comment" = "DHCP_HOSTNAME=host.example.com" } - { "NETMASK" = "255.255.255.0" } - { "NETWORK" = "172.31.0.0" } -- { "@unset" = "ONBOOT" -- { "#comment" = "We do not want this var" } } -+ { "@unset" -+ { "1" = "ONBOOT" } -+ { "#comment" = "We do not want this var" } } - - test lns put eth_static after - set "BOOTPROTO" "dhcp" ; -@@ -124,7 +125,8 @@ unset ONBOOT # We do not want this var - - (* Bug 109: allow a bare export *) - test lns get "export FOO\n" = -- { "@export" = "FOO" } -+ { "@export" -+ { "1" = "FOO" } } - - (* Check we put quotes in when changes require them *) - test lns put "var=\"v\"\n" after rm "/foo" = --- -1.8.4.2 - diff --git a/SOURCES/augeas-1.1.0-sysconfig-comments.patch b/SOURCES/augeas-1.1.0-sysconfig-comments.patch deleted file mode 100644 index acd63ce..0000000 --- a/SOURCES/augeas-1.1.0-sysconfig-comments.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 92274bd3ff47d3cc4511d934dae06f16b59db7ad Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Mon, 16 Dec 2013 20:45:36 +0000 -Subject: [PATCH] Sysconfig: permit empty comments after comment lines - -Fixes RHBZ#1043636 ---- - lenses/sysconfig.aug | 3 ++- - lenses/tests/test_sysconfig.aug | 4 ++++ - 2 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/lenses/sysconfig.aug b/lenses/sysconfig.aug -index a39d7f3..ee83af1 100644 ---- a/lenses/sysconfig.aug -+++ b/lenses/sysconfig.aug -@@ -11,7 +11,8 @@ module Sysconfig = - let key_re = Shellvars.key_re - let eq = Util.del_str "=" - -- let comment = Util.comment -+ let eol_for_comment = del /([ \t]*\n)([ \t]*(#[ \t]*)?\n)*/ "\n" -+ let comment = Util.comment_generic_seteol /[ \t]*#[ \t]*/ "# " eol_for_comment - let comment_or_eol = Shellvars.comment_or_eol - - let empty = Util.empty -diff --git a/lenses/tests/test_sysconfig.aug b/lenses/tests/test_sysconfig.aug -index 3e9356d..539ad99 100644 ---- a/lenses/tests/test_sysconfig.aug -+++ b/lenses/tests/test_sysconfig.aug -@@ -142,6 +142,10 @@ unset ONBOOT # We do not want this var - test lns put "var=v\n" after set "/var" "v\"w"= - "var='v\"w'\n" - -+ (* RHBZ#1043636: empty comment lines after comments *) -+ test lns get "#MOUNTD_NFS_V3\n#\n" = -+ { "#comment" = "MOUNTD_NFS_V3" } -+ - (* Local Variables: *) - (* mode: caml *) - (* End: *) --- -1.8.4.2 - diff --git a/SOURCES/augeas-1.1.0-testPermsErrorReported-root.patch b/SOURCES/augeas-1.1.0-testPermsErrorReported-root.patch deleted file mode 100644 index 97f65a7..0000000 --- a/SOURCES/augeas-1.1.0-testPermsErrorReported-root.patch +++ /dev/null @@ -1,38 +0,0 @@ -From b0fa354ecada84f7a4fdf586c08ae99ca2dd9a65 Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Mon, 2 Sep 2013 18:29:49 +0100 -Subject: [PATCH] * tests/test-load.c (testPermsErrorReported): skip - permissions test when root - ---- - tests/test-load.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/tests/test-load.c b/tests/test-load.c -index ef6c01a..fb63a62 100644 ---- a/tests/test-load.c -+++ b/tests/test-load.c -@@ -21,6 +21,8 @@ - */ - - #include <config.h> -+#include <sys/types.h> -+#include <unistd.h> - - #include "augeas.h" - -@@ -529,6 +531,11 @@ static void testParseErrorReported(CuTest *tc) { - - /* Test failed file opening is reported, e.g. EACCES */ - static void testPermsErrorReported(CuTest *tc) { -+ if (getuid() == 0) { -+ puts("pending (testPermsErrorReported): can't test permissions under root account"); -+ return; -+ } -+ - augeas *aug = NULL; - int r; - const char *s; --- -1.8.4.2 - diff --git a/SOURCES/augeas-1.1.0-yum-cron.patch b/SOURCES/augeas-1.1.0-yum-cron.patch deleted file mode 100644 index 4bd183e..0000000 --- a/SOURCES/augeas-1.1.0-yum-cron.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f1cad0ba3df9d8231cc0651302c7b638d6fdfcb7 Mon Sep 17 00:00:00 2001 -From: Pat Riehecky <prieheck@iwu.edu> -Date: Tue, 27 Aug 2013 20:03:31 +0100 -Subject: [PATCH 1/5] Yum: add yum-cron*.conf files - -(cherry picked from commit 148330ac79660e35b8726c7ec6fc8b6916c8a23e) ---- - lenses/yum.aug | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lenses/yum.aug b/lenses/yum.aug -index 31d4776..585695f 100644 ---- a/lenses/yum.aug -+++ b/lenses/yum.aug -@@ -50,6 +50,7 @@ let lns = (empty | comment)* . record* - - let filter = (incl "/etc/yum.conf") - . (incl "/etc/yum.repos.d/*") -+ . (incl "/etc/yum/yum-cron*.conf") - . (incl "/etc/yum/pluginconf.d/*") - . (excl "/etc/yum/pluginconf.d/versionlock.list") - . Util.stdexcl --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-yum-equals-space.patch b/SOURCES/augeas-1.1.0-yum-equals-space.patch deleted file mode 100644 index 52a2045..0000000 --- a/SOURCES/augeas-1.1.0-yum-equals-space.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 897c3c97b6d70bc739eb58cee2c5430c9619ce56 Mon Sep 17 00:00:00 2001 -From: Dominic Cleal <dcleal@redhat.com> -Date: Sat, 9 Nov 2013 12:33:00 +0000 -Subject: [PATCH 4/5] Yum: permit spaces after equals sign in list options - -Fixes GitHub issue #45 - -(cherry picked from commit deb73b5f284db09e3c63f2d7698ab140e2337a3d) ---- - lenses/tests/test_yum.aug | 10 ++++++++++ - lenses/yum.aug | 2 +- - 2 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/lenses/tests/test_yum.aug b/lenses/tests/test_yum.aug -index 660a46c..17d4ea2 100644 ---- a/lenses/tests/test_yum.aug -+++ b/lenses/tests/test_yum.aug -@@ -201,6 +201,16 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi - Check that we can parse an empty line, to fix test-save *) - test Yum.lns get "\n" = { } - -+ (* Test: Yum.lns -+ Issue #45: allow spaces around equals sign *) -+ test Yum.lns get "[rpmforge] -+name = RHEL $releasever - RPMforge.net - dag -+baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge\n" = -+ { "rpmforge" -+ { "name" = "RHEL $releasever - RPMforge.net - dag" } -+ { "baseurl" = "http://apt.sw.be/redhat/el6/en/$basearch/rpmforge" } -+ } -+ - (* Local Variables: *) - (* mode: caml *) - (* End: *) -diff --git a/lenses/yum.aug b/lenses/yum.aug -index 585695f..1b13833 100644 ---- a/lenses/yum.aug -+++ b/lenses/yum.aug -@@ -19,7 +19,7 @@ let eol = IniFile.eol - let list_entry (list_key:string) = - let list_value = store /[^# \t\r\n,][^ \t\r\n,]*[^# \t\r\n,]|[^# \t\r\n,]/ in - let list_sep = del /([ \t]*(,[ \t]*|\r?\n[ \t]+))|[ \t]+/ "\n\t" in -- [ key list_key . sep . list_value ] -+ [ key list_key . sep . Sep.opt_space . list_value ] - . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)? - . eol - --- -1.8.5.3 - diff --git a/SOURCES/augeas-1.1.0-yum-exclude.patch b/SOURCES/augeas-1.1.0-yum-exclude.patch deleted file mode 100644 index 89c94b7..0000000 --- a/SOURCES/augeas-1.1.0-yum-exclude.patch +++ /dev/null @@ -1,231 +0,0 @@ -From 50792ee989e81b52ed886be967843d85433f0ce5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= <raphael.pinson@camptocamp.com> -Date: Tue, 3 Dec 2013 10:11:38 +0100 -Subject: [PATCH] Yum.lns: simplify code for combinatory logic of list_entry - elements - -(cherry picked from commit 9c645afbde88a2bdb5f8b139fde44968b019234c) - -Build: Add combinatorics group - -(cherry picked from commit 3f57641d8df3ed1edf89cd7641c4c6e84c3a3429) - -Yum.lns: split excludes as lists (ticket #275) - -(cherry picked from commit c16ccfd64045cb5f9c8793bc7589fc80fc027064) ---- - lenses/build.aug | 57 +++++++++++++++++++++++++++++++++++ - lenses/tests/test_build.aug | 73 +++++++++++++++++++++++++++++++++++++++++++++ - lenses/tests/test_yum.aug | 11 +++++++ - lenses/yum.aug | 16 +++++----- - 4 files changed, 149 insertions(+), 8 deletions(-) - -diff --git a/lenses/build.aug b/lenses/build.aug -index 2e57356..efc8814 100644 ---- a/lenses/build.aug -+++ b/lenses/build.aug -@@ -298,3 +298,60 @@ let block_newlines (entry:lens) (comment:lens) = - ************************************************************************) - let named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ] - -+ -+(************************************************************************ -+ * Group: COMBINATORICS -+ ************************************************************************) -+ -+(************************************************************************ -+ * View: combine_two_opt_ord -+ * Combine two lenses optionally, ensuring first lens is first -+ * (a, and optionally b) -+ * -+ * Parameters: -+ * a:lens - the first lens -+ * b:lens - the second lens -+ ************************************************************************) -+let combine_two_opt_ord (a:lens) (b:lens) = a . b? -+ -+(************************************************************************ -+ * View: combine_two_opt -+ * Combine two lenses optionally -+ * (either a, b, or both, in any order) -+ * -+ * Parameters: -+ * a:lens - the first lens -+ * b:lens - the second lens -+ ************************************************************************) -+let combine_two_opt (a:lens) (b:lens) = -+ combine_two_opt_ord a b | combine_two_opt_ord b a -+ -+ -+(************************************************************************ -+ * View: combine_three_opt_ord -+ * Combine three lenses optionally, ensuring first lens is first -+ * (a followed by either b, c, or any of them, in any order) -+ * -+ * Parameters: -+ * a:lens - the first lens -+ * b:lens - the second lens -+ * c:lens - the third lens -+ ************************************************************************) -+let combine_three_opt_ord (a:lens) (b:lens) (c:lens) = -+ combine_two_opt_ord a (combine_two_opt b c) -+ -+(************************************************************************ -+ * View: combine_three_opt -+ * Combine three lenses optionally -+ * (either a, b, c, or any of them, in any order) -+ * -+ * Parameters: -+ * a:lens - the first lens -+ * b:lens - the second lens -+ * c:lens - the third lens -+ ************************************************************************) -+let combine_three_opt (a:lens) (b:lens) (c:lens) = -+ combine_three_opt_ord a b c -+ | combine_three_opt_ord b a c -+ | combine_three_opt_ord c b a -+ -diff --git a/lenses/tests/test_build.aug b/lenses/tests/test_build.aug -index b9b09fa..bc565f3 100644 ---- a/lenses/tests/test_build.aug -+++ b/lenses/tests/test_build.aug -@@ -174,3 +174,76 @@ test logrotate_block get "/var/log/wtmp\n/var/log/wtmp2\n{ - { "monthly" } - } - -+ -+(************************************************************************ -+ * Group: COMBINATORICS -+ ************************************************************************) -+ -+(* View: combine_two_opt -+ A minimalistic optional combination lens *) -+let combine_two_opt = -+ let entry (k:string) = [ key k ] -+ in Build.combine_two_opt (entry "a") (entry "b") -+ -+(* Test: combine_two_opt -+ Should parse ab *) -+test combine_two_opt get "ab" = { "a" } { "b" } -+ -+(* Test: combine_two_opt -+ Should parse ba *) -+test combine_two_opt get "ba" = { "b" } { "a" } -+ -+(* Test: combine_two_opt -+ Should parse a *) -+test combine_two_opt get "a" = { "a" } -+ -+(* Test: combine_two_opt -+ Should parse b *) -+test combine_two_opt get "b" = { "b" } -+ -+(* Test: combine_two_opt -+ Should not parse aa *) -+test combine_two_opt get "aa" = * -+ -+(* Test: combine_two_opt -+ Should not parse bb *) -+test combine_two_opt get "bb" = * -+ -+ -+(* View: combine_three_opt -+ A minimalistic optional combination lens *) -+let combine_three_opt = -+ let entry (k:string) = [ key k ] -+ in Build.combine_three_opt (entry "a") (entry "b") (entry "c") -+ -+(* Test: combine_three_opt -+ Should parse ab *) -+test combine_three_opt get "ab" = { "a" } { "b" } -+ -+(* Test: combine_three_opt -+ Should parse ba *) -+test combine_three_opt get "ba" = { "b" } { "a" } -+ -+(* Test: combine_three_opt -+ Should parse a *) -+test combine_three_opt get "a" = { "a" } -+ -+(* Test: combine_three_opt -+ Should parse b *) -+test combine_three_opt get "b" = { "b" } -+ -+(* Test: combine_three_opt -+ Should not parse aa *) -+test combine_three_opt get "aa" = * -+ -+(* Test: combine_three_opt -+ Should not parse bbc *) -+test combine_three_opt get "bbc" = * -+ -+(* Test: combine_three_opt -+ Should parse abc *) -+test combine_three_opt get "abc" = { "a" } { "b" } { "c" } -+ -+(* Test: combine_three_opt -+ Should parse cab *) -+test combine_three_opt get "cab" = { "c" } { "a" } { "b" } -diff --git a/lenses/tests/test_yum.aug b/lenses/tests/test_yum.aug -index 17d4ea2..2688182 100644 ---- a/lenses/tests/test_yum.aug -+++ b/lenses/tests/test_yum.aug -@@ -211,6 +211,17 @@ baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge\n" = - { "baseurl" = "http://apt.sw.be/redhat/el6/en/$basearch/rpmforge" } - } - -+ (* Test: Yum.lns -+ Issue #275: parse excludes as a list *) -+ test Yum.lns get "[epel] -+name=Extra Packages for Enterprise Linux 6 - $basearch -+exclude=ocs* clamav* -+" = -+ { "epel" -+ { "name" = "Extra Packages for Enterprise Linux 6 - $basearch" } -+ { "exclude" = "ocs*" } -+ { "exclude" = "clamav*" } } -+ - (* Local Variables: *) - (* mode: caml *) - (* End: *) -diff --git a/lenses/yum.aug b/lenses/yum.aug -index 1b13833..030d944 100644 ---- a/lenses/yum.aug -+++ b/lenses/yum.aug -@@ -11,7 +11,6 @@ let sep = IniFile.sep "=" "=" - let empty = Util.empty - let eol = IniFile.eol - -- - (************************************************************************ - * ENTRY - *************************************************************************) -@@ -23,17 +22,18 @@ let list_entry (list_key:string) = - . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)? - . eol - --let entry_re = IniFile.entry_re - ("baseurl" | "gpgkey") -+let entry_re = IniFile.entry_re - ("baseurl" | "gpgkey" | "exclude") - - let entry = IniFile.entry entry_re sep comment - | empty - --let entries = entry* -- | entry* . list_entry "baseurl" . entry* -- | entry* . list_entry "gpgkey" . entry* -- | entry* . list_entry "baseurl" . entry* . list_entry "gpgkey" . entry* -- | entry* . list_entry "gpgkey" . entry* . list_entry "baseurl" . entry* -- -+let entries = -+ let list_entry_elem (k:string) = list_entry k . entry* -+ in entry* -+ | entry* . Build.combine_three_opt -+ (list_entry_elem "baseurl") -+ (list_entry_elem "gpgkey") -+ (list_entry_elem "exclude") - - - (***********************************************************************a --- -1.8.5.3 - diff --git a/SPECS/augeas.spec b/SPECS/augeas.spec index 8dc7fec..99385f6 100644 --- a/SPECS/augeas.spec +++ b/SPECS/augeas.spec @@ -1,66 +1,55 @@ Name: augeas Version: 1.1.0 -Release: 12%{?dist}.1 +Release: 17%{?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 - -# RHBZ#1019485: Grub module setkey/lock support -Patch1: augeas-1.1.0-grub-setkey.patch - -# RHBZ#1031084: transform.c, save files with // in incl path -Patch2: augeas-1.1.0-incl-double-slash.patch - -# RHBZ#1043665: Sysconfig module empty comment support -Patch3: augeas-1.1.0-sysconfig-comments.patch - -# RHBZ#1043666: testPermsErrorReported, fix when running as root -Patch4: augeas-1.1.0-testPermsErrorReported-root.patch - -# RHBZ#1043815: Shellvars module multivariable exports -Patch5: augeas-1.1.0-shellvars-multi-export.patch - -# RHBZ#1036081: CVE-2013-6412, fix strict umask handling, f5b4fc0c -Patch6: augeas-1.1.0-cve-2013-6412-umask.patch - -# RHBZ#1058409: Yum module, yum-cron incl entry -Patch7: augeas-1.1.0-yum-cron.patch - -# RHBZ#1058411: Shellvars, firewalld.conf incl entry -Patch8: augeas-1.1.0-shellvars-firewalld.patch - -# RHBZ#1059426: Grub module foreground option -Patch9: augeas-1.1.0-grub-foreground.patch - -# RHBZ#1062614: Yum module, spaces around equals -Patch10: augeas-1.1.0-yum-equals-space.patch - -# RHBZ#1056541: Shellvars module, case and same-line ;; -Patch11: augeas-1.1.0-shellvars-case-semicolons.patch - -# RHBZ#1063961: IPRoute2 module, hex IDs and hyphens in protocols -Patch12: augeas-1.1.0-iproute2-dsfield-hex.patch - -# RHBZ#1063968: IPRoute2 module, slash in protocols -Patch13: augeas-1.1.0-iproute2-protos-slash.patch - -# RHBZ#1067039: Yum module, slash in protocols -Patch14: augeas-1.1.0-yum-exclude.patch - -# RHBZ#1064387: Dovecot module, mailbox and quote support -Patch15: augeas-1.1.0-dovecot-mailbox.patch - -# RHBZ#1064388: Keepalived module, virtual server fixes -Patch16: augeas-1.1.0-keepalived-virtual-servers.patch - -# RHBZ#1066419: Krb5 module, parse braces in values -Patch17: augeas-1.1.0-krb5-braces.patch - -# RHBZ#1181280: Kdump module, new options and EOL comments -Patch18: augeas-1.1.0-kdump-new-options.patch +Patch1: 0001-Grub-support-the-setkey-directive.patch +Patch2: 0002-src-transform.c-filter_matches-wrap-fnmatch-to-ensur.patch +Patch3: 0003-Sysconfig-permit-empty-comments-after-comment-lines.patch +Patch4: 0004-tests-test-load.c-testPermsErrorReported-skip-permis.patch +Patch5: 0005-Shellvars-Sysconfig-map-bare-export-and-unset-lines-.patch +Patch6: 0006-Fix-umask-handling-when-creating-new-files.patch +Patch7: 0007-Yum-add-yum-cron-.conf-files.patch +Patch8: 0008-Shellvars-read-etc-firewalld-firewalld.conf.patch +Patch9: 0009-Grub-handle-foreground-option.patch +Patch10: 0010-Yum-permit-spaces-after-equals-sign-in-list-options.patch +Patch11: 0011-Shellvars-handle-case-statements-with-same-line-toke.patch +Patch12: 0012-IPRoute2-handle-hex-IDs-and-hyphens-in-names-as-pres.patch +Patch13: 0013-IPRoute2-handle-in-protocol-names-swap-ID-and-name-f.patch +Patch14: 0014-Yum.lns-simplify-code-for-combinatory-logic-of-list_.patch +Patch15: 0015-dovecot-enchancement-and-bug-fixes.patch +Patch16: 0016-Keepalived-add-more-virtual-real-server-settings-and.patch +Patch17: 0017-Krb5-permit-braces-in-values-when-not-in-sub-section.patch +Patch18: 0018-Exports-permit-colons-for-IPv6-client-addresses.patch +Patch19: 0019-Added-chrony-lense.patch +Patch20: 0020-Fixes-27-Automounter-lens-does-not-handle-hostnames-.patch +Patch21: 0021-Systemd-parse-etc-sysconfig-.systemd-as-used-in-389-.patch +Patch22: 0022-src-augeas.c-unlink_removed_files-ensure-aug_save-re.patch +Patch23: 0023-src-augtool.c-add-command-aliases-to-autocomplete.patch +Patch24: 0024-man-augtool.pod-update-man-page-with-new-commands.patch +Patch25: 0025-src-augrun.c-remove-unused-filename-argument-from-du.patch +Patch26: 0026-Systemd-allow-quoted-Environment-key-value-pairs.patch +Patch27: 0027-Rmt-new-lens-to-parse-etc-default-rmt.patch +Patch28: 0028-Shellvars-support-.-arithmetic-expansion-in-variable.patch +Patch29: 0029-Allow-continued-lines-inside-quoted-value-GH-issue-1.patch +Patch30: 0030-Fix-NagiosCfg-lense-so-etc-nagios-nrpe.cfg-is-parsed.patch +Patch31: 0031-Ldso-handle-hwcap-lines.patch +Patch32: 0032-Add-other-valid-controllers-to-cgconfig-lens.patch +Patch33: 0033-Services-permit-colons-in-service-name.patch +Patch34: 0034-Fix-Trac-364.-Syslog-lense-accept-UDP-and-TCP-protoc.patch +Patch35: 0035-Syslog-permit-IPv6-loghost-addresses.patch +Patch36: 0036-Rsyslog-parse-property-filters-and-file-actions-with.patch +Patch37: 0037-Kdump-parse-new-options-permit-EOL-comments-refactor.patch +Patch38: 0038-Systemd-parse-semicolons-inside-entry-values-not-as-.patch +Patch39: 0039-Systemd-parse-environment-variables-where-only-value.patch +Patch40: 0040-Shellvars-exclude-etc-sysconfig-ip-tables.save-files.patch +Patch41: 0041-Add-a-lens-for-etc-shadow-file-format.patch +Patch42: 0042-LVM-support-negative-numbers.patch +Patch43: 0043-Device_map-Parse-all-device.map-files-under-boot.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -116,6 +105,31 @@ The libraries for %{name}. %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 %build %configure --disable-static @@ -176,8 +190,42 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/augeas.pc %changelog -* Tue Jan 13 2015 Dominic Cleal <dcleal@redhat.com> - 1.1.0-12.1 -- Kdump: parse new options, EOL comments (RHBZ#1181280) +* Thu Nov 27 2014 Dominic Cleal <dcleal@redhat.com> - 1.1.0-17 +- Device_map: parse all device.map files under /boot (RHBZ#1166582) + +* Tue Sep 23 2014 Dominic Cleal <dcleal@redhat.com> - 1.1.0-16 +- Iptables: parse /etc/sysconfig/iptables.save (RHBZ#1144651) +- Lvm: parse /etc/lvm/lvm.conf (RHBZ#1145495) +- Shadow: add lens (RHBZ#1145249) + +* Thu Sep 18 2014 Dominic Cleal <dcleal@redhat.com> - 1.1.0-15 +- Remove man/augtool.1 patches, always create .1 during build (RHBZ#1143954) + +* Thu Sep 18 2014 Dominic Cleal <dcleal@redhat.com> - 1.1.0-14 +- Kdump: parse new options, EOL comments (RHBZ#1139298) +- Rsyslog: parse property filters and templates (RHBZ#1138402) +- Systemd: parse semicolons inside entry values (RHBZ#1139498) +- Systemd: parse environment variables where value is quoted (RHBZ#1138508) + +* Thu Sep 04 2014 Dominic Cleal <dcleal@redhat.com> - 1.1.0-13 +- aug_save: return error when unlink fails (RHBZ#1091143) +- augtool: add aliases to autocomplete (RHBZ#1100076) +- augtool: remove unused dump-xml arg (RHBZ#1100106) +- Automounter: parse hostnames with hyphens (RHBZ#1075162) +- Cgconfig: parse other valid controllers (RHBZ#1112543) +- Chrony: add lens (RHBZ#1071947) +- docs: update man page with new commands (RHBZ#1100077) +- Exports: permit colons for IPv6 client addresses (RHBZ#1067030) +- Httpd: parse continued, quoted lines (RHBZ#1100551) +- Ldso: parse hwcap lines (RHBZ#1102629) +- NagiosCfg: parse nrpe.cfg with Nrpe (RHBZ#1102623) +- Rmt: add lens (RHBZ#1100549) +- Services: permit colons in service name (RHBZ#1121527) +- Shellvars: support arithmetic expansion (RHBZ#1100550) +- Syslog: parse TCP loghosts (RHBZ#1129386) +- Syslog: parse IPv6 loghost addresses (RHBZ#1129388) +- Systemd: parse /etc/sysconfig/*.systemd (RHBZ#1083022) +- Systemd: parse quoted environment vars (RHBZ#1100547) * Tue Feb 25 2014 Dominic Cleal <dcleal@redhat.com> - 1.1.0-12 - Add patch for Dovecot, mailbox and quote support (RHBZ#1064387)