diff -Nru augeas-1.3.0/aclocal.m4 augeas-1.4.0/aclocal.m4 --- augeas-1.3.0/aclocal.m4 2014-11-07 22:31:54.000000000 +0000 +++ augeas-1.4.0/aclocal.m4 2015-06-02 00:23:19.000000000 +0000 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -247,10 +247,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.4], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -266,7 +266,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.4])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -633,6 +633,12 @@ # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -741,7 +747,48 @@ AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -749,7 +796,6 @@ m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -960,6 +1006,70 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. diff -Nru augeas-1.3.0/augeas.spec augeas-1.4.0/augeas.spec --- augeas-1.3.0/augeas.spec 2014-11-07 22:32:14.000000000 +0000 +++ augeas-1.4.0/augeas.spec 2015-06-02 00:23:35.000000000 +0000 @@ -1,5 +1,5 @@ Name: augeas -Version: 1.3.0 +Version: 1.4.0 Release: 1%{?dist} Summary: A library for changing configuration files diff -Nru augeas-1.3.0/AUTHORS augeas-1.4.0/AUTHORS --- augeas-1.3.0/AUTHORS 2014-10-17 16:41:03.000000000 +0000 +++ augeas-1.4.0/AUTHORS 2015-06-02 00:23:11.000000000 +0000 @@ -24,7 +24,9 @@ Oliver Beattie Tim Bishop Anders F Björklund + Jurjen Bokma Aurelien Bompard + Joey Boggs Lorenzo Dalrio Francois Deppierraz Luc Didry @@ -44,6 +46,7 @@ Simon Josi Bryan Kearney Jason Kincl + Andrew Colin Kissa Francois Lebel Frédéric Lespez Jasper Lievisse Adriaanse @@ -53,6 +56,7 @@ Jeroen van Meeuwen Jim Meyering Sean Millichamp + Michael Moll Tim Mooney Joel Nimety Matthaus Owens @@ -74,6 +78,7 @@ Nicolas Valcárcel Scerpella Gonzalo Servat Nahum Shalman + Borislav Stoichkov Tim Stoop Laine Stump Jiri Suchomel @@ -117,3 +122,4 @@ Joel Loudermilk Frank Grötzner Pino Toscano + Geoffrey Gardella diff -Nru augeas-1.3.0/build/ac-aux/missing augeas-1.4.0/build/ac-aux/missing --- augeas-1.3.0/build/ac-aux/missing 2014-09-10 11:53:59.000000000 +0000 +++ augeas-1.4.0/build/ac-aux/missing 2014-09-10 11:57:56.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff -Nru augeas-1.3.0/build/ac-aux/test-driver augeas-1.4.0/build/ac-aux/test-driver --- augeas-1.3.0/build/ac-aux/test-driver 2014-09-10 11:53:59.000000000 +0000 +++ augeas-1.4.0/build/ac-aux/test-driver 2014-09-10 11:57:56.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2012-06-27.10; # UTC +scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2013 Free Software Foundation, Inc. # @@ -44,13 +44,12 @@ Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } -# TODO: better error handling in option parsing (in particular, ensure -# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. @@ -69,10 +68,23 @@ --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; + *) break;; esac shift done +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. diff -Nru augeas-1.3.0/build/ac-aux/ylwrap augeas-1.4.0/build/ac-aux/ylwrap --- augeas-1.3.0/build/ac-aux/ylwrap 2014-09-10 11:53:59.000000000 +0000 +++ augeas-1.4.0/build/ac-aux/ylwrap 2014-09-10 11:57:56.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -scriptversion=2012-12-21.17; # UTC +scriptversion=2013-01-12.17; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # @@ -40,7 +40,7 @@ # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. -guard() +guard () { printf '%s\n' "$1" \ | sed \ @@ -96,17 +96,17 @@ # The input. -input="$1" +input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` -case "$input" in +case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. - input="`pwd`/$input" + input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` @@ -132,8 +132,8 @@ # guard in its implementation file. sed_fix_header_guards= -while test "$#" -ne 0; do - if test "$1" = "--"; then +while test $# -ne 0; do + if test x"$1" = x"--"; then shift break fi @@ -153,16 +153,14 @@ done # The program to run. -prog="$1" +prog=$1 shift # Make any relative path in $prog absolute. -case "$prog" in +case $prog in [\\/]* | ?:[\\/]*) ;; - *[\\/]*) prog="`pwd`/$prog" ;; + *[\\/]*) prog=`pwd`/$prog ;; esac -# FIXME: add hostname here for parallel makes that run commands on -# other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 @@ -188,7 +186,7 @@ # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; - *) target="../$to";; + *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless @@ -197,7 +195,7 @@ # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then - realtarget="$target" + realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi diff -Nru augeas-1.3.0/ChangeLog augeas-1.4.0/ChangeLog --- augeas-1.3.0/ChangeLog 2014-11-07 23:14:45.000000000 +0000 +++ augeas-1.4.0/ChangeLog 2015-06-02 00:23:36.000000000 +0000 @@ -1,3 +1,507 @@ +2015-06-01 David Lutterkort + + Version 1.4.0 + + * src/augeas_sym.version: correct version for aug_escape_name + The (unreleased) version for aug_escape_name was erroneously set to 0.19.0 + in commit 1aa51f93; the correct version for the next release is 0.20.0 + + Httpd: add test to verify that issue #140 is fixed + Issue: https://github.com/hercules-team/augeas/issues/140 + +2015-06-01 David Lutterkort + + Fix SEGV when target file is not writable + When the file we want to wirte to is not writable by us, we used to + segfault. With this change, we now report a proper error. + + Fixes https://github.com/hercules-team/augeas/issues/178 + +2015-06-01 David Lutterkort + + Add the default ssl.conf from CentOS 6.6 + This shows that Issue #191 is fixed + +2015-06-01 Matt Dainty + + Passwd: fix @nisdefault on OpenBSD + Following passwd(5) on OpenBSD results in an /etc/passwd NIS entry like: + + +:*:0:0::: + + Passwd lens barfs on the '*' password. Change to match how normal entries are + matched. + +2015-06-01 Borislav Stoichkov + + Passwd: support nis [+-]username syntax + The /etc/passwd file can contain nis users with the syntax [+-]username for + the pruprose of including or excluding specific accounts. + + Importing of particular users' accounts can be restricted by using the + prefix "+" with a username. + + root:x:0:0:root user:/home/root:/bin/bash + +bob:::::: + +alice::::Alice:/home/alice:/bin/bash + + Certain users' accounts can be excluded from being imported by using the + "-" prefix with a username. + + root:x:0:0:root user:/home/root:/bin/bash + -bob:::::: + + + + The string that can comprise a valid username has been updated to cover a + range slightly larger that the definitions in POSIX + (http://pubs.opengroup.org/onlinepubs/9699919799/ , section 3.431), + is_valid_name() in chkname.c in shadow-utils and the NAME_REGEX definition + in distributions where defined. Rx.word was too broad and did not allow for + the -username syntax. + +2015-05-27 Michael Moll + + integrate two patches from FreeBSD ports + - /boot/loader.conf can be parsed with the sysctl lens + - /etc/perodic.conf can be parsed with the shellvars lens + +2015-05-22 David Lutterkort + + Grub: support a password stanza inside a boot/title section + The biggest change in this commit is changing the structure of lns: it now + says that boot sections have to come after the general menu_setting and + debian sections. Since 'password' is legal in both a top-level menu_setting + and in a boot section, that is necessary to keep the lens unambiguous. + + Fixes https://github.com/hercules-team/augeas/issues/229 + +2015-05-22 Borislav Stoichkov + + Shadow: allow NIS entries + Add support for the NIS default entry + and the nis default entry with + overrides +:::::::: + + Based on https://github.com/hercules-team/augeas/pull/237 + +2015-05-22 Geoffrey Gardella + + Updated tests/test-put-symlink-augsave.sh to remedy failure on Solaris + Due to output from 'sum' command containing the filename. + + Fixes #242 + +2015-05-21 David Lutterkort + + Nginx: change how we handle indentation of lines + Before this change, any change to the file would drop all indentation from + it. Now, we preserve existing indentation. Newly inserted lines don't get + the indentation of their block, but at least we preserve it for existing lines + +2015-05-20 David Lutterkort + + * NEWS: add note about errors command and better error messages + Should have been part of the last 4 commits, but I fat-fingered the push. + + Suppress repeated errors about not finding a module + We used to print 'Could not load module XYZ' every time that module wsa + mentioned. To cut down the number of annoying error messages, we now create + an empty dummy module when we fail to look one up; subsequent lookups will + find that and therefore not print the error message again. + +2015-05-20 David Lutterkort + + * src/lens.c (lns_format_atype): make output more readable + Try to make the output more readable by using better formatting: + - each entry in a concatenation and a union now goes on its own line + - indent formatted entries + + This is not perfect, but much better than splatting everything into one line + +2015-05-20 David Lutterkort + + Add an 'errors' command that pretty prints /augeas//error messages + +2015-05-20 David Lutterkort + + Analyze 'short iteration' errors better + When an iteration fell short, we would just throw our hands in the air and + produce not very helpful information. We now try to find the exact place + where some part of the iterated lens still matched and the rest didn't and + provide that information to the user. + + Note that these errors will only be produced for regular lenses, not for + recursive lenses + +2015-05-20 David Lutterkort + + * src/get.c (vget_error): replace unchecked CALLOC with checked ALLOC + One more place where a failing allocation won't cause a crash + +2015-05-20 David Lutterkort + + Nginx: rework to support a much broader set of valid configurations + The Nginx.lns is now recursive and can handle nested blocks. + + It can now also deal with some special block-start directives like + 'location' and 'if' which have additonal stuff between the keyword and the + opening brace. + + The file tests/root/etc/nginx/nginx.conf if the stock Nginx configuration + example from their siurce control, with everything that was commented out + activated. Having that file makes sure (via tests/test-get.sh) that we + successfully parse that file. + + Fixes https://github.com/hercules-team/augeas/issues/179 + +2015-05-20 David Lutterkort + + Test_Nginx: no functional change, reformatted + +2015-05-20 Raphaël Pinson + + Shellvars: more associate array syntax + + Shellvars: support associative arrays + + Known_Hosts: support aliases + +2015-05-15 Michael Smith + + Add /etc/puppetlabs/mcollective to mcollective lens + In the latest release of Puppet, the mcollective paths have been updated + to reflect the documentation at + https://github.com/puppetlabs/puppet-specifications/blob/master/file_paths.md + + This commit adds server.cfg and client.cfg in + /etc/puppetlabs/mcollective to the mcollective filter. + +2015-04-29 Raphaël Pinson + + Puppetfile: Use seq instead of a fixed label + +2015-04-20 Haotian Liu + + Postgresql: add default paths used on Red Hat-based distros + As of Postgres 9.4, postgresql.conf is stored in the database cluster's + data directory + + See: + http://www.postgresql.org/docs/9.4/static/runtime-config-file-locations.html + +2015-04-20 timdeluxe + + Limits: allow comments at end of line + Here is my proposal for changing limits.aug lens to allow comments at the end of the line, which are no problem for the OS and heavily used in the limits.conf on our systems. Without that change you get a parse error. + +2015-04-20 Steve Shipway + + Jaas: add several improvements to cover more valid syntax + Add flexibility to Jaas lens: allow comments within Modules, optionless + flags, options without intervening linebreaks, and true/false option + values without quotes. All of these are valid syntax in the Shibboleth + file. + +2015-04-20 David Lutterkort + + * src/get.c: fix possible NULL dereference + Reported in https://github.com/hercules-team/augeas/issues/218 by ggardella + + * src/fa.c: fix a number of possible NULL dereferences + Reported in https://github.com/hercules-team/augeas/issues/218 by ggardella + + * src/augtool.c: fix minor memory leak + +2015-04-20 Dominic Cleal + + Logrotate: support 'maxsize' directive + Fixes RHBZ#1213292 + +2015-04-10 Jurjen Bokma + + Krb5: add keyword 'krb524_server' + + Krb5: allow realm names that start with lower case characters + +2015-04-10 David Lutterkort + + * src/parser.y: update to work with Bison 3.0.2 + +2015-04-09 Raphaël Pinson + + Httpd: Properly manage eol after opening tag + Allow comments and empty lines after opening tag. + + Fix #220 + +2015-04-09 Raphaël Pinson + + Httpd: Make \ illegal in char_arg_dir + Add tests to check non-recursive behaviour + of partial lenses + + Fix #223 + +2015-04-09 Raphaël Pinson + + Httpd: Do not pass empty as body to section + This causes a conflict with eol_comment over newlines. + `empty` is just a generic part of `section`, not really a body. + + .travis.yml: Use sudo false and the apt addons + +2015-04-03 David Lutterkort + + Logrotate: do not require a space before the opening brace + The actual fix was in the previous commit c2abb62c, this just adds a test + + Fixes issue #123 + +2015-04-03 David Lutterkort + + Build (block_newlines): make the space before the opening brace optional + Added block_newlines_spc for the palces where we really need a block to + start with ' {'; it seems that everywhere else requiring that space was an + oversight. + + The two lenses that needed the space are Dovecot and Xinetd. + +2015-04-03 David Lutterkort + + Dovecot: no functional change; remove trailing whitespace + + Logrotate: no functional change; remove tabs + + NEWS: mention augtool fix from previous commit + The fix came from https://github.com/hercules-team/augeas/pull/93 + +2015-04-03 Robert Drake + + * src/augtool.c: fix for readline add_history with interactive mode + If you use interactive mode, augtool never adds anything to history that + you type once the input becomes a normal tty. + + This is because it was checking stdin, which as far as the system is + concerned is still !isatty(). + +2015-04-03 fonfon + + Allow more fine-grained control of service_on entries + +2015-04-03 David Lutterkort + + * tests/Makefile.am: fix breakage introduced in c1b7784e + +2015-04-03 Kaarle Ritvanen + + Dns_Zone: new lens to parse DNS zone files + +2015-04-03 Pat Riehecky + + AFS_Cellalias: new lens + https://github.com/hercules-team/augeas/pull/210 + +2015-04-03 Pat Riehecky + + Iscsid: new lens + Thanks to Joey Boggs for writing tests + + Fixes issue #174 + + https://github.com/hercules-team/augeas/pull/216 + +2015-04-03 David Lutterkort + + NEWS: mention Logrotate change and issue # for Postfix_sasl_smtpd + Minor changes for commits 2face8cf and c1b7784e + + Logrotate: support 'dateformat' directive + Fixes issue #217 + +2015-04-03 David Lutterkort + + Postfix_sasl_smtpd: new lens + Fixes issue #182 + + Contributed by larsen0815 + +2015-04-02 David Lutterkort + + * src/pathx.c (pathx_escape_name): also escape backslash + Since backslash is an escape character in parse_name, we need to escape it + with a backslash to make sure that parse_name is really the inverse of + pathx_escape_name. + + Thanks to Eric Blake for spotting this problem with the initial attempt to + escape names introduced in e4f0a677 + +2015-04-02 David Lutterkort + + Revert previous commit 27e36585; that change did more than was needed + I overlooked that pathx_escape_name already escaped whitespace, and + therefore we only need to also escape backslashes. The next patch will add + escaping of backslashes to patchx_escape_name. + +2015-04-01 David Lutterkort + + * src/pathx.c (pathx_escape_name): also escape backslash and space + Since backslash is an escape character in parse_name, we need to escape it + with a backslash to make sure that parse_name is really the inverse of + pathx_escape_name. + + We also escape a space as that is used in some circumstances to end a name + (when we encounter ' or ' or ' and ') + + Thanks to Eric Blake for spotting this problem with the initial attempt to + escape names introduced in e4f0a677 + +2015-03-13 David Lutterkort + + Shellvars: fix insertion at top of file that starts with blank lines + Possible blank lines at the start of a file were mapped with Util.empty + which produces empty 'hidden' nodes (nodes with NULL label and value) + + This causes problem when a user inserts something before these nodes, for + example with "insert 'foo' before /*[1]". Even though the nodes that + Util.empty produces are generally hidden from the user, they are still in + the tree and /*[1] selects such a node. The resulting tree has a hidden + node in the middle, something that Shellvars.lns does not allow and + therefore putting this tree fails. This is really hard to understand for + users as the tree they see with 'print' is indistinguishable from one that + doesn't have these hidden nodes. + + To fix this, the changed lens simply deletes the blank lines at the + beginning of the file without creating any tree nodes. This makes the above + insertion work at the cost of losing these blank lines as soon as anything + is inserted into or deleted from the file. + + Fixes #202 + +2015-03-13 David Lutterkort + + Sysconfig: accept leading whitespace before variables + Make sure we allow ' var=value' and similar entries in files + + Fixes part of https://bugzilla.redhat.com/show_bug.cgi?id=761246 + +2015-03-02 Pat Riehecky + + Chrony: fix error in spelling of 'measurements' and add test for that + +2015-02-27 Jeremy Lin + + augtool: on interrupt, cancel current line instead of exiting + +2015-02-27 David Lutterkort + + New API aug_escape_name + Provide a way to escape the characters that are special in a path + expression + + * src/internal.c (path_expand): escape path components as needed + path_expand, which is used to turn the name of a tree node into a path + component, now escapes special characters for path expressions so that the + resulting paths can be used to look up that node even if the node name + contains special characters. + + * src/transform.c (remove_file): do not use path_of_tree + remove_file uses path_of_tree to derive the name of the file that should be + removed. Since we will change path_of_tree so that it escapes certain + characters, we need to use a different way to get at the filename. + + * src/pathx.c (pathx_escape_name): new function + Several characters in a path component are treated special, such as '[' and + ']'; to treat a string containing such characters as a literal path + component, they need to be escaped with a '\\'. + + Move constant 'follow' out of parse_name + + * src/try: when running from the cli, exec augtool + Before, when using this script, it was not really possible to put the + resulting augtool run into the background. + +2015-02-25 Russell Knighton + + Added support for conf-available apache config file location + +2015-02-09 Andrew Colin Kissa + + Add Mailscanner_Rules lens for MailScanner rules files + + Add Pylonspaste lens + + Add Pgbouncer lens + + Add Mailscanner lens + + Add Clamav lens + +2015-02-02 Kaarle Ritvanen + + Dnsmasq: add structure to 'address' and 'server' options + This is a backwards incompatible change. + +2015-02-02 Raphaël Pinson + + Authorized_keys: Allow double quotes in option values (GH #135) + +2015-02-02 Kaarle Ritvanen + + Shellvars: case: support ;; on same line with multiple commands + +2015-01-28 Vincent Desjardins + + exports: add bracket support to the supported machine name formats. + +2015-01-20 David Lutterkort + + NEWS: mention previous commit + +2015-01-20 grueni + + Fix: '+' in user_alias + Users of Samba may use '+' as separator between group and user name if + domain accounts are used. + +2015-01-06 Dominic Cleal + + Erlang: parse kernel app config, handle empty lists + Fixes RHBZ#1175546 + +2015-01-05 Dominic Cleal + + PythonPaste: parse "set" keyword for default overrides + Fixes RHBZ#1175545 + +2014-12-08 Raphaël Pinson + + Puppetfile: New lens to parse the Puppetfile format + +2014-12-02 Raphaël Pinson + + Shellvars_list: Support double-quoted continued lines + +2014-11-25 Raphaël Pinson + + NagiosCfg: default to no spaces around equal, fix #177 + +2014-11-19 Raphaël Pinson + + Exports: Do not use Hosts lenses + + Hosts: Refactor module + +2014-11-13 Raphaël Pinson + + Ssh: allow indented commas_entry + +2014-11-07 David Lutterkort + + Version 1.3.0 + + * tests/test-save.c (teardown): make /etc writable after test + Leaving it non-writable, as testRemovePermission does, causes 'make + distcheck' to fail + 2014-10-31 Chris Hollowell Cgconfig: permit quoted spaces in parameter values diff -Nru augeas-1.3.0/configure augeas-1.4.0/configure --- augeas-1.3.0/configure 2014-11-07 22:31:55.000000000 +0000 +++ augeas-1.4.0/configure 2015-06-02 00:23:20.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for augeas 1.3.0. +# Generated by GNU Autoconf 2.69 for augeas 1.4.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='augeas' PACKAGE_TARNAME='augeas' -PACKAGE_VERSION='1.3.0' -PACKAGE_STRING='augeas 1.3.0' +PACKAGE_VERSION='1.4.0' +PACKAGE_STRING='augeas 1.4.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -2080,7 +2080,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures augeas 1.3.0 to adapt to many kinds of systems. +\`configure' configures augeas 1.4.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2150,7 +2150,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of augeas 1.3.0:";; + short | recursive ) echo "Configuration of augeas 1.4.0:";; esac cat <<\_ACEOF @@ -2293,7 +2293,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -augeas configure 1.3.0 +augeas configure 1.4.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2998,7 +2998,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by augeas $as_me 1.3.0, which was +It was created by augeas $as_me 1.4.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3427,7 +3427,7 @@ ac_config_headers="$ac_config_headers config.h" -am__api_version='1.13' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3914,7 +3914,7 @@ # Define the identity of the package. PACKAGE='augeas' - VERSION='1.3.0' + VERSION='1.4.0' cat >>confdefs.h <<_ACEOF @@ -3965,6 +3965,47 @@ +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; @@ -4179,9 +4220,9 @@ fi -LIBAUGEAS_VERSION_INFO=19:0:19 +LIBAUGEAS_VERSION_INFO=20:0:20 -LIBFA_VERSION_INFO=5:0:4 +LIBFA_VERSION_INFO=5:1:4 # Make sure we can run config.sub. @@ -5107,6 +5148,65 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -6247,6 +6347,65 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -9528,10 +9687,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - powerpcle-*linux*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc-*linux*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -37070,7 +37229,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by augeas $as_me 1.3.0, which was +This file was extended by augeas $as_me 1.4.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -37136,7 +37295,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -augeas config.status 1.3.0 +augeas config.status 1.4.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru augeas-1.3.0/configure.ac augeas-1.4.0/configure.ac --- augeas-1.3.0/configure.ac 2014-11-07 22:31:40.000000000 +0000 +++ augeas-1.4.0/configure.ac 2015-06-02 00:23:11.000000000 +0000 @@ -1,4 +1,4 @@ -AC_INIT(augeas, 1.3.0) +AC_INIT(augeas, 1.4.0) AC_CONFIG_SRCDIR([src/augeas.c]) AC_CONFIG_AUX_DIR([build/ac-aux]) AM_CONFIG_HEADER([config.h]) @@ -65,8 +65,8 @@ fi dnl Version info in libtool's notation -AC_SUBST([LIBAUGEAS_VERSION_INFO], [19:0:19]) -AC_SUBST([LIBFA_VERSION_INFO], [5:0:4]) +AC_SUBST([LIBAUGEAS_VERSION_INFO], [20:0:20]) +AC_SUBST([LIBFA_VERSION_INFO], [5:1:4]) AC_GNU_SOURCE diff -Nru augeas-1.3.0/debian/changelog augeas-1.4.0/debian/changelog --- augeas-1.3.0/debian/changelog 2014-12-01 10:38:36.000000000 +0000 +++ augeas-1.4.0/debian/changelog 2015-08-24 11:43:41.000000000 +0000 @@ -1,4 +1,10 @@ -augeas (1.3.0-0ubuntu1~trusty1) trusty; urgency=medium +augeas (1.4.0-0ubuntu1~augeas1~precise4) precise; urgency=medium + + * New upstream version + + -- Raphaël Pinson Thu, 04 Jun 2015 10:58:14 +0200 + +augeas (1.3.0-0ubuntu1) vivid; urgency=medium * New upstream version * Include d/p/0003_Link_pthread.patch again diff -Nru augeas-1.3.0/debian/control augeas-1.4.0/debian/control --- augeas-1.3.0/debian/control 2014-12-01 10:09:30.000000000 +0000 +++ augeas-1.4.0/debian/control 2015-08-24 10:33:54.000000000 +0000 @@ -1,6 +1,7 @@ Source: augeas Priority: optional -Maintainer: Nicolas Valcárcel Scerpella +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Nicolas Valcárcel Scerpella Uploaders: Free Ekanayaka , Micah Anderson Build-Depends: debhelper (>= 9), dh-autoreconf, libreadline-dev, @@ -9,6 +10,7 @@ naturaldocs (>= 1.51), pkg-config, texlive-latex-base, + quilt, Standards-Version: 3.9.5 Section: libs Homepage: http://augeas.net/ diff -Nru augeas-1.3.0/debian/rules augeas-1.4.0/debian/rules --- augeas-1.3.0/debian/rules 2014-12-01 10:09:30.000000000 +0000 +++ augeas-1.4.0/debian/rules 2015-08-24 11:43:32.000000000 +0000 @@ -1,13 +1,13 @@ #!/usr/bin/make -f %: - dh $@ --with=autoreconf --parallel + dh $@ --with=quilt --with=autoreconf --parallel override_dh_autoreconf: dh_autoreconf autoreconf -- -i override_dh_auto_test: - dh_auto_test -- SKIP_TEST_PRESERVE_SELINUX=1 + dh_auto_test -- SKIP_TEST_PRESERVE_SELINUX=1 || cat tests/test-suite.log override_dh_install: dh_install -X.la -Xusr/bin/fadot --fail-missing diff -Nru augeas-1.3.0/doc/Makefile.in augeas-1.4.0/doc/Makefile.in --- augeas-1.3.0/doc/Makefile.in 2014-11-07 22:31:55.000000000 +0000 +++ augeas-1.4.0/doc/Makefile.in 2015-06-02 00:23:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. diff -Nru augeas-1.3.0/doc/naturaldocs/conf/lenses/Menu.txt augeas-1.4.0/doc/naturaldocs/conf/lenses/Menu.txt --- augeas-1.3.0/doc/naturaldocs/conf/lenses/Menu.txt 2014-10-17 16:41:03.000000000 +0000 +++ augeas-1.4.0/doc/naturaldocs/conf/lenses/Menu.txt 2015-05-22 22:31:25.000000000 +0000 @@ -56,6 +56,7 @@ File: Access (access.aug) File: ActiveMQ_Conf (activemq_conf.aug) File: ActiveMQ_XML (activemq_xml.aug) + File: AFS_cellalias (afs_cellalias.aug) File: Aliases (aliases.aug) File: Anacron (anacron.aug) File: Approx (approx.aug) @@ -101,6 +102,7 @@ File: JettyRealm (jettyrealm.aug) File: JMXAccess (jmxaccess.aug) File: JMXPassword (jmxpassword.aug) + File: Iscsid (iscsid.aug) File: Iptables (iptables.aug) File: Kdump (kdump.aug) File: Keepalived (keepalived.aug) @@ -141,6 +143,7 @@ File: Postfix_Virtual (postfix_virtual.aug) File: Postgresql (postgresql.aug) File: Protocols (protocols.aug) + File: Puppetfile (no auto-title, puppetfile.aug) File: PuppetFileserver (no auto-title, puppetfileserver.aug) File: Puppet_Auth (no auto-title, puppet_auth.aug) File: Qpid (qpid.aug) @@ -198,6 +201,7 @@ File: Test_Access (tests/test_access.aug) File: Test_ActiveMQ_Conf (tests/test_activemq_conf.aug) File: Test_ActiveMQ_XML (tests/test_activemq_xml.aug) + File: Test_AFS_cellalias (tests/test_afs_cellalias.aug) File: Test_Aliases (tests/test_aliases.aug) File: Test_Anacron (tests/test_anacron.aug) File: Test_Approx (tests/test_approx.aug) @@ -208,6 +212,7 @@ File: Test_Carbon (tests/test_carbon.aug) File: Test_Channels (tests/test_channels.aug) File: Test_Chrony (tests/test_chrony.aug) + File: Test_ClamAV (tests/test_clamav.aug) File: Test_Collectd (tests/test_collectd.aug) File: Test_CPanel (tests/test_cpanel.aug) File: Test_Cups (tests/test_cups.aug) @@ -220,6 +225,7 @@ File: Test_Htpasswd (tests/test_htpasswd.aug) File: Test_IniFile (tests/test_inifile.aug) File: Test_Inputrc (tests/test_inputrc.aug) + File: Test_Iscsid (tests/test_iscsid.aug) File: Test_JettyRealm (tests/test_jettyrealm.aug) File: Test_JMXAccess (tests/test_jmxaccess.aug) File: Test_JMXPassword (tests/test_jmxpassword.aug) @@ -230,6 +236,8 @@ File: Test_Ldso (tests/test_ldso.aug) File: Test_Lightdm (tests/test_lightdm.aug) File: Test_LVM (tests/test_lvm.aug) + File: Test_Mailscanner (tests/test_mailscanner.aug) + File: Test_Mailscanner_Rules (tests/test_mailscanner_rules.aug) File: Test_MCollective (tests/test_mcollective.aug) File: Test_Memcached (tests/test_memcached.aug) File: Test_MongoDBServer (tests/test_mongodbserver.aug) @@ -240,11 +248,14 @@ File: Test_OpenShift_Config (tests/test_openshift_config.aug) File: Test_OpenShift_Http (tests/test_openshift_http.aug) File: Test_OpenShift_Quickstarts (tests/test_openshift_quickstarts.aug) + File: Test_Pgbouncer (tests/test_pgbouncer.aug) File: Test_Postfix_Transport (tests/test_postfix_transport.aug) File: Test_Postfix_Virtual (tests/test_postfix_virtual.aug) File: Test_Postgresql (tests/test_postgresql.aug) File: Test_Protocols (tests/test_protocols.aug) File: Test_Puppet_Auth (tests/test_puppet_auth.aug) + File: Test_Puppetfile (tests/test_puppetfile.aug) + File: Test_Pylonspaste (tests/test_pylonspaste.aug) File: Test_Qpid (tests/test_qpid.aug) File: Test_Quote (tests/test_quote.aug) File: Test_Rabbitmq (tests/test_rabbitmq.aug) diff -Nru augeas-1.3.0/doc/naturaldocs/Makefile.in augeas-1.4.0/doc/naturaldocs/Makefile.in --- augeas-1.3.0/doc/naturaldocs/Makefile.in 2014-11-07 22:31:55.000000000 +0000 +++ augeas-1.4.0/doc/naturaldocs/Makefile.in 2015-06-02 00:23:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. diff -Nru augeas-1.3.0/examples/Makefile.in augeas-1.4.0/examples/Makefile.in --- augeas-1.3.0/examples/Makefile.in 2014-11-07 22:31:55.000000000 +0000 +++ augeas-1.4.0/examples/Makefile.in 2015-06-02 00:23:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -1233,14 +1233,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru augeas-1.3.0/gnulib/lib/Makefile.in augeas-1.4.0/gnulib/lib/Makefile.in --- augeas-1.3.0/gnulib/lib/Makefile.in 2014-11-07 22:31:55.000000000 +0000 +++ augeas-1.4.0/gnulib/lib/Makefile.in 2015-06-02 00:23:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -1418,14 +1418,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru augeas-1.3.0/gnulib/m4/libtool.m4 augeas-1.4.0/gnulib/m4/libtool.m4 --- augeas-1.3.0/gnulib/m4/libtool.m4 2014-01-27 09:39:12.000000000 +0000 +++ augeas-1.4.0/gnulib/m4/libtool.m4 2014-12-19 18:25:28.000000000 +0000 @@ -1326,10 +1326,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - powerpcle-*linux*) + powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc-*linux*) + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) diff -Nru augeas-1.3.0/gnulib/tests/Makefile.in augeas-1.4.0/gnulib/tests/Makefile.in --- augeas-1.3.0/gnulib/tests/Makefile.in 2014-11-07 22:31:55.000000000 +0000 +++ augeas-1.4.0/gnulib/tests/Makefile.in 2015-06-02 00:23:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. diff -Nru augeas-1.3.0/lenses/afs_cellalias.aug augeas-1.4.0/lenses/afs_cellalias.aug --- augeas-1.3.0/lenses/afs_cellalias.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/afs_cellalias.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,60 @@ +(* +Module: AFS_cellalias + Parses AFS configuration file CellAlias + +Author: Pat Riehecky + +About: Reference + This lens is targeted at the OpenAFS CellAlias file + +About: Lens Usage + Sample usage of this lens in augtool + + * Add a CellAlias for fnal.gov/files to fnal-files + > set /files/usr/vice/etc/CellAlias/target[99] fnal.gov/files + > set /files/usr/vice/etc/CellAlias/target[99]/linkname fnal-files + +About: License + This file is licensed under the LGPL v2+, like the rest of Augeas. +*) + +module AFS_cellalias = + autoload xfm + + (************************************************************************ + * Group: USEFUL PRIMITIVES + *************************************************************************) + + (* Group: Comments and empty lines *) + + (* View: eol *) + let eol = Util.eol + (* View: comment *) + let comment = Util.comment + (* View: empty *) + let empty = Util.empty + + (* Group: separators *) + + (* View: space + * Separation between key and value + *) + let space = Util.del_ws_spc + let target = /[^ \t\n#]+/ + let linkname = Rx.word + + (************************************************************************ + * Group: ENTRIES + *************************************************************************) + + (* View: entry *) + let entry = [ label "target" . store target . space . [ label "linkname" . store linkname . eol ] ] + + (* View: lns *) + let lns = (empty | comment | entry)* + + let xfm = transform lns (incl "/usr/vice/etc/CellAlias") + +(* Local Variables: *) +(* mode: caml *) +(* End: *) diff -Nru augeas-1.3.0/lenses/authorized_keys.aug augeas-1.4.0/lenses/authorized_keys.aug --- augeas-1.3.0/lenses/authorized_keys.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/authorized_keys.aug 2015-05-22 22:31:25.000000000 +0000 @@ -33,7 +33,9 @@ in let flag_re = "cert-authority" | "no-agent-forwarding" | "no-port-forwarding" | "no-pty" | "no-user-rc" | "no-X11-forwarding" - in let option_value = Util.del_str "\"" . store /[^\n"]+/ . Util.del_str "\"" + in let option_value = Util.del_str "\"" + . store /((\\\\")?[^\\\n"]*)+/ + . Util.del_str "\"" in Build.key_value kv_re Sep.equal option_value | Build.flag flag_re diff -Nru augeas-1.3.0/lenses/build.aug augeas-1.4.0/lenses/build.aug --- augeas-1.3.0/lenses/build.aug 2014-10-31 17:19:18.000000000 +0000 +++ augeas-1.4.0/lenses/build.aug 2015-05-22 22:31:25.000000000 +0000 @@ -259,7 +259,7 @@ block_ldelim_default block_rdelim_default (* Variable: block_ldelim_newlines_re *) -let block_ldelim_newlines_re = /[ \t\n]+\{([ \t\n]*\n)?/ +let block_ldelim_newlines_re = /[ \t\n]*\{([ \t\n]*\n)?/ (* Variable: block_rdelim_newlines_re *) let block_rdelim_newlines_re = /[ \t]*\}/ @@ -287,6 +287,23 @@ . del block_rdelim_newlines_re block_rdelim_newlines_default (************************************************************************ + * View: block_newlines_spc + * A block enclosed in brackets, with newlines forced + * and indentation defaulting to a tab. The opening brace + * must be preceded by whitespace + * + * Parameters: + * entry:lens - the entry to be stored inside the block. + * This entry should not include , + * or , + * should be indented and finish with an eol. + ************************************************************************) +let block_newlines_spc (entry:lens) (comment:lens) = + del (/[ \t\n]/ . block_ldelim_newlines_re) block_ldelim_newlines_default + . ((entry | comment) . (Util.empty | entry | comment)*)? + . del block_rdelim_newlines_re block_rdelim_newlines_default + +(************************************************************************ * View: named_block * A named enclosed in brackets * @@ -401,4 +418,3 @@ combine_three_opt_ord a b c | combine_three_opt_ord b a c | combine_three_opt_ord c b a - diff -Nru augeas-1.3.0/lenses/chrony.aug augeas-1.4.0/lenses/chrony.aug --- augeas-1.3.0/lenses/chrony.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/chrony.aug 2015-05-22 22:31:25.000000000 +0000 @@ -112,7 +112,7 @@ (* Variable: log_flags log has a specific options list *) - let log_flags = /measurments|statistics|tracking|rtc|refclocks|tempcomp/ + let log_flags = /measurements|statistics|tracking|rtc|refclocks|tempcomp/ (* Variable: simple_keys Options with single values diff -Nru augeas-1.3.0/lenses/clamav.aug augeas-1.4.0/lenses/clamav.aug --- augeas-1.3.0/lenses/clamav.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/clamav.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,52 @@ +(* +Module: ClamAV + Parses ClamAV clamd and freshclam configuration files. + +Author: Andrew Colin Kissa + Baruwa Enterprise Edition http://www.baruwa.com + +About: License + This file is licensed under the LGPL v2+. + +About: Configuration files + This lens applies to /etc/clamd.conf, /etc/freshclam.conf and files in + /etc/clamd.d. See . +*) + +module Clamav = +autoload xfm + +(************************************************************************ + * Group: USEFUL PRIMITIVES + ************************************************************************) + +let word = /[A-Za-z][A-Za-z0-9]+/ + +let comment = Util.comment + +let some_value = Sep.space . store Rx.space_in + +(************************************************************************ + * Group: Entry + ************************************************************************) + +let example_entry = [ key "Example" . Util.eol ] + +let clamd_entry = [ key word . some_value . Util.eol ] + +(****************************************************************** + * Group: LENS AND FILTER + ******************************************************************) + +(************************************************************************ + * View: Lns + ************************************************************************) + +let lns = (Util.empty | example_entry | clamd_entry | comment )* + +(* Variable: filter *) +let filter = (incl "/etc/clamd.conf") + . (incl "/etc/freshclam.conf") + . (incl "/etc/clamd.d/*.conf") + +let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/dnsmasq.aug augeas-1.4.0/lenses/dnsmasq.aug --- augeas-1.3.0/lenses/dnsmasq.aug 2013-01-04 00:04:02.000000000 +0000 +++ augeas-1.4.0/lenses/dnsmasq.aug 2015-05-22 22:31:25.000000000 +0000 @@ -17,26 +17,42 @@ * USEFUL PRIMITIVES *************************************************************************) -let eol = Util.eol -let spc = Util.del_ws_spc -let comment = Util.comment -let empty = Util.empty - -let sep_eq = del /=/ "=" -let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ +let eol = Util.eol +let spc = Util.del_ws_spc +let comment = Util.comment +let empty = Util.empty + +let sep_eq = Sep.equal +let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ + +let slash = Util.del_str "/" +let sto_no_slash = store /([^\/ \t\n]+)/ +let domains = slash . [ label "domain" . sto_no_slash . slash ]+ (************************************************************************ - * ENTRIES + * SIMPLE ENTRIES *************************************************************************) -let entry_re = /[A-Za-z0-9._-]+/ +let entry_re = Rx.word - /(address|server)/ let entry = [ key entry_re . (sep_eq . sto_to_eol)? . eol ] (************************************************************************ + * STRUCTURED ENTRIES + *************************************************************************) + +let address = [ key "address" . sep_eq . domains . sto_no_slash . eol ] + +let server = + let port = [ Build.xchgs "#" "port" . store Rx.integer ] + in let source = [ Build.xchgs "@" "source" . store /[^#\/ \t\n]+/ . port? ] + in let srv_spec = store /(#|([^#@\/ \t\n]+))/ . port? . source? + in [ key "server" . sep_eq . domains? . srv_spec? . eol ] + +(************************************************************************ * LENS *************************************************************************) -let lns = (comment|empty|entry) * +let lns = (comment|empty|address|server|entry) * let filter = incl "/etc/dnsmasq.conf" . incl "/etc/dnsmasq.d/*" diff -Nru augeas-1.3.0/lenses/dns_zone.aug augeas-1.4.0/lenses/dns_zone.aug --- augeas-1.3.0/lenses/dns_zone.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/dns_zone.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,113 @@ +(* +Module: Dns_Zone + Lens for parsing DNS zone files + +Authors: + Kaarle Ritvanen + +About: Reference + RFC 1035, RFC 2782, RFC 3403 + +About: License + This file is licensed under the LGPL v2+ +*) + +module Dns_Zone = + +autoload xfm + +let eol = del /([ \t\n]*(;[^\n]*)?\n)+/ "\n" +let opt_eol = del /([ \t\n]*(;[^\n]*)?\n)*/ "" + +let ws = del /[ \t]+|(([ \t\n]*;[^\n]*)?\n)+[ \t]*/ " " +let opt_ws = del /(([ \t\n]*;[^\n]*)?\n)*[ \t]*/ "" + +let token = /([^ \t\n";()\\]|\\\\.)+|"([^"\\]|\\\\.)*"/ + + +let control = [ key /\$[^ \t\n\/]+/ + . Util.del_ws_tab + . store token + . eol ] + + +let labeled_token (lbl:string) (re:regexp) (sep:lens) = + [ label lbl . store re . sep ] + +let regexp_token (lbl:string) (re:regexp) = + labeled_token lbl re Util.del_ws_tab + +let type_token (re:regexp) = regexp_token "type" re + +let simple_token (lbl:string) = regexp_token lbl token + +let enclosed_token (lbl:string) = labeled_token lbl token ws + +let last_token (lbl:string) = labeled_token lbl token eol + + +let class_re = /IN/ + +let ttl = regexp_token "ttl" /[0-9]+[DHMWdhmw]?/ +let class = regexp_token "class" class_re + +let rr = + let simple_type = /[A-Z]+/ - class_re - /MX|NAPTR|SOA|SRV/ + in type_token simple_type . last_token "rdata" + + +let mx = type_token "MX" + . simple_token "priority" + . last_token "exchange" + +let naptr = type_token "NAPTR" + . simple_token "order" + . simple_token "preference" + . simple_token "flags" + . simple_token "service" + . simple_token "regexp" + . last_token "replacement" + +let soa = type_token "SOA" + . simple_token "mname" + . simple_token "rname" + . Util.del_str "(" + . opt_ws + . enclosed_token "serial" + . enclosed_token "refresh" + . enclosed_token "retry" + . enclosed_token "expiry" + . labeled_token "minimum" token opt_ws + . Util.del_str ")" + . eol + +let srv = type_token "SRV" + . simple_token "priority" + . simple_token "weight" + . simple_token "port" + . last_token "target" + + +let record = seq "owner" + . ((ttl? . class?) | (class . ttl)) + . (rr|mx|naptr|soa|srv) +let ws_record = [ Util.del_ws_tab . record ] +let records (k:regexp) = [ key k . counter "owner" . ws_record+ ] + +let any_record_block = records /[^ \t\n;\/$][^ \t\n;\/]*/ +let non_root_records = records /@[^ \t\n;\/]+|[^ \t\n;\/$@][^ \t\n;\/]*/ + +let root_records = [ del /@?/ "@" + . Util.del_ws_tab + . label "@" + . counter "owner" + . [ record ] + . ws_record* ] + +let lns = opt_eol + . control* + . ( (root_records|non_root_records) + . (control|any_record_block)* )? + +let filter = incl "/var/bind/pri/*.zone" +let xfm = transform Dns_Zone.lns filter diff -Nru augeas-1.3.0/lenses/dovecot.aug augeas-1.4.0/lenses/dovecot.aug --- augeas-1.3.0/lenses/dovecot.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/dovecot.aug 2015-05-22 22:31:25.000000000 +0000 @@ -10,18 +10,18 @@ This file is licensed under the LGPL v2+. About: Configuration files - This lens applies to /etc/dovecot/dovecot.conf and files in + This lens applies to /etc/dovecot/dovecot.conf and files in /etc/dovecot/conf.d/. See . About: Examples The file contains various examples and tests. About: TODO - Support for multiline values like queries in dict-sql.conf + Support for multiline values like queries in dict-sql.conf *) module Dovecot = - + autoload xfm (****************************************************************** @@ -48,10 +48,10 @@ (* Variable: any *) let any = Rx.no_spaces -(* Variable: value +(* Variable: value Match any value after " =". Should not start and end with spaces. May contain spaces inside *) -let value = any . (Rx.space . any)* +let value = any . (Rx.space . any)* (* View: command_start *) let command_start = Util.del_str "!" @@ -67,7 +67,7 @@ (* Variable: block_names *) let block_names = /dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener/ -(* Variable: keys +(* Variable: keys Match any possible key except commands and block names. *) let keys = Rx.word - (commands | block_names) @@ -100,7 +100,7 @@ let mailbox = indent . dquote_spaces (key /mailbox/ . Sep.space) - (Build.block_newlines (entry) comment . eol) + (Build.block_newlines_spc entry comment . eol) let block_ldelim_newlines_re = /[ \t]+\{([ \t\n]*\n)?/ @@ -111,7 +111,7 @@ . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default (* View: block -Map block enclosed in brackets recursively. +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 . (Sep.space . Quote.do_dquote_opt (store /[\/A-Za-z0-9_-]+/))? . block_newlines (entry|block|mailbox) comment . eol ] diff -Nru augeas-1.3.0/lenses/erlang.aug augeas-1.4.0/lenses/erlang.aug --- augeas-1.3.0/lenses/erlang.aug 2012-12-17 21:39:45.000000000 +0000 +++ augeas-1.4.0/lenses/erlang.aug 2015-05-22 22:31:25.000000000 +0000 @@ -24,6 +24,9 @@ (* Group: Spacing Functions *) +(* View: space *) +let space = del /[ \t\n]*/ "" + (* View: lspace Add spaces to the left of char *) let lspace (char:string) = del (/[ \t\n]*/ . char) char @@ -72,8 +75,8 @@ (* View: opt_list An optional list of elements, in square brackets *) let opt_list (lns:lens) = rspace lbrack - . Build.opt_list lns (lrspace comma) - . lspace rbrack + . (Build.opt_list lns (lrspace comma) . space)? + . Util.del_str rbrack (* View: integer Store a *) @@ -119,7 +122,7 @@ . sto . lspace rbrace ] -(* View: value +(* View: tuple A tuple of values *) let tuple (one:lens) (two:lens) = [ rspace lbrace @@ -147,6 +150,26 @@ let application (name:regexp) (parameter:lens) = list name parameter +(* View: kernel_parameters + Config parameters accepted for kernel app *) +let kernel_parameters = + value "browser_cmd" path + | value "dist_auto_connect" (store /never|once/) + | value "error_logger" (store /tty|false|silent/) + | value "net_setuptime" integer + | value "net_ticktime" integer + | value "shutdown_timeout" integer + | value "sync_nodes_timeout" integer + | value "start_dist_ac" boolean + | value "start_boot_server" boolean + | value "start_disk_log" boolean + | value "start_pg2" boolean + | value "start_timer" boolean + +(* View: kernel + Core Erlang kernel app configuration *) +let kernel = application "kernel" kernel_parameters + (* View: comment *) let comment = Util.comment_generic /%[ \t]*/ "% " @@ -155,7 +178,7 @@ let config (app:lens) = (Util.empty | comment)* . rspace lbrack - . Build.opt_list app (lrspace comma) + . Build.opt_list (kernel | app) (lrspace comma) . lrspace rbrack . Util.del_str "." . Util.eol . (Util.empty | comment)* diff -Nru augeas-1.3.0/lenses/exports.aug augeas-1.4.0/lenses/exports.aug --- augeas-1.3.0/lenses/exports.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/exports.aug 2015-05-22 22:31:25.000000000 +0000 @@ -76,7 +76,7 @@ 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 "(" @@ -93,6 +93,6 @@ let entry = [ label "dir" . store /\/[^ \t]*/ . sep_spc . Build.opt_list client sep_spc . eol ] - let lns = (Hosts.empty | Hosts.comment | entry)* + let lns = (Util.empty | Util.comment | entry)* let xfm = transform lns (incl "/etc/exports") diff -Nru augeas-1.3.0/lenses/grub.aug augeas-1.4.0/lenses/grub.aug --- augeas-1.3.0/lenses/grub.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/grub.aug 2015-06-01 22:03:07.000000000 +0000 @@ -84,7 +84,7 @@ let kw_menu_arg (kw:regexp) = kw_arg kw "" " " (* View: password_arg *) - let password_arg = [ key "password" . + let password_arg = [ command "password" "" . (spc . [ switch "md5" ])? . (spc . [ switch "encrypted" ])? . spc . store (/[^ \t\n]+/ - /--[^ \t\n]+/) . @@ -220,6 +220,7 @@ | map_line | kw_pres "lock" | kw_pres "makeactive" + | password_arg (* View: boot *) let boot = @@ -281,7 +282,8 @@ *************************************************************************) (* View: lns *) - let lns = (comment | empty | menu_setting | boot | debian)* + let lns = (comment | empty | menu_setting | debian)* + . (boot . (comment | empty | boot)*)? (* View: filter *) let filter = incl "/boot/grub/grub.conf" diff -Nru augeas-1.3.0/lenses/hosts.aug augeas-1.4.0/lenses/hosts.aug --- augeas-1.3.0/lenses/hosts.aug 2013-05-15 21:04:23.000000000 +0000 +++ augeas-1.4.0/lenses/hosts.aug 2015-05-22 22:31:25.000000000 +0000 @@ -3,23 +3,13 @@ module Hosts = autoload xfm - let sep_tab = Util.del_ws_tab - let sep_spc = Util.del_ws_spc - - let eol = Util.eol - let indent = Util.indent - - let comment = Util.comment - let comment_or_eol = Util.comment_or_eol - let empty = [ del /[ \t]*#?[ \t]*\n/ "\n" ] - let word = /[^# \n\t]+/ - let record = [ seq "host" . indent . - [ label "ipaddr" . store word ] . sep_tab . + let record = [ seq "host" . Util.indent . + [ label "ipaddr" . store word ] . Sep.tab . [ label "canonical" . store word ] . - [ label "alias" . sep_spc . store word ]* - . comment_or_eol ] + [ label "alias" . Sep.space . store word ]* + . Util.comment_or_eol ] - let lns = ( empty | comment | record ) * + let lns = ( Util.empty | Util.comment | record ) * let xfm = transform lns (incl "/etc/hosts") diff -Nru augeas-1.3.0/lenses/httpd.aug augeas-1.4.0/lenses/httpd.aug --- augeas-1.3.0/lenses/httpd.aug 2014-10-31 17:19:18.000000000 +0000 +++ augeas-1.4.0/lenses/httpd.aug 2015-06-01 23:08:37.000000000 +0000 @@ -59,7 +59,7 @@ let indent = Util.indent (* borrowed from shellvars.aug *) -let char_arg_dir = /[^ '"\t\r\n]|\\\\"|\\\\'/ +let char_arg_dir = /[^\\ '"\t\r\n]|\\\\"|\\\\'/ let char_arg_sec = /[^ '"\t\r\n>]|\\\\"|\\\\'/ let cdot = /\\\\./ let cl = /\\\\\n/ @@ -84,15 +84,16 @@ (sep_spc . argv arg_dir)? . eol ] let section (body:lens) = - let eol_comment = Util.comment_generic /[ \t\n]*#[ \t]*/ "# " in + (* opt_eol includes empty lines *) + let opt_eol = del /([ \t]*#?\r?\n)*/ "\n" in let inner = (sep_spc . argv arg_sec)? . sep_osp . - dels ">" . (eol|eol_comment) . (body . (body|comment)*)? . + dels ">" . opt_eol . ((body|comment) . (body|empty|comment)*)? . indent . dels "" ">" . eol ] -let rec content = section (content|directive|empty) +let rec content = section (content|directive) let lns = (content|directive|comment|empty)* @@ -100,6 +101,7 @@ (incl "/etc/apache2/httpd.conf") . (incl "/etc/apache2/ports.conf") . (incl "/etc/apache2/conf.d/*") . + (incl "/etc/apache2/conf-available/*.conf") . (incl "/etc/apache2/mods-available/*") . (incl "/etc/apache2/sites-available/*") . (incl "/etc/httpd/conf.d/*.conf") . diff -Nru augeas-1.3.0/lenses/iscsid.aug augeas-1.4.0/lenses/iscsid.aug --- augeas-1.3.0/lenses/iscsid.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/iscsid.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,28 @@ +(* +Module: Iscsid +Parses iscsid configuration file +Author: Joey Boggs +About: Reference +This lens is targeted at /etc/iscsi/iscsid.conf +*) +module Iscsid = + autoload xfm + + let filter = incl "/etc/iscsi/iscsid.conf" + + let eol = Util.eol + let indent = Util.indent + let key_re = /[][A-Za-z0-9_.-]+/ + let eq = del /[ \t]*=[ \t]*/ " = " + let value_re = /[^ \t\n](.*[^ \t\n])?/ + + let comment = [ indent . label "#comment" . del /[#;][ \t]*/ "# " + . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ] + + let empty = Util.empty + + let kv = [ indent . key key_re . eq . store value_re . eol ] + + let lns = (empty | comment | kv) * + + let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/jaas.aug augeas-1.4.0/lenses/jaas.aug --- augeas-1.3.0/lenses/jaas.aug 2013-05-17 03:35:24.000000000 +0000 +++ augeas-1.4.0/lenses/jaas.aug 2015-05-22 22:31:25.000000000 +0000 @@ -1,28 +1,36 @@ (* Module Jaas *) -(* Author: Simon Vocella *) +(* Original Author: Simon Vocella *) +(* Updated by: Steve Shipway *) +(* Changes: allow comments within Modules, allow optionless flags, *) +(* allow options without linebreaks, allow naked true/false options *) +(* Trailing ';' terminator should not be included in option value *) +(* Note: requires latest Util.aug for multiline comments to work *) module Jaas = autoload xfm let space_equal = del (/[ \t]*/ . "=" . /[ \t]*/) (" = ") -let lbrace = del (/[ \t\n]*/ . "{") "{" -let rbrace = del ("};") "};" +let lbrace = del (/[ \t\n]*\{[ \t]*\n/) " {\n" +let rbrace = del (/[ \t]*}[ \t]*;/) " };" let word = /[A-Za-z0-9_.-]+/ +let wsnl = del (/[ \t\n]+/) ("\n") +let endflag = del ( /[ \t]*;/ ) ( ";" ) let value_re = let value_squote = /'[^\n']*'/ - in let value_squote_2 = /'[^\n']*';/ in let value_dquote = /"[^\n"]*"/ - in let value_dquote_2 = /"[^\n"]*";/ - in value_squote | value_squote_2 | value_dquote | value_dquote_2 + in let value_tf = /(true|false)/ + in value_squote | value_dquote | value_tf -let moduleOption = [Util.del_opt_ws "" . key word . space_equal . (store value_re . Util.comment_or_eol)] -let flag = [label "flag" . (store word . Util.eol) . moduleOption*] -let loginModuleClass = [Util.del_opt_ws "" . label "loginModuleClass" . (store word . Util.del_ws_spc) . flag] +let moduleOption = [ wsnl . key word . space_equal . (store value_re) ] +let moduleSuffix = ( moduleOption | Util.eol . Util.comment_c_style | Util.comment_multiline ) +let flag = [ Util.del_ws_spc . label "flag" . (store word) . moduleSuffix* . endflag ] +let loginModuleClass = [( Util.del_opt_ws "" . label "loginModuleClass" . (store word) . flag ) ] let content = (Util.empty | Util.comment_c_style | Util.comment_multiline | loginModuleClass)* let loginModule = [Util.del_opt_ws "" . label "login" . (store word . lbrace) . (content . rbrace)] + let lns = (Util.empty | Util.comment_c_style | Util.comment_multiline | loginModule)* let filter = incl "/opt/shibboleth-idp/conf/login.config" let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/known_hosts.aug augeas-1.4.0/lenses/known_hosts.aug --- augeas-1.3.0/lenses/known_hosts.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/known_hosts.aug 2015-06-01 22:03:07.000000000 +0000 @@ -32,12 +32,15 @@ (* View: entry A known_hosts entry *) -let entry = [ Util.indent . seq "entry" . store Rx.neg1 - . Sep.space - . [ label "type" . store Rx.no_spaces ] - . Sep.space - . [ label "key" . store Rx.no_spaces ] - . Util.eol ] +let entry = + let alias = [ label "alias" . store Rx.neg1 ] + in [ Util.indent . seq "entry" . store Rx.neg1 + . (Sep.comma . Build.opt_list alias Sep.comma)? + . Sep.space + . [ label "type" . store Rx.no_spaces ] + . Sep.space + . [ label "key" . store Rx.no_spaces ] + . Util.eol ] (* View: lns The known_hosts lens *) diff -Nru augeas-1.3.0/lenses/krb5.aug augeas-1.4.0/lenses/krb5.aug --- augeas-1.3.0/lenses/krb5.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/krb5.aug 2015-05-22 22:31:25.000000000 +0000 @@ -22,6 +22,7 @@ *) let realm_re = /[A-Z][.a-zA-Z0-9-]*/ +let realm_anycase_re = /[A-Za-z][.a-zA-Z0-9-]*/ let app_re = /[a-z][a-zA-Z0-9_]*/ let name_re = /[.a-zA-Z0-9_-]+/ @@ -84,14 +85,14 @@ let realms = let simple_option = /kdc|admin_server|database_module|default_domain/ |/v4_realm|auth_to_local(_names)?|master_kdc|kpasswd_server/ - |/admin_server|ticket_lifetime|pkinit_anchors/ in + |/admin_server|ticket_lifetime|pkinit_anchors|krb524_server/ in let subsec_option = /v4_instance_convert/ in let option = subsec_entry simple_option eq comment in let subsec = [ indent . key subsec_option . eq_openbr . (subsec_entry name_re eq comment)* . closebr . eol ] in let v4subsec = [ indent . key /host|plain/ . eq_openbr . (subsec_entry name_re eq comment)* . closebr . eol ] in - let realm = [ indent . label "realm" . store realm_re . + let realm = [ indent . label "realm" . store realm_anycase_re . eq_openbr . (option|subsec|(v4_name_convert v4subsec))* . closebr . eol ] in record "realms" (realm|comment) diff -Nru augeas-1.3.0/lenses/limits.aug augeas-1.4.0/lenses/limits.aug --- augeas-1.3.0/lenses/limits.aug 2012-11-02 15:20:11.000000000 +0000 +++ augeas-1.4.0/lenses/limits.aug 2015-05-22 22:31:25.000000000 +0000 @@ -14,6 +14,7 @@ *************************************************************************) let eol = Util.eol +let comment_or_eol = Util.comment_or_eol let spc = Util.del_ws_spc let comment = Util.comment let empty = Util.empty @@ -56,7 +57,7 @@ let entry = [ domain . spc . type . spc . item . spc - . value . eol ] + . value . comment_or_eol ] (************************************************************************ * LENS diff -Nru augeas-1.3.0/lenses/logrotate.aug augeas-1.4.0/lenses/logrotate.aug --- augeas-1.3.0/lenses/logrotate.aug 2012-11-02 15:20:11.000000000 +0000 +++ augeas-1.4.0/lenses/logrotate.aug 2015-05-22 22:31:25.000000000 +0000 @@ -57,37 +57,39 @@ let attrs = select_to_eol "schedule" /(daily|weekly|monthly|yearly)/ | value_to_eol "rotate" num - | create - | flag_to_eol "nocreate" - | su - | value_to_eol "include" word - | select_to_eol "missingok" /(no)?missingok/ - | select_to_eol "compress" /(no)?compress/ - | select_to_eol "delaycompress" /(no)?delaycompress/ - | select_to_eol "ifempty" /(not)?ifempty/ - | select_to_eol "sharedscripts" /(no)?sharedscripts/ - | value_to_eol "size" size - | tabooext - | value_to_eol "olddir" word - | flag_to_eol "noolddir" - | value_to_eol "mail" word - | flag_to_eol "mailfirst" - | flag_to_eol "maillast" - | flag_to_eol "nomail" - | value_to_eol "errors" word - | value_to_eol "extension" word - | select_to_eol "dateext" /(no)?dateext/ - | value_to_eol "compresscmd" word - | value_to_eol "uncompresscmd" word - | value_to_eol "compressext" word - | list_to_eol "compressoptions" - | select_to_eol "copy" /(no)?copy/ - | select_to_eol "copytruncate" /(no)?copytruncate/ - | value_to_eol "maxage" num - | value_to_eol "minsize" size - | select_to_eol "shred" /(no)?shred/ - | value_to_eol "shredcycles" num - | value_to_eol "start" num + | create + | flag_to_eol "nocreate" + | su + | value_to_eol "include" word + | select_to_eol "missingok" /(no)?missingok/ + | select_to_eol "compress" /(no)?compress/ + | select_to_eol "delaycompress" /(no)?delaycompress/ + | select_to_eol "ifempty" /(not)?ifempty/ + | select_to_eol "sharedscripts" /(no)?sharedscripts/ + | value_to_eol "size" size + | tabooext + | value_to_eol "olddir" word + | flag_to_eol "noolddir" + | value_to_eol "mail" word + | flag_to_eol "mailfirst" + | flag_to_eol "maillast" + | flag_to_eol "nomail" + | value_to_eol "errors" word + | value_to_eol "extension" word + | select_to_eol "dateext" /(no)?dateext/ + | value_to_eol "dateformat" word + | value_to_eol "compresscmd" word + | value_to_eol "uncompresscmd" word + | value_to_eol "compressext" word + | list_to_eol "compressoptions" + | select_to_eol "copy" /(no)?copy/ + | select_to_eol "copytruncate" /(no)?copytruncate/ + | value_to_eol "maxage" num + | value_to_eol "minsize" size + | value_to_eol "maxsize" size + | select_to_eol "shred" /(no)?shred/ + | value_to_eol "shredcycles" num + | value_to_eol "start" num (* Define hooks *) @@ -118,6 +120,6 @@ let filter = incl "/etc/logrotate.d/*" . incl "/etc/logrotate.conf" - . Util.stdexcl + . Util.stdexcl let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/mailscanner.aug augeas-1.4.0/lenses/mailscanner.aug --- augeas-1.3.0/lenses/mailscanner.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/mailscanner.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,65 @@ +(* +Module: Mailscanner + Parses MailScanner configuration files. + +Author: Andrew Colin Kissa + Baruwa Enterprise Edition http://www.baruwa.com + +About: License + This file is licensed under the LGPL v2+. + +About: Configuration files + This lens applies to /etc/MailScanner/MailScanner.conf and files in + /etc/MailScanner/conf.d/. See . +*) + +module Mailscanner = +autoload xfm + +(************************************************************************ + * Group: USEFUL PRIMITIVES + *************************************************************************) +let comment = Util.comment + +let empty = Util.empty + +let space = Sep.space + +let eol = Util.eol + +let non_eq = /[^ =\t\r\n]+/ + +let non_space = /[^# \t\n]/ + +let any = /.*/ + +let word = /[A-Za-z%][ :<>%A-Za-z0-9_.-]+[A-Za-z%2]/ + +let include_kw = /include/ + +let keys = word - include_kw + +let eq = del /[ \t]*=/ " =" + +let indent = del /[ \t]*(\n[ \t]+)?/ " " + +let line_value = store (non_space . any . non_space | non_space) + +(************************************************************************ + * Group: Entries + *************************************************************************) + +let include_line = Build.key_value_line include_kw space (store non_eq) + +let normal_line = [ key keys . eq . (indent . line_value)? . eol ] + +(************************************************************************ + * Group: Lns and Filter + *************************************************************************) + +let lns = (empty|include_line|normal_line|comment) * + +let filter = (incl "/etc/MailScanner/MailScanner.conf") + . (incl "/etc/MailScanner/conf.d/*.conf") + +let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/mailscanner_rules.aug augeas-1.4.0/lenses/mailscanner_rules.aug --- augeas-1.3.0/lenses/mailscanner_rules.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/mailscanner_rules.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,75 @@ +(* +Module: Mailscanner_rules + Parses MailScanner rules files. + +Author: Andrew Colin Kissa + Baruwa Enterprise Edition http://www.baruwa.com + +About: License + This file is licensed under the LGPL v2+. + +About: Configuration files + This lens applies to MailScanner rules files + The format is described below: + + # NOTE: Fields are separated by TAB characters --- Important! + # + # Syntax is allow/deny/deny+delete/rename/rename to replacement-text/email-addresses, + # then regular expression, + # then log text, + # then user report text. + # The "email-addresses" can be a space or comma-separated list of email + # addresses. If the rule hits, the message will be sent to these address(es) + # instead of the original recipients. + + # If a rule is a "rename" rule, then the attachment filename will be renamed + # according to the "Default Rename Pattern" setting in MailScanner.conf. + # If a rule is a "rename" rule and the "to replacement-text" is supplied, then + # the text matched by the regular expression in the 2nd field of the line + # will be replaced with the "replacement-text" string. + # For example, the rule + # rename to .ppt \.pps$ Renamed .pps to .ppt Renamed .pps to .ppt + # will find all filenames ending in ".pps" and rename them so they end in + # ".ppt" instead. +*) + +module Mailscanner_Rules = +autoload xfm + +(************************************************************************ + * USEFUL PRIMITIVES + *************************************************************************) + +let eol = del /\n/ "\n" +let ws = del /[\t]+/ "\t" +let comment = Util.comment +let empty = Util.empty +let action = /allow|deny|deny\+delete|rename|rename[ ]+to[ ]+[^# \t\n]+|([A-Za-z0-9_+.-]+@[A-Za-z0-9_.-]+[, ]?)+/ +let non_space = /[^# \t\n]+/ +let non_tab = /[^\t\n]+/ + +let field (l:string) (r:regexp) + = [ label l . store r ] + +(************************************************************************ + * ENTRIES + *************************************************************************) + +let entry = [ seq "rule" . field "action" action + . ws . field "regex" non_tab + . ws . field "log-text" non_tab + . ws . field "user-report" non_tab + . eol ] + +(************************************************************************ + * LENS + *************************************************************************) + +let lns = (comment|empty|entry)* + +let filter = (incl "/etc/MailScanner/filename.rules.conf") + . (incl "/etc/MailScanner/filetype.rules.conf") + . (incl "/etc/MailScanner/archives.filename.rules.conf") + . (incl "/etc/MailScanner/archives.filetype.rules.conf") + +let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/mcollective.aug augeas-1.4.0/lenses/mcollective.aug --- augeas-1.3.0/lenses/mcollective.aug 2012-11-02 15:20:11.000000000 +0000 +++ augeas-1.4.0/lenses/mcollective.aug 2015-06-01 22:03:07.000000000 +0000 @@ -35,5 +35,7 @@ let filter = incl "/etc/mcollective/client.cfg" . incl "/etc/mcollective/server.cfg" + . incl "/etc/puppetlabs/mcollective/client.cfg" + . incl "/etc/puppetlabs/mcollective/server.cfg" let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/nagioscfg.aug augeas-1.4.0/lenses/nagioscfg.aug --- augeas-1.3.0/lenses/nagioscfg.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/nagioscfg.aug 2015-05-22 22:31:25.000000000 +0000 @@ -26,7 +26,7 @@ let param_def = let space_in = /[^ \t\n][^\n=]*[^ \t\n]|[^ \t\n]/ in key /[A-Za-z0-9_]+/ - . Sep.space_equal + . Sep.opt_space . Sep.equal . Sep.opt_space . store space_in (* View: macro_def diff -Nru augeas-1.3.0/lenses/nginx.aug augeas-1.4.0/lenses/nginx.aug --- augeas-1.3.0/lenses/nginx.aug 2014-10-31 17:19:18.000000000 +0000 +++ augeas-1.4.0/lenses/nginx.aug 2015-06-01 22:03:07.000000000 +0000 @@ -33,28 +33,75 @@ (* Variable: block_re The keywords reserved for block entries *) -let block_re = "http" | "events" - | "server" | "upstream" - | "location" | "if" +let block_re = "http" | "events" | "server" | "mail" | "stream" + +(* All block keywords, including the ones we treat specially *) +let block_re_all = block_re | "if" | "location" | "geo" | "map" + | "split_clients" | "upstream" (* View: simple A simple entry *) -let simple = - let kw = Rx.word - block_re +let simple = + let kw = Rx.word - block_re_all in let sto = store /[^ \t\n;][^;]*/ . Sep.semicolon - in Build.key_value_line_comment - kw Sep.space sto Util.comment_eol + in [ Util.indent . key kw . Sep.space . sto . (Util.eol|Util.comment_eol) ] + +let arg (name:string) (rx:regexp) = + [ label name . Sep.space . store rx ] + +(* Match any argument (as much as possible) *) +let any_rx = + let bare_rx = /[^" \t\n{][^ \t\n{]*/ in + let dquote_rx = /"([^\"]|\\.)*"/ in + bare_rx | dquote_rx + +let any_arg (name:string) = arg name any_rx + +(* 'if' conditions are enclosed in matching parens which we can't match + precisely with a regular expression. Instead, we gobble up anything that + doesn't contain an opening brace. That can of course lead to trouble if + a condition actually contains an opening brace *) +let block_if = key "if" + . arg "#cond" /\(([^ \t\n{]|[ \t\n][^{])*\)/ + +let block_location = key "location" + . (arg "#comp" /=|~|~\*|\^~/)? + . any_arg "#uri" + +let block_geo = key "geo" + . (any_arg "#address")? + . any_arg "#geo" + +let block_map = key "map" + . any_arg "#source" + . any_arg "#variable" + +let block_split_clients = key "split_clients" + . any_arg "#string" + . any_arg "#variable" + +let block_upstream = key "upstream" + . any_arg "#name" + +let block_head = key block_re + | block_if + | block_location + | block_geo + | block_map + | block_split_clients + | block_upstream (* View: block A block containing entries *) -let block = - let entry = Util.indent . simple - in [ key block_re - . Build.block_newlines entry Util.comment - . Util.eol ] +let block (entry : lens) = + [ Util.indent . block_head + . Build.block_newlines entry Util.comment + . Util.eol ] + +let rec directive = simple | block directive (* View: lns *) -let lns = ( Util.comment | Util.empty | simple | block )* +let lns = ( Util.comment | Util.empty | directive )* (* Variable: filter *) let filter = incl "/etc/nginx/nginx.conf" diff -Nru augeas-1.3.0/lenses/pagekite.aug augeas-1.4.0/lenses/pagekite.aug --- augeas-1.3.0/lenses/pagekite.aug 2014-10-17 16:41:03.000000000 +0000 +++ augeas-1.4.0/lenses/pagekite.aug 2015-05-22 22:31:25.000000000 +0000 @@ -1,5 +1,5 @@ (* -Module: Hostname +Module: Pagekite Parses /etc/pagekite.d/ Author: Michael Pimmer @@ -16,6 +16,7 @@ (* Variables *) let equals = del /[ \t]*=[ \t]*/ "=" let neg2 = /[^# \n\t]+/ +let neg3 = /[^# \:\n\t]+/ let eol = del /\n/ "\n" (* Match everything from here to eol, cropping whitespace at both ends *) let to_eol = /[^ \t\n](.*[^ \t\n])?/ @@ -44,14 +45,16 @@ "ca_certs" | "tls_endpoint" ) equals (store Rx.neg1) -(* entries for 80_*.rc *) +(* entries for services like 80_httpd.rc *) let service_colon = del /[ \t]*:[ \t]*/ " : " -let store_domain = store /[^: \t\n]+:[^: \t\n]+/ let service_on = [ key "service_on" . [ seq "service_on" . equals . - [ label "source" . store_domain ] . service_colon . - [label "destination" . store_domain] . service_colon . ( - [ label "secret" . store Rx.no_spaces . Util.eol ] | eol + [ label "protocol" . store neg3 ] . service_colon . + [ label "kitename" . (store neg3) ] . service_colon . + [ label "backend_host" . (store neg3) ] . service_colon . + [ label "backend_port" . (store neg3) ] . service_colon . ( + [ label "secret" . (store Rx.no_spaces) . Util.eol ] | eol ) ] ] + let service_cfg = [ key "service_cfg" . equals . store to_eol . eol ] let flags = ( "defaults" | "isfrontend" | "abort_not_configured" | "insecure" ) diff -Nru augeas-1.3.0/lenses/passwd.aug augeas-1.4.0/lenses/passwd.aug --- augeas-1.3.0/lenses/passwd.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/passwd.aug 2015-06-01 22:47:42.000000000 +0000 @@ -35,11 +35,15 @@ let sto_to_eol = store Rx.space_in let sto_to_col = store /[^:\r\n]+/ +(* Store an empty string if nothing matches *) +let sto_to_col_or_empty = store /[^:\r\n]*/ (************************************************************************ * Group: ENTRIES *************************************************************************) +let username = /[_.A-Za-z0-9][-_.A-Za-z0-9]*\$?/ + (* View: password pw_passwd *) let password = [ label "password" . sto_to_col? . colon ] @@ -66,7 +70,7 @@ (* View: entry struct passwd *) -let entry = [ key word +let entry = [ key username . colon . password . uid @@ -76,22 +80,36 @@ . shell . eol ] -(* A NIS entry has nothing bar the +@:::::: bits. *) +(* NIS entries *) +let niscommon = [ label "password" . sto_to_col ]? . colon + . [ label "uid" . store integer ]? . colon + . [ label "gid" . store integer ]? . colon + . [ label "name" . sto_to_col ]? . colon + . [ label "home" . sto_to_col ]? . colon + . [ label "shell" . sto_to_eol ]? + let nisentry = let overrides = colon - . [ label "password" . sto_to_col ]? . colon - . [ label "uid" . store integer ]? . colon - . [ label "gid" . store integer ]? . colon - . [ label "name" . sto_to_col ]? . colon - . [ label "home" . sto_to_col ]? . colon - . [ label "shell" . sto_to_eol ]? in - [ dels "+@" . label "@nis" . store word . overrides . eol ] + . niscommon in + [ dels "+@" . label "@nis" . store username . overrides . eol ] + +let nisuserplus = + let overrides = + colon + . niscommon in + [ dels "+" . label "@+nisuser" . store username . overrides . eol ] + +let nisuserminus = + let overrides = + colon + . niscommon in + [ dels "-" . label "@-nisuser" . store username . overrides . eol ] let nisdefault = let overrides = colon - . [ label "password" . store word? . colon ] + . [ label "password" . sto_to_col_or_empty . colon ] . [ label "uid" . store integer? . colon ] . [ label "gid" . store integer? . colon ] . [ label "name" . sto_to_col? . colon ] @@ -103,7 +121,7 @@ * LENS *************************************************************************) -let lns = (comment|empty|entry|nisentry|nisdefault) * +let lns = (comment|empty|entry|nisentry|nisdefault|nisuserplus|nisuserminus) * let filter = incl "/etc/passwd" diff -Nru augeas-1.3.0/lenses/pgbouncer.aug augeas-1.4.0/lenses/pgbouncer.aug --- augeas-1.3.0/lenses/pgbouncer.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/pgbouncer.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,55 @@ +(* +Module: Pgbouncer + Parses Pgbouncer ini configuration files. + +Author: Andrew Colin Kissa + Baruwa Enterprise Edition http://www.baruwa.com + +About: License + This file is licensed under the LGPL v2+. + +About: Configuration files + This lens applies to /etc/pgbouncer.ini See . + +About: TODO + Create a tree for the database options +*) + +module Pgbouncer = +autoload xfm + +(************************************************************************ + * Group: USEFUL PRIMITIVES + ************************************************************************) + +let comment = IniFile.comment IniFile.comment_re IniFile.comment_default + +let sep = IniFile.sep "=" "=" + +let eol = Util.eol + +let entry_re = ( /[A-Za-z][:#A-Za-z0-9._-]+|\*/) + +(************************************************************************ + * Group: ENTRY + *************************************************************************) + +let non_db_line = [ key entry_re . sep . IniFile.sto_to_eol? . eol ] + +let entry = non_db_line|comment + +let title = IniFile.title IniFile.record_re + +let record = IniFile.record title entry + +(****************************************************************** + * Group: LENS AND FILTER + ******************************************************************) + +let lns = IniFile.lns record comment + +(* Variable: filter *) +let filter = incl "/etc/pgbouncer.ini" + +let xfm = transform lns filter + diff -Nru augeas-1.3.0/lenses/postfix_sasl_smtpd.aug augeas-1.4.0/lenses/postfix_sasl_smtpd.aug --- augeas-1.3.0/lenses/postfix_sasl_smtpd.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/postfix_sasl_smtpd.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,22 @@ +module Postfix_sasl_smtpd = + autoload xfm + + let eol = Util.eol + let colon = del /:[ \t]*/ ": " + let value_to_eol = store Rx.space_in + + let simple_entry (kw:string) = [ key kw . colon . value_to_eol . eol ] + + let entries = simple_entry "pwcheck_method" + | simple_entry "auxprop_plugin" + | simple_entry "saslauthd_path" + | simple_entry "mech_list" + | simple_entry "sql_engine" + | simple_entry "log_level" + | simple_entry "auto_transition" + + let lns = entries+ + + let filter = incl "/etc/postfix/sasl/smtpd.conf" + + let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/postgresql.aug augeas-1.4.0/lenses/postgresql.aug --- augeas-1.3.0/lenses/postgresql.aug 2012-12-17 21:39:45.000000000 +0000 +++ augeas-1.4.0/lenses/postgresql.aug 2015-05-22 22:31:25.000000000 +0000 @@ -69,7 +69,9 @@ let lns = (Util.empty | Util.comment | entry)* (* Variable: filter *) -let filter = incl "/etc/postgresql/*/*/postgresql.conf" +let filter = (incl "/var/lib/pgsql/data/postgresql.conf" . + incl "/var/lib/pgsql/*/data/postgresql.conf" . + incl "/etc/postgresql/*/*/postgresql.conf" ) let xfm = transform lns filter diff -Nru augeas-1.3.0/lenses/puppetfile.aug augeas-1.4.0/lenses/puppetfile.aug --- augeas-1.3.0/lenses/puppetfile.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/puppetfile.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,52 @@ +(* +Module: Puppetfile + Parses libarian-puppet's Puppetfile format + +Author: Raphael Pinson + +About: Reference + See https://github.com/rodjek/librarian-puppet + +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 Puppetfiles. + +About: Examples + The file contains various examples and tests. +*) + +module Puppetfile = + +(* View: comma + a comma, optionally preceded or followed by spaces or newlines *) +let comma = del /[ \t\n]*,[ \t\n]*/ ", " + +(* View: forge + a forge entry *) +let forge = [ Util.indent . key "forge" . Sep.space . Quote.any . Util.eol ] + +(* View: metadata + a metadata entry *) +let metadata = [ Util.indent . key "metadata" . Util.eol ] + +(* View: mod + a module entry, with optional version and options *) +let mod = + let mod_name = Quote.do_quote (store (Rx.word . /[\/-]/ . Rx.word)) + in let version = [ label "@version" . Quote.do_quote (store /[^:\n]+/) ] + in let opt = [ Util.del_str ":" . key Rx.word . del /[ \t]*=>[ \t]*/ " => " + . Quote.do_quote (store /[^,\n]*/) ] + in let opts = Build.opt_list opt comma + in [ Util.indent . Util.del_str "mod" . seq "mod" . Sep.space . mod_name + . (comma . version)? + . (comma . opts)? + . Util.eol ] + +(* View: lns + the Puppetfile lens *) +let lns = (Util.empty | Util.comment | forge | metadata | mod)* diff -Nru augeas-1.3.0/lenses/pylonspaste.aug augeas-1.4.0/lenses/pylonspaste.aug --- augeas-1.3.0/lenses/pylonspaste.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/pylonspaste.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,78 @@ +(* +Module: PylonsPaste + Parses Pylons Paste ini configuration files. + +Author: Andrew Colin Kissa + Baruwa Enterprise Edition http://www.baruwa.com + +About: License + This file is licensed under the LGPL v2+. + +About: Configuration files + This lens applies to /etc/baruwa See . +*) + +module Pylonspaste = +autoload xfm + +(************************************************************************ + * Group: USEFUL PRIMITIVES + *************************************************************************) + +let comment = IniFile.comment IniFile.comment_re IniFile.comment_default + +let sep = IniFile.sep "=" "=" + +let eol = Util.eol + +let optspace = del /\n/ "\n" + +let entry_re = ( /[A-Za-z][:#A-Za-z0-9._-]+/) + +let plugin_re = /[A-Za-z][;:#A-Za-z0-9._-]+/ + +let plugins_kw = /plugins/ + +let debug_kw = /debug/ + +let normal_opts = entry_re - (debug_kw|plugins_kw) + +let del_opt_ws = del /[\t ]*/ "" + +let new_ln_sep = optspace . del_opt_ws . store plugin_re + +let plugins_multiline = sep . counter "items" . [ seq "items" . new_ln_sep]* + +let sto_multiline = optspace . Sep.opt_space . store (Rx.space_in . (/[ \t]*\n/ . Rx.space . Rx.space_in)*) + +(************************************************************************ + * Group: ENTRY + *************************************************************************) + +let set_option = Util.del_str "set " +let no_inline_comment_entry (kw:regexp) (sep:lens) (comment:lens) = + [ set_option . key debug_kw . sep . IniFile.sto_to_eol . eol ] + | [ key plugins_kw . plugins_multiline . eol] + | [ key kw . sep . IniFile.sto_to_eol? . eol ] + | comment + +let entry = no_inline_comment_entry normal_opts sep comment + +(************************************************************************ + * RECORD + *************************************************************************) + +let title = IniFile.title IniFile.record_re + +let record = IniFile.record title entry + +(************************************************************************ + * Group: LENS & FILTER + *************************************************************************) + +let lns = IniFile.lns record comment + +let filter = incl "/etc/baruwa/*.ini" + +let xfm = transform lns filter + diff -Nru augeas-1.3.0/lenses/pythonpaste.aug augeas-1.4.0/lenses/pythonpaste.aug --- augeas-1.3.0/lenses/pythonpaste.aug 2013-02-06 20:31:01.000000000 +0000 +++ augeas-1.4.0/lenses/pythonpaste.aug 2015-05-22 22:31:25.000000000 +0000 @@ -20,8 +20,10 @@ let url_entry = /\/[\/A-Za-z0-9.-_]* ?[:|=] [A-Za-z0-9.-_]+/ +let set_kw = [ Util.del_str "set" . Util.del_ws_spc . label "@set" ] + let no_inline_comment_entry (kw:regexp) (sep:lens) (comment:lens) - = [ key kw . sep . IniFile.sto_to_eol? . eol ] + = [ set_kw? . key kw . sep . IniFile.sto_to_eol? . eol ] | comment | [ seq "urls" . store url_entry . eol ] diff -Nru augeas-1.3.0/lenses/shadow.aug augeas-1.4.0/lenses/shadow.aug --- augeas-1.3.0/lenses/shadow.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/shadow.aug 2015-06-01 22:03:07.000000000 +0000 @@ -45,25 +45,34 @@ (************************************************************************ * Group: ENTRIES *************************************************************************) - +(* Common for entry and nisdefault *) +let common = [ 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? ] + (* 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 ] +let entry = [ key word + . colon + . [ label "password" . sto_to_col? . colon ] + . common + . eol ] + +let nisdefault = + let overrides = + colon + . [ label "password" . store word? . colon ] + . common in + [ dels "+" . label "@nisdefault" . overrides? . eol ] (************************************************************************ * LENS *************************************************************************) -let lns = (comment|empty|entry) * +let lns = (comment|empty|entry|nisdefault) * let filter = incl "/etc/shadow" diff -Nru augeas-1.3.0/lenses/shellvars.aug augeas-1.4.0/lenses/shellvars.aug --- augeas-1.3.0/lenses/shellvars.aug 2014-10-17 15:52:20.000000000 +0000 +++ augeas-1.4.0/lenses/shellvars.aug 2015-06-01 22:03:07.000000000 +0000 @@ -13,12 +13,15 @@ module Shellvars = autoload xfm + (* Delete a blank line, rather than mapping it *) + let del_empty = del (Util.empty_generic_re . "\n") "\n" + let empty = Util.empty let empty_part_re = Util.empty_generic_re . /\n+/ let eol = del (/[ \t]+|[ \t]*[;\n]/ . empty_part_re*) "\n" let semicol_eol = del (/[ \t]*[;\n]/ . empty_part_re*) "\n" - let key_re = /[A-Za-z0-9_]+(\[[0-9]+\])?/ - ("unset" | "export") + let key_re = /[A-Za-z0-9_]+(\[[0-9A-Za-z_,]+\])?/ - ("unset" | "export") let matching_re = "${!" . key_re . /[\*@]\}/ let eq = Util.del_str "=" @@ -140,7 +143,7 @@ let case_entry = [ label "@case_entry" . Util.indent . store /[^ \t\n\)]+/ . Util.del_str ")" . eol - . ( entry+ | entry_noeol )? + . entry* . entry_noeol? . Util.indent . Util.del_str ";;" . eol ] in [ keyword_label "case" "@case" . Sep.space . store (char+ | ("\"" . char+ . "\"")) @@ -186,9 +189,9 @@ | case entry entry_noeol | function entry - let lns_norec = empty* . (comment | entry_eol) * + let lns_norec = del_empty* . (comment | entry_eol) * - let lns = empty* . (comment | entry_eol | rec_entry) * + let lns = del_empty* . (comment | entry_eol | rec_entry) * let sc_incl (n:string) = (incl ("/etc/sysconfig/" . n)) let sc_excl (n:string) = (excl ("/etc/sysconfig/" . n)) @@ -244,6 +247,7 @@ . incl "/etc/lintianrc" . incl "/etc/lsb-release" . incl "/etc/os-release" + . incl "/etc/periodic.conf" . incl "/etc/popularity-contest.conf" . incl "/etc/rc.conf" . incl "/etc/rc.conf.local" diff -Nru augeas-1.3.0/lenses/shellvars_list.aug augeas-1.4.0/lenses/shellvars_list.aug --- augeas-1.3.0/lenses/shellvars_list.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/shellvars_list.aug 2015-05-22 22:31:25.000000000 +0000 @@ -17,22 +17,24 @@ let dqword = /([^ "\\\t\n]|\\\\.)+/ let uqword = /([^ `"'\\\t\n]|\\\\.)+/ let bqword = /`[^`\n]*`/ + let space_or_nl = /[ \t\n]+/ + let space_or_cl = space_or_nl | Rx.cl (* lists values of the form ... val1 val2 val3 ... *) - let list(word:regexp) = + let list (word:regexp) (sep:regexp) = let list_value = store word in indent . [ label "value" . list_value ] . - [ del /[ \t\n]+/ " " . label "value" . list_value ]* . indent + [ del sep " " . label "value" . list_value ]* . indent (* handle single quoted lists *) let squote_arr = [ label "quote" . store /'/ ] - . (list sqword)? . del /'/ "'" + . (list sqword space_or_nl)? . del /'/ "'" (* similarly handle double qouted lists *) let dquote_arr = [ label "quote" . store /"/ ] - . (list dqword)? . del /"/ "\"" + . (list dqword space_or_cl)? . del /"/ "\"" (* handle unquoted single value *) let unquot_val = [ label "quote" . store "" ] diff -Nru augeas-1.3.0/lenses/ssh.aug augeas-1.4.0/lenses/ssh.aug --- augeas-1.3.0/lenses/ssh.aug 2014-10-17 15:52:20.000000000 +0000 +++ augeas-1.4.0/lenses/ssh.aug 2015-05-22 22:31:25.000000000 +0000 @@ -51,7 +51,7 @@ let commas_entry (k:regexp) = let value = [ seq "commas_entry" . value_to_comma] - in [ key k . counter "commas_entry" . spc . + in [ indent . key k . counter "commas_entry" . spc . Build.opt_list value comma . eol ] let fw_entry (k:regexp) = [ indent . key k . spc . diff -Nru augeas-1.3.0/lenses/sudoers.aug augeas-1.4.0/lenses/sudoers.aug --- augeas-1.3.0/lenses/sudoers.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/sudoers.aug 2015-05-22 22:31:25.000000000 +0000 @@ -105,7 +105,7 @@ Escaped spaces and NIS domains and allowed*) let sto_to_com_user = let nis_re = /([A-Z]([-A-Z0-9]|(\\\\[ \t]))*+\\\\\\\\)/ - in let user_re = /[%+@a-z]([-A-Za-z0-9._]|(\\\\[ \t]))*/ + in let user_re = /[%+@a-z]([-A-Za-z0-9._+]|(\\\\[ \t]))*/ in let alias_re = /[A-Z_]+/ in store ((nis_re? . user_re) | alias_re) diff -Nru augeas-1.3.0/lenses/sysconfig.aug augeas-1.4.0/lenses/sysconfig.aug --- augeas-1.3.0/lenses/sysconfig.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/sysconfig.aug 2015-05-22 22:31:25.000000000 +0000 @@ -46,8 +46,10 @@ let word = char* . "\"" . char* in Quote.do_squote (store word+) - let export = Shellvars.export - let kv (value:lens) = [ export? . key key_re . eq . value . comment_or_eol ] + let kv (value:lens) = + let export = Shellvars.export in + let indent = Util.del_opt_ws "" in + [ indent . export? . key key_re . eq . value . comment_or_eol ] let assign = let nothing = del /(""|'')?/ "" . value "" in diff -Nru augeas-1.3.0/lenses/sysctl.aug augeas-1.4.0/lenses/sysctl.aug --- augeas-1.3.0/lenses/sysctl.aug 2013-01-04 00:04:02.000000000 +0000 +++ augeas-1.4.0/lenses/sysctl.aug 2015-06-01 22:03:07.000000000 +0000 @@ -23,7 +23,8 @@ autoload xfm (* Variable: filter *) -let filter = incl "/etc/sysctl.conf" +let filter = incl "/boot/loader.conf" + . incl "/etc/sysctl.conf" . incl "/etc/sysctl.d/*" . excl "/etc/sysctl.d/README" . excl "/etc/sysctl.d/README.sysctl" diff -Nru augeas-1.3.0/lenses/tests/test_afs_cellalias.aug augeas-1.4.0/lenses/tests/test_afs_cellalias.aug --- augeas-1.3.0/lenses/tests/test_afs_cellalias.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_afs_cellalias.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,42 @@ +(* +Module: Test_AFS_cellalias + Provides unit tests and examples for the lens. +*) + +module Test_AFS_cellalias = + +(* Variable: conf + A full configuration *) +let conf = "# Cell Aliases are meant to act like symlinks like '/afs/openafs.org -> oao' +# in root.afs, so sites relying on such a link for their cell can use dynroot. +# These aliases are set with 'fs newalias', or read from +# /usr/vice/etc/CellAlias +# +# Formating for /usr/vice/etc/CellAlias is in the form +# +# an example would be +# fnal.gov/common/usr usr + +fnal.gov fnal +fnal.gov/files fnal-files +" + +(* Test: AFS_cellalias.lns + Test the full *) +test AFS_cellalias.lns get conf = { "#comment" = "Cell Aliases are meant to act like symlinks like '/afs/openafs.org -> oao'" } + { "#comment" = "in root.afs, so sites relying on such a link for their cell can use dynroot." } + { "#comment" = "These aliases are set with 'fs newalias', or read from" } + { "#comment" = "/usr/vice/etc/CellAlias" } + { } + { "#comment" = "Formating for /usr/vice/etc/CellAlias is in the form" } + { "#comment" = " " } + { "#comment" = "an example would be" } + { "#comment" = "fnal.gov/common/usr usr" } + { } + { "target" = "fnal.gov" + { "linkname" = "fnal" } + } + { "target" = "fnal.gov/files" + { "linkname" = "fnal-files" } + } + diff -Nru augeas-1.3.0/lenses/tests/test_authorized_keys.aug augeas-1.4.0/lenses/tests/test_authorized_keys.aug --- augeas-1.3.0/lenses/tests/test_authorized_keys.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_authorized_keys.aug 2015-05-22 22:31:25.000000000 +0000 @@ -115,3 +115,14 @@ } { "type" = "ssh-dsa" } } + +(* Test: Authorized_keys.lns + GH 165 *) +test Authorized_keys.lns get "command=\"echo 'Please login as the user \\\"blaauser\\\" rather than the user \\\"root\\\".';echo;sleep 10\" ssh-rsa DEADBEEF== username1\n" = + { "key" = "DEADBEEF==" + { "options" + { "command" = "echo 'Please login as the user \\\"blaauser\\\" rather than the user \\\"root\\\".';echo;sleep 10" } + } + { "type" = "ssh-rsa" } + { "comment" = "username1" } + } diff -Nru augeas-1.3.0/lenses/tests/test_chrony.aug augeas-1.4.0/lenses/tests/test_chrony.aug --- augeas-1.3.0/lenses/tests/test_chrony.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_chrony.aug 2015-05-22 22:31:25.000000000 +0000 @@ -35,7 +35,7 @@ noclientlog logchange 0.5 logdir /var/log/chrony -log rtc +log rtc measurements leapsectz right/UTC broadcast 10 192.168.1.255 broadcast 10 192.168.100.255 123 @@ -102,6 +102,7 @@ { "logdir" = "/var/log/chrony" } { "log" { "rtc" } + { "measurements" } } { "leapsectz" = "right/UTC" } { "broadcast" diff -Nru augeas-1.3.0/lenses/tests/test_clamav.aug augeas-1.4.0/lenses/tests/test_clamav.aug --- augeas-1.3.0/lenses/tests/test_clamav.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_clamav.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,299 @@ +module Test_ClamAV = + +let clamd_conf ="## +## Example config file for the Clam AV daemon +## Please read the clamd.conf(5) manual before editing this file. +## + +# Comment or remove the line below. +Example +# LogFile must be writable for the user running daemon. +LogFile /var/log/clamav/clamd.log +LogFileUnlock yes +LogFileMaxSize 0 +LogTime yes +LogClean yes +LogSyslog yes +LogFacility LOG_MAIL +LogVerbose yes +LogRotate yes +ExtendedDetectionInfo yes +PidFile /var/run/clamav/clamd.pid +TemporaryDirectory /var/tmp +DatabaseDirectory /var/lib/clamav +OfficialDatabaseOnly no +LocalSocket /var/run/clamav/clamd.sock +LocalSocketGroup virusgroup +LocalSocketMode 660 +FixStaleSocket yes +TCPSocket 3310 +TCPAddr 127.0.0.1 +MaxConnectionQueueLength 30 +StreamMaxLength 10M +StreamMinPort 30000 +StreamMaxPort 32000 +MaxThreads 50 +ReadTimeout 300 +CommandReadTimeout 5 +SendBufTimeout 200 +MaxQueue 200 +IdleTimeout 60 +ExcludePath ^/proc/ +ExcludePath ^/sys/ +MaxDirectoryRecursion 20 +FollowDirectorySymlinks yes +FollowFileSymlinks yes +CrossFilesystems yes +SelfCheck 600 +VirusEvent /usr/local/bin/send_sms 123456789 \"VIRUS ALERT: %v\" +User clam +AllowSupplementaryGroups yes +ExitOnOOM yes +Foreground yes +Debug yes +LeaveTemporaryFiles yes +AllowAllMatchScan no +DetectPUA yes +ExcludePUA NetTool +ExcludePUA PWTool +IncludePUA Spy +IncludePUA Scanner +IncludePUA RAT +AlgorithmicDetection yes +ForceToDisk yes +DisableCache yes +ScanPE yes +DisableCertCheck yes +ScanELF yes +DetectBrokenExecutables yes +ScanOLE2 yes +OLE2BlockMacros no +ScanPDF yes +ScanSWF yes +ScanMail yes +ScanPartialMessages yes +PhishingSignatures yes +PhishingScanURLs yes +PhishingAlwaysBlockSSLMismatch no +PhishingAlwaysBlockCloak no +PartitionIntersection no +HeuristicScanPrecedence yes +StructuredDataDetection yes +StructuredMinCreditCardCount 5 +StructuredMinSSNCount 5 +StructuredSSNFormatNormal yes +StructuredSSNFormatStripped yes +ScanHTML yes +ScanArchive yes +ArchiveBlockEncrypted no +MaxScanSize 150M +MaxFileSize 30M +MaxRecursion 10 +MaxFiles 15000 +MaxEmbeddedPE 10M +MaxHTMLNormalize 10M +" + +let freshclam_conf ="## +## Example config file for freshclam +## Please read the freshclam.conf(5) manual before editing this file. +## + + +# Comment or remove the line below. +Example + +DatabaseDirectory /var/lib/clamav +UpdateLogFile /var/log/clamav/freshclam.log +LogFileMaxSize 2M +LogTime yes +LogVerbose yes +LogSyslog yes +LogFacility LOG_MAIL +LogRotate yes +PidFile /var/run/freshclam.pid +DatabaseOwner clam +AllowSupplementaryGroups yes +DNSDatabaseInfo current.cvd.clamav.net +DatabaseMirror db.XY.clamav.net +DatabaseMirror database.clamav.net +MaxAttempts 5 +ScriptedUpdates yes +CompressLocalDatabase no +DatabaseCustomURL http://myserver.com/mysigs.ndb +DatabaseCustomURL file:///mnt/nfs/local.hdb +PrivateMirror mirror1.mynetwork.com +PrivateMirror mirror2.mynetwork.com +Checks 24 +HTTPProxyServer myproxy.com +HTTPProxyPort 1234 +HTTPProxyUsername myusername +HTTPProxyPassword mypass +HTTPUserAgent SomeUserAgentIdString +LocalIPAddress aaa.bbb.ccc.ddd +NotifyClamd /etc/clamd.conf +OnUpdateExecute command +OnErrorExecute command +OnOutdatedExecute command +Foreground yes +Debug yes +ConnectTimeout 60 +ReceiveTimeout 60 +TestDatabases yes +SubmitDetectionStats /etc/clamd.conf +DetectionStatsCountry za +DetectionStatsCountry zw +SafeBrowsing yes +Bytecode yes +ExtraDatabase dbname1 +ExtraDatabase dbname2 +" + +test ClamAV.lns get clamd_conf = + { "#comment" = "#" } + { "#comment" = "# Example config file for the Clam AV daemon" } + { "#comment" = "# Please read the clamd.conf(5) manual before editing this file." } + { "#comment" = "#" } + { } + { "#comment" = "Comment or remove the line below." } + { "Example" } + { "#comment" = "LogFile must be writable for the user running daemon." } + { "LogFile" = "/var/log/clamav/clamd.log" } + { "LogFileUnlock" = "yes" } + { "LogFileMaxSize" = "0" } + { "LogTime" = "yes" } + { "LogClean" = "yes" } + { "LogSyslog" = "yes" } + { "LogFacility" = "LOG_MAIL" } + { "LogVerbose" = "yes" } + { "LogRotate" = "yes" } + { "ExtendedDetectionInfo" = "yes" } + { "PidFile" = "/var/run/clamav/clamd.pid" } + { "TemporaryDirectory" = "/var/tmp" } + { "DatabaseDirectory" = "/var/lib/clamav" } + { "OfficialDatabaseOnly" = "no" } + { "LocalSocket" = "/var/run/clamav/clamd.sock" } + { "LocalSocketGroup" = "virusgroup" } + { "LocalSocketMode" = "660" } + { "FixStaleSocket" = "yes" } + { "TCPSocket" = "3310" } + { "TCPAddr" = "127.0.0.1" } + { "MaxConnectionQueueLength" = "30" } + { "StreamMaxLength" = "10M" } + { "StreamMinPort" = "30000" } + { "StreamMaxPort" = "32000" } + { "MaxThreads" = "50" } + { "ReadTimeout" = "300" } + { "CommandReadTimeout" = "5" } + { "SendBufTimeout" = "200" } + { "MaxQueue" = "200" } + { "IdleTimeout" = "60" } + { "ExcludePath" = "^/proc/" } + { "ExcludePath" = "^/sys/" } + { "MaxDirectoryRecursion" = "20" } + { "FollowDirectorySymlinks" = "yes" } + { "FollowFileSymlinks" = "yes" } + { "CrossFilesystems" = "yes" } + { "SelfCheck" = "600" } + { "VirusEvent" = "/usr/local/bin/send_sms 123456789 \"VIRUS ALERT: %v\"" } + { "User" = "clam" } + { "AllowSupplementaryGroups" = "yes" } + { "ExitOnOOM" = "yes" } + { "Foreground" = "yes" } + { "Debug" = "yes" } + { "LeaveTemporaryFiles" = "yes" } + { "AllowAllMatchScan" = "no" } + { "DetectPUA" = "yes" } + { "ExcludePUA" = "NetTool" } + { "ExcludePUA" = "PWTool" } + { "IncludePUA" = "Spy" } + { "IncludePUA" = "Scanner" } + { "IncludePUA" = "RAT" } + { "AlgorithmicDetection" = "yes" } + { "ForceToDisk" = "yes" } + { "DisableCache" = "yes" } + { "ScanPE" = "yes" } + { "DisableCertCheck" = "yes" } + { "ScanELF" = "yes" } + { "DetectBrokenExecutables" = "yes" } + { "ScanOLE2" = "yes" } + { "OLE2BlockMacros" = "no" } + { "ScanPDF" = "yes" } + { "ScanSWF" = "yes" } + { "ScanMail" = "yes" } + { "ScanPartialMessages" = "yes" } + { "PhishingSignatures" = "yes" } + { "PhishingScanURLs" = "yes" } + { "PhishingAlwaysBlockSSLMismatch" = "no" } + { "PhishingAlwaysBlockCloak" = "no" } + { "PartitionIntersection" = "no" } + { "HeuristicScanPrecedence" = "yes" } + { "StructuredDataDetection" = "yes" } + { "StructuredMinCreditCardCount" = "5" } + { "StructuredMinSSNCount" = "5" } + { "StructuredSSNFormatNormal" = "yes" } + { "StructuredSSNFormatStripped" = "yes" } + { "ScanHTML" = "yes" } + { "ScanArchive" = "yes" } + { "ArchiveBlockEncrypted" = "no" } + { "MaxScanSize" = "150M" } + { "MaxFileSize" = "30M" } + { "MaxRecursion" = "10" } + { "MaxFiles" = "15000" } + { "MaxEmbeddedPE" = "10M" } + { "MaxHTMLNormalize" = "10M" } + +test ClamAV.lns get freshclam_conf = + { "#comment" = "#" } + { "#comment" = "# Example config file for freshclam" } + { "#comment" = "# Please read the freshclam.conf(5) manual before editing this file." } + { "#comment" = "#" } + { } + { } + { "#comment" = "Comment or remove the line below." } + { "Example" } + { } + { "DatabaseDirectory" = "/var/lib/clamav" } + { "UpdateLogFile" = "/var/log/clamav/freshclam.log" } + { "LogFileMaxSize" = "2M" } + { "LogTime" = "yes" } + { "LogVerbose" = "yes" } + { "LogSyslog" = "yes" } + { "LogFacility" = "LOG_MAIL" } + { "LogRotate" = "yes" } + { "PidFile" = "/var/run/freshclam.pid" } + { "DatabaseOwner" = "clam" } + { "AllowSupplementaryGroups" = "yes" } + { "DNSDatabaseInfo" = "current.cvd.clamav.net" } + { "DatabaseMirror" = "db.XY.clamav.net" } + { "DatabaseMirror" = "database.clamav.net" } + { "MaxAttempts" = "5" } + { "ScriptedUpdates" = "yes" } + { "CompressLocalDatabase" = "no" } + { "DatabaseCustomURL" = "http://myserver.com/mysigs.ndb" } + { "DatabaseCustomURL" = "file:///mnt/nfs/local.hdb" } + { "PrivateMirror" = "mirror1.mynetwork.com" } + { "PrivateMirror" = "mirror2.mynetwork.com" } + { "Checks" = "24" } + { "HTTPProxyServer" = "myproxy.com" } + { "HTTPProxyPort" = "1234" } + { "HTTPProxyUsername" = "myusername" } + { "HTTPProxyPassword" = "mypass" } + { "HTTPUserAgent" = "SomeUserAgentIdString" } + { "LocalIPAddress" = "aaa.bbb.ccc.ddd" } + { "NotifyClamd" = "/etc/clamd.conf" } + { "OnUpdateExecute" = "command" } + { "OnErrorExecute" = "command" } + { "OnOutdatedExecute" = "command" } + { "Foreground" = "yes" } + { "Debug" = "yes" } + { "ConnectTimeout" = "60" } + { "ReceiveTimeout" = "60" } + { "TestDatabases" = "yes" } + { "SubmitDetectionStats" = "/etc/clamd.conf" } + { "DetectionStatsCountry" = "za" } + { "DetectionStatsCountry" = "zw" } + { "SafeBrowsing" = "yes" } + { "Bytecode" = "yes" } + { "ExtraDatabase" = "dbname1" } + { "ExtraDatabase" = "dbname2" } diff -Nru augeas-1.3.0/lenses/tests/test_dnsmasq.aug augeas-1.4.0/lenses/tests/test_dnsmasq.aug --- augeas-1.3.0/lenses/tests/test_dnsmasq.aug 2012-11-02 15:20:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_dnsmasq.aug 2015-05-22 22:31:25.000000000 +0000 @@ -6,6 +6,16 @@ conf-dir=/etc/dnsmasq.d selfmx + +address=/foo.com/bar.net/10.1.2.3 + +server=10.4.5.6#1234 +server=/bar.com/foo.net/10.7.8.9 +server=/foo.org/bar.org/10.3.2.1@eth0#5678 +server=/baz.org/# +server=/baz.net/#@eth1 +server=10.6.5.4#1234@eth0#5678 +server=/qux.com/qux.net/ " test Dnsmasq.lns get conf = @@ -15,3 +25,40 @@ {} { "conf-dir" = "/etc/dnsmasq.d" } { "selfmx" } + {} + { "address" = "10.1.2.3" + { "domain" = "foo.com" } + { "domain" = "bar.net" } + } + {} + { "server" = "10.4.5.6" + { "port" = "1234" } + } + { "server" = "10.7.8.9" + { "domain" = "bar.com" } + { "domain" = "foo.net" } + } + { "server" = "10.3.2.1" + { "domain" = "foo.org" } + { "domain" = "bar.org" } + { "source" = "eth0" + { "port" = "5678" } + } + } + { "server" = "#" + { "domain" = "baz.org" } + } + { "server" = "#" + { "domain" = "baz.net" } + { "source" = "eth1" } + } + { "server" = "10.6.5.4" + { "port" = "1234" } + { "source" = "eth0" + { "port" = "5678" } + } + } + { "server" + { "domain" = "qux.com" } + { "domain" = "qux.net" } + } diff -Nru augeas-1.3.0/lenses/tests/test_dns_zone.aug augeas-1.4.0/lenses/tests/test_dns_zone.aug --- augeas-1.3.0/lenses/tests/test_dns_zone.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_dns_zone.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,384 @@ +module Test_Dns_Zone = + +let lns = Dns_Zone.lns + +(* RFC 1034 §6 *) +test lns get " +EDU. IN SOA SRI-NIC.ARPA. HOSTMASTER.SRI-NIC.ARPA. ( + 870729 ;serial + 1800 ;refresh every 30 minutes + 300 ;retry every 5 minutes + 604800 ;expire after a week + 86400 ;minimum of a day + ) + NS SRI-NIC.ARPA. + NS C.ISI.EDU. + +UCI 172800 NS ICS.UCI + 172800 NS ROME.UCI +ICS.UCI 172800 A 192.5.19.1 +ROME.UCI 172800 A 192.5.19.31 + +ISI 172800 NS VAXA.ISI + 172800 NS A.ISI + 172800 NS VENERA.ISI.EDU. +VAXA.ISI 172800 A 10.2.0.27 + 172800 A 128.9.0.33 +VENERA.ISI.EDU. 172800 A 10.1.0.52 + 172800 A 128.9.0.32 +A.ISI 172800 A 26.3.0.103 + +UDEL.EDU. 172800 NS LOUIE.UDEL.EDU. + 172800 NS UMN-REI-UC.ARPA. +LOUIE.UDEL.EDU. 172800 A 10.0.0.96 + 172800 A 192.5.39.3 + +YALE.EDU. 172800 NS YALE.ARPA. +YALE.EDU. 172800 NS YALE-BULLDOG.ARPA. + +MIT.EDU. 43200 NS XX.LCS.MIT.EDU. + 43200 NS ACHILLES.MIT.EDU. +XX.LCS.MIT.EDU. 43200 A 10.0.0.44 +ACHILLES.MIT.EDU. 43200 A 18.72.0.8 +" = + { "EDU." + { "1" + { "class" = "IN" } + { "type" = "SOA" } + { "mname" = "SRI-NIC.ARPA." } + { "rname" = "HOSTMASTER.SRI-NIC.ARPA." } + { "serial" = "870729" } + { "refresh" = "1800" } + { "retry" = "300" } + { "expiry" = "604800" } + { "minimum" = "86400" } + } + { "2" { "type" = "NS" } { "rdata" = "SRI-NIC.ARPA." } } + { "3" { "type" = "NS" } { "rdata" = "C.ISI.EDU." } } + } + { "UCI" + { "1" { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "ICS.UCI" } } + { "2" { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "ROME.UCI" } } + } + { "ICS.UCI" + { "1" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "192.5.19.1" } } + } + { "ROME.UCI" + { "1" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "192.5.19.31" } } + } + { "ISI" + { "1" { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "VAXA.ISI" } } + { "2" { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "A.ISI" } } + { "3" + { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "VENERA.ISI.EDU." } + } + } + { "VAXA.ISI" + { "1" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "10.2.0.27" } } + { "2" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "128.9.0.33" } } + } + { "VENERA.ISI.EDU." + { "1" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "10.1.0.52" } } + { "2" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "128.9.0.32" } } + } + { "A.ISI" + { "1" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "26.3.0.103" } } + } + { "UDEL.EDU." + { "1" + { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "LOUIE.UDEL.EDU." } + } + { "2" + { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "UMN-REI-UC.ARPA." } + } + } + { "LOUIE.UDEL.EDU." + { "1" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "10.0.0.96" } } + { "2" { "ttl" = "172800" } { "type" = "A" } { "rdata" = "192.5.39.3" } } + } + { "YALE.EDU." + { "1" { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "YALE.ARPA." } } + } + { "YALE.EDU." + { "1" + { "ttl" = "172800" } { "type" = "NS" } { "rdata" = "YALE-BULLDOG.ARPA." } + } + } + { "MIT.EDU." + { "1" + { "ttl" = "43200" } { "type" = "NS" } { "rdata" = "XX.LCS.MIT.EDU." } + } + { "2" + { "ttl" = "43200" } { "type" = "NS" } { "rdata" = "ACHILLES.MIT.EDU." } + } + } + { "XX.LCS.MIT.EDU." + { "1" { "ttl" = "43200" } { "type" = "A" } { "rdata" = "10.0.0.44" } } + } + { "ACHILLES.MIT.EDU." + { "1" { "ttl" = "43200" } { "type" = "A" } { "rdata" = "18.72.0.8" } } + } + + +(* RFC 1035 §5.3 *) +test lns get " +@ IN SOA VENERA Action\.domains ( + 20 ; SERIAL + 7200 ; REFRESH + 600 ; RETRY + 3600000; EXPIRE + 60) ; MINIMUM + + NS A.ISI.EDU. + NS VENERA + NS VAXA + MX 10 VENERA + MX 20 VAXA + +A A 26.3.0.103 + +VENERA A 10.1.0.52 + A 128.9.0.32 + +VAXA A 10.2.0.27 + A 128.9.0.33 +" = + { "@" + { "1" + { "class" = "IN" } + { "type" = "SOA" } + { "mname" = "VENERA" } + { "rname" = "Action\\.domains" } + { "serial" = "20" } + { "refresh" = "7200" } + { "retry" = "600" } + { "expiry" = "3600000" } + { "minimum" = "60" } + } + { "2" { "type" = "NS" } { "rdata" = "A.ISI.EDU." } } + { "3" { "type" = "NS" } { "rdata" = "VENERA" } } + { "4" { "type" = "NS" } { "rdata" = "VAXA" } } + { "5" { "type" = "MX" } { "priority" = "10" } { "exchange" = "VENERA" } } + { "6" { "type" = "MX" } { "priority" = "20" } { "exchange" = "VAXA" } } + } + { "A" { "1" { "type" = "A" } { "rdata" = "26.3.0.103" } } } + { "VENERA" + { "1" { "type" = "A" } { "rdata" = "10.1.0.52" } } + { "2" { "type" = "A" } { "rdata" = "128.9.0.32" } } + } + { "VAXA" + { "1" { "type" = "A" } { "rdata" = "10.2.0.27" } } + { "2" { "type" = "A" } { "rdata" = "128.9.0.33" } } + } + + +(* RFC 2782 *) +test lns get " +$ORIGIN example.com. +@ SOA server.example.com. root.example.com. ( + 1995032001 3600 3600 604800 86400 ) + NS server.example.com. + NS ns1.ip-provider.net. + NS ns2.ip-provider.net. +; foobar - use old-slow-box or new-fast-box if either is +; available, make three quarters of the logins go to +; new-fast-box. +_foobar._tcp SRV 0 1 9 old-slow-box.example.com. + SRV 0 3 9 new-fast-box.example.com. +; if neither old-slow-box or new-fast-box is up, switch to +; using the sysdmin's box and the server + SRV 1 0 9 sysadmins-box.example.com. + SRV 1 0 9 server.example.com. +server A 172.30.79.10 +old-slow-box A 172.30.79.11 +sysadmins-box A 172.30.79.12 +new-fast-box A 172.30.79.13 +; NO other services are supported +*._tcp SRV 0 0 0 . +*._udp SRV 0 0 0 . +" = + { "$ORIGIN" = "example.com." } + { "@" + { "1" + { "type" = "SOA" } + { "mname" = "server.example.com." } + { "rname" = "root.example.com." } + { "serial" = "1995032001" } + { "refresh" = "3600" } + { "retry" = "3600" } + { "expiry" = "604800" } + { "minimum" = "86400" } + } + { "2" { "type" = "NS" } { "rdata" = "server.example.com." } } + { "3" { "type" = "NS" } { "rdata" = "ns1.ip-provider.net." } } + { "4" { "type" = "NS" } { "rdata" = "ns2.ip-provider.net." } } + } + { "_foobar._tcp" + { "1" + { "type" = "SRV" } + { "priority" = "0" } + { "weight" = "1" } + { "port" = "9" } + { "target" = "old-slow-box.example.com." } + } + { "2" + { "type" = "SRV" } + { "priority" = "0" } + { "weight" = "3" } + { "port" = "9" } + { "target" = "new-fast-box.example.com." } + } + { "3" + { "type" = "SRV" } + { "priority" = "1" } + { "weight" = "0" } + { "port" = "9" } + { "target" = "sysadmins-box.example.com." } + } + { "4" + { "type" = "SRV" } + { "priority" = "1" } + { "weight" = "0" } + { "port" = "9" } + { "target" = "server.example.com." } + } + } + { "server" { "1" { "type" = "A" } { "rdata" = "172.30.79.10" } } } + { "old-slow-box" { "1" { "type" = "A" } { "rdata" = "172.30.79.11" } } } + { "sysadmins-box" { "1" { "type" = "A" } { "rdata" = "172.30.79.12" } } } + { "new-fast-box" { "1" { "type" = "A" } { "rdata" = "172.30.79.13" } } } + { "*._tcp" + { "1" + { "type" = "SRV" } + { "priority" = "0" } + { "weight" = "0" } + { "port" = "0" } + { "target" = "." } + } + } + { "*._udp" + { "1" + { "type" = "SRV" } + { "priority" = "0" } + { "weight" = "0" } + { "port" = "0" } + { "target" = "." } + } + } + + +(* RFC 3403 §6.2 *) +test lns get " +$ORIGIN 2.1.2.1.5.5.5.0.7.7.1.e164.arpa. + IN NAPTR 100 10 \"u\" \"sip+E2U\" \"!^.*$!sip:information@foo.se!i\" . + IN NAPTR 102 10 \"u\" \"smtp+E2U\" \"!^.*$!mailto:information@foo.se!i\" . +" = + { "$ORIGIN" = "2.1.2.1.5.5.5.0.7.7.1.e164.arpa." } + { "@" + { "1" + { "class" = "IN" } + { "type" = "NAPTR" } + { "order" = "100" } + { "preference" = "10" } + { "flags" = "\"u\"" } + { "service" = "\"sip+E2U\"" } + { "regexp" = "\"!^.*$!sip:information@foo.se!i\"" } + { "replacement" = "." } + } + { "2" + { "class" = "IN" } + { "type" = "NAPTR" } + { "order" = "102" } + { "preference" = "10" } + { "flags" = "\"u\"" } + { "service" = "\"smtp+E2U\"" } + { "regexp" = "\"!^.*$!mailto:information@foo.se!i\"" } + { "replacement" = "." } + } + } + + +(* SOA record on a single line *) +test lns get " +$ORIGIN example.com. +@ IN SOA ns root.example.com. (1 2 3 4 5) +" = + { "$ORIGIN" = "example.com." } + { "@" + { "1" + { "class" = "IN" } + { "type" = "SOA" } + { "mname" = "ns" } + { "rname" = "root.example.com." } + { "serial" = "1" } + { "refresh" = "2" } + { "retry" = "3" } + { "expiry" = "4" } + { "minimum" = "5" } + } + } + + +(* Different ordering of TTL and class *) +test lns get " +$ORIGIN example.com. +foo 1D IN A 10.1.2.3 +bar IN 2W A 10.4.5.6 +" = + { "$ORIGIN" = "example.com." } + { "foo" + { "1" + { "ttl" = "1D" } + { "class" = "IN" } + { "type" = "A" } + { "rdata" = "10.1.2.3" } + } + } + { "bar" + { "1" + { "class" = "IN" } + { "ttl" = "2W" } + { "type" = "A" } + { "rdata" = "10.4.5.6" } + } + } + + +(* Escaping *) +test lns get " +$ORIGIN example.com. +foo TXT abc\\\\def\\\"ghi +bar TXT \"ab cd\\\\ef\\\"gh\" +" = + { "$ORIGIN" = "example.com." } + { "foo" { "1" { "type" = "TXT" } { "rdata" = "abc\\\\def\\\"ghi" } } } + { "bar" { "1" { "type" = "TXT" } { "rdata" = "\"ab cd\\\\ef\\\"gh\"" } } } + + +(* Whitespace at the end of the line *) +test lns get " +$ORIGIN example.com. \n@ IN SOA ns root.example.com. (1 2 3 4 5) \t +foo 1D IN A 10.1.2.3\t +" = + { "$ORIGIN" = "example.com." } + { "@" + { "1" + { "class" = "IN" } + { "type" = "SOA" } + { "mname" = "ns" } + { "rname" = "root.example.com." } + { "serial" = "1" } + { "refresh" = "2" } + { "retry" = "3" } + { "expiry" = "4" } + { "minimum" = "5" } + } + } + { "foo" + { "1" + { "ttl" = "1D" } + { "class" = "IN" } + { "type" = "A" } + { "rdata" = "10.1.2.3" } + } + } diff -Nru augeas-1.3.0/lenses/tests/test_erlang.aug augeas-1.4.0/lenses/tests/test_erlang.aug --- augeas-1.3.0/lenses/tests/test_erlang.aug 2012-12-17 21:39:45.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_erlang.aug 2015-05-22 22:31:25.000000000 +0000 @@ -51,7 +51,7 @@ (* Group: application *) -let list_bare_app = Erlang.application Rx.word list_bare +let list_bare_app = Erlang.application (Rx.word - "kernel") list_bare test list_bare_app get "{foo, [{bar, [baz, bat]}]}" = { "foo" @@ -59,6 +59,26 @@ { "value" = "baz" } { "value" = "bat" } } } +(* no settings *) +test list_bare_app get "{foo, []}" = + { "foo" } + +(* Group: kernel *) + +test Erlang.kernel get "{kernel, [ + {browser_cmd, \"/foo/bar\"}, + {dist_auto_connect, once}, + {error_logger, tty}, + {net_setuptime, 5}, + {start_dist_ac, true} +]}" = + { "kernel" + { "browser_cmd" = "/foo/bar" } + { "dist_auto_connect" = "once" } + { "error_logger" = "tty" } + { "net_setuptime" = "5" } + { "start_dist_ac" = "true" } } + (* Group: config *) let list_bare_config = Erlang.config list_bare_app @@ -76,3 +96,14 @@ { "value" = "gaz" } { "value" = "gat" } } } +(* Test Erlang's kernel app config is parsed *) +test list_bare_config get "[ + {foo, [{bar, [baz, bat]}]}, + {kernel, [{start_timer, true}]} + ].\n" = + { "foo" + { "bar" + { "value" = "baz" } + { "value" = "bat" } } } + { "kernel" + { "start_timer" = "true" } } diff -Nru augeas-1.3.0/lenses/tests/test_exports.aug augeas-1.4.0/lenses/tests/test_exports.aug --- augeas-1.3.0/lenses/tests/test_exports.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_exports.aug 2015-05-22 22:31:25.000000000 +0000 @@ -1,4 +1,4 @@ -module Test_exports = +module Test_exports = let s = "/local 172.31.0.0/16(rw,sync) \t @@ -9,6 +9,7 @@ /local3 some-host(rw,sync) /local3 an-other-host(rw,sync) /local4 2000:123:456::/64(rw) +/local5 somehost-[01](rw) " test Exports.lns get s = @@ -47,3 +48,6 @@ { "dir" = "/local4" { "client" = "2000:123:456::/64" { "option" = "rw" } } } + { "dir" = "/local5" + { "client" = "somehost-[01]" + { "option" = "rw" } } } diff -Nru augeas-1.3.0/lenses/tests/test_grub.aug augeas-1.4.0/lenses/tests/test_grub.aug --- augeas-1.3.0/lenses/tests/test_grub.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_grub.aug 2015-06-01 22:03:07.000000000 +0000 @@ -240,3 +240,20 @@ { "splash" = "silent" } { "showopts" } } { "initrd" = "(hd0,0)/initrd" } } + + (* Password protected kernel, issue #229 *) + test Grub.lns get "title Password Protected Kernel + root (hd0,0) + kernel /vmlinuz ro root=/dev/mapper/root + initrd /initramfs + password --md5 secret\n" = + { "title" = "Password Protected Kernel" + { "root" = "(hd0,0)" } + { "kernel" = "/vmlinuz" + { "ro" } + { "root" = "/dev/mapper/root" } + } + { "initrd" = "/initramfs" } + { "password" = "secret" + { "md5" } + } } diff -Nru augeas-1.3.0/lenses/tests/test_httpd.aug augeas-1.4.0/lenses/tests/test_httpd.aug --- augeas-1.3.0/lenses/tests/test_httpd.aug 2014-10-31 17:19:18.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_httpd.aug 2015-06-02 00:20:37.000000000 +0000 @@ -1,5 +1,11 @@ module Test_httpd = +(* Check that we can iterate on directive *) +let _ = Httpd.directive+ + +(* Check that we can do a non iterative section *) +let _ = Httpd.section Httpd.directive + (* directives testing *) let d1 = "ServerRoot \"/etc/apache2\"\n" test Httpd.directive get d1 = @@ -404,3 +410,59 @@ } } } + + +(* GH #220 *) +let double_comment = " +## +## Comment +## +\n" + +test Httpd.lns get double_comment = + { "IfDefine" + { "arg" = "Foo" } + { "#comment" = "#" } + { "#comment" = "# Comment" } + { "#comment" = "#" } + } + +let single_comment = " +# +## Comment +## +\n" + +test Httpd.lns get single_comment = + { "IfDefine" + { "arg" = "Foo" } + { "#comment" = "# Comment" } + { "#comment" = "#" } + } + +let single_empty = " +# + +\n" +test Httpd.lns get single_empty = + { "IfDefine" + { "arg" = "Foo" } + } + +let eol_empty = " # +\n" +test Httpd.lns get eol_empty = + { "IfDefine" + { "arg" = "Foo" } + } + +(* Issue #140 *) +test Httpd.lns get " + # one comment + # another comment +\n" = + { "IfModule" + { "arg" = "mod_ssl.c" } + { "#comment" = "one comment" } + { "#comment" = "another comment" } + } diff -Nru augeas-1.3.0/lenses/tests/test_iscsid.aug augeas-1.4.0/lenses/tests/test_iscsid.aug --- augeas-1.3.0/lenses/tests/test_iscsid.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_iscsid.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,69 @@ +(* +Module: Test_Iscsid + Provides unit tests and examples for the lens. +*) + +module Test_Iscsid = + +(* Variable: conf + A full configuration *) +let conf = "################ +# iSNS settings +################ +# Address of iSNS server +isns.address = 127.0.0.1 +isns.port = 3260 + +# ************* +# CHAP Settings +# ************* + +# To enable CHAP authentication set node.session.auth.authmethod +# to CHAP. The default is None. +node.session.auth.authmethod = CHAP + +# To set a CHAP username and password for initiator +# authentication by the target(s), uncomment the following lines: +node.session.auth.username = someuser1 +node.session.auth.password = somep$31#$^&7! + +# To enable CHAP authentication for a discovery session to the target +# set discovery.sendtargets.auth.authmethod to CHAP. The default is None. +discovery.sendtargets.auth.authmethod = CHAP + +# To set a discovery session CHAP username and password for the initiator +# authentication by the target(s), uncomment the following lines: +discovery.sendtargets.auth.username = someuser3 +discovery.sendtargets.auth.password = _09+7)(,./?;'p[] +" + +(* Test: Iscsid.lns + Test the full *) +test Iscsid.lns get conf = { "#comment" = "###############" } + { "#comment" = "iSNS settings" } + { "#comment" = "###############" } + { "#comment" = "Address of iSNS server" } + { "isns.address" = "127.0.0.1" } + { "isns.port" = "3260" } + { } + { "#comment" = "*************" } + { "#comment" = "CHAP Settings" } + { "#comment" = "*************" } + { } + { "#comment" = "To enable CHAP authentication set node.session.auth.authmethod" } + { "#comment" = "to CHAP. The default is None." } + { "node.session.auth.authmethod" = "CHAP" } + { } + { "#comment" = "To set a CHAP username and password for initiator" } + { "#comment" = "authentication by the target(s), uncomment the following lines:" } + { "node.session.auth.username" = "someuser1" } + { "node.session.auth.password" = "somep$31#$^&7!" } + { } + { "#comment" = "To enable CHAP authentication for a discovery session to the target" } + { "#comment" = "set discovery.sendtargets.auth.authmethod to CHAP. The default is None." } + { "discovery.sendtargets.auth.authmethod" = "CHAP" } + { } + { "#comment" = "To set a discovery session CHAP username and password for the initiator" } + { "#comment" = "authentication by the target(s), uncomment the following lines:" } + { "discovery.sendtargets.auth.username" = "someuser3" } + { "discovery.sendtargets.auth.password" = "_09+7)(,./?;'p[]" } diff -Nru augeas-1.3.0/lenses/tests/test_jaas.aug augeas-1.4.0/lenses/tests/test_jaas.aug --- augeas-1.3.0/lenses/tests/test_jaas.aug 2013-05-17 03:35:24.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_jaas.aug 2015-05-22 22:31:25.000000000 +0000 @@ -54,7 +54,18 @@ serviceCredential = \"ldappassword\" ssl = \"false\" userField = \"uid\" + // Example comment within definition subtreeSearch = \"true\"; +}; + +NetAccountAuth { + // Test of optionless flag + nz.ac.auckland.jaas.Krb5LoginModule required; +}; + +com.sun.security.jgss.krb5.initiate { + // Test of omitted linebreaks and naked boolean + com.sun.security.auth.module.Krb5LoginModule required useTicketCache=true; };" test Jaas.lns get conf = @@ -79,7 +90,6 @@ { } { "login" = "ShibUserPassAuth" { } - { } { "#comment" = "Example LDAP authentication" } { "#comment" = "See: https://wiki.shibboleth.net/confluence/display/SHIB2/IdPAuthUserPass" } { "#mcomment" @@ -106,7 +116,29 @@ { "serviceCredential" = "\"ldappassword\"" } { "ssl" = "\"false\"" } { "userField" = "\"uid\"" } - { "subtreeSearch" = "\"true\";" } + { "#comment" = "Example comment within definition" } + { "subtreeSearch" = "\"true\"" } + } + } + { } + } + { } + { } + { "login" = "NetAccountAuth" + { "#comment" = "Test of optionless flag" } + { "loginModuleClass" = "nz.ac.auckland.jaas.Krb5LoginModule" + { "flag" = "required" } + } + { } + } + { } + { } + { "login" = "com.sun.security.jgss.krb5.initiate" + { "#comment" = "Test of omitted linebreaks and naked boolean" } + { "loginModuleClass" = "com.sun.security.auth.module.Krb5LoginModule" + { "flag" = "required" + { "useTicketCache" = "true" } } } + { } } diff -Nru augeas-1.3.0/lenses/tests/test_known_hosts.aug augeas-1.4.0/lenses/tests/test_known_hosts.aug --- augeas-1.3.0/lenses/tests/test_known_hosts.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_known_hosts.aug 2015-06-01 22:03:07.000000000 +0000 @@ -8,10 +8,12 @@ (* Test: Known_Hosts.lns Simple get test *) test Known_Hosts.lns get "# A comment -foo.example.com ecdsa-sha2-nistp256 AAABBBDKDFX= +foo.example.com,foo,bar ecdsa-sha2-nistp256 AAABBBDKDFX= |1|FhUqf1kMlRWNfK6InQSAmXiNiSY=|jwbKFwD4ipl6D0k6OoshmW7xOao= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIvNOU8OedkWalFmoFcJWP3nasnCLx6M78F9y0rzTQtplggNd0dvR0A4SQOBfHInmk5dH6YGGcpT3PM3cJBR7rI=\n" = { "#comment" = "A comment" } { "1" = "foo.example.com" + { "alias" = "foo" } + { "alias" = "bar" } { "type" = "ecdsa-sha2-nistp256" } { "key" = "AAABBBDKDFX=" } } { "2" = "|1|FhUqf1kMlRWNfK6InQSAmXiNiSY=|jwbKFwD4ipl6D0k6OoshmW7xOao=" diff -Nru augeas-1.3.0/lenses/tests/test_krb5.aug augeas-1.4.0/lenses/tests/test_krb5.aug --- augeas-1.3.0/lenses/tests/test_krb5.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_krb5.aug 2015-05-22 22:31:25.000000000 +0000 @@ -92,6 +92,15 @@ } } } + stanford.edu = { + kdc = krb5auth1.stanford.edu + kdc = krb5auth2.stanford.edu + kdc = krb5auth3.stanford.edu + master_kdc = krb5auth1.stanford.edu + admin_server = krb5-admin.stanford.edu + default_domain = stanford.edu + krb524_server = krb524.stanford.edu + } [instancemapping] afs = { @@ -358,6 +367,15 @@ } } } + { "realm" = "stanford.edu" + { "kdc" = "krb5auth1.stanford.edu" } + { "kdc" = "krb5auth2.stanford.edu" } + { "kdc" = "krb5auth3.stanford.edu" } + { "master_kdc" = "krb5auth1.stanford.edu" } + { "admin_server" = "krb5-admin.stanford.edu" } + { "default_domain" = "stanford.edu" } + { "krb524_server" = "krb524.stanford.edu" } + } { } } { "instancemapping" { "afs" diff -Nru augeas-1.3.0/lenses/tests/test_limits.aug augeas-1.4.0/lenses/tests/test_limits.aug --- augeas-1.3.0/lenses/tests/test_limits.aug 2012-11-02 15:20:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_limits.aug 2015-05-22 22:31:25.000000000 +0000 @@ -29,3 +29,10 @@ ftp hard nproc /ftp * soft core 0 * - nofile 4096\n" + + test Limits.lns get "* soft core 0 # clever comment\n" = + { "domain" = "*" + { "type" = "soft" } + { "item" = "core" } + { "value" = "0" } + { "#comment" = "clever comment" } } diff -Nru augeas-1.3.0/lenses/tests/test_logrotate.aug augeas-1.4.0/lenses/tests/test_logrotate.aug --- augeas-1.3.0/lenses/tests/test_logrotate.aug 2012-11-02 15:20:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_logrotate.aug 2015-05-22 22:31:25.000000000 +0000 @@ -264,3 +264,22 @@ { "file" = "/var/log/mail.warn" } { "file" = "/var/log/mail.err" } { "schedule" = "weekly" } } + +(* Issue #217: support for dateformat *) +let dateformat = "dateformat -%Y%m%d\n" + +test Logrotate.lns get dateformat = + { "dateformat" = "-%Y%m%d" } + +(* Issue #123: no space before '{' *) +test Logrotate.lns get "/file{\n missingok \t\n}\n" = + { "rule" + { "file" = "/file" } + { "missingok" = "missingok" } } + +(* RHBZ#1213292: maxsize 30k *) +test Logrotate.lns get "/var/log/yum.log {\n maxsize 30k\n}\n" = + { "rule" + { "file" = "/var/log/yum.log" } + { "maxsize" = "30k" } } + diff -Nru augeas-1.3.0/lenses/tests/test_mailscanner.aug augeas-1.4.0/lenses/tests/test_mailscanner.aug --- augeas-1.3.0/lenses/tests/test_mailscanner.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_mailscanner.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,745 @@ +module Test_Mailscanner = + +let conf = "# Main configuration file for the MailScanner E-Mail Virus Scanner +%org-name% = BARUWA +%org-long-name% = BARUWA MAILFW +%web-site% = www.baruwa.com +%etc-dir% = /etc/MailScanner +%reports-base% = /etc/MailScanner/reports +%report-dir% = /etc/MailScanner/reports/en +%rules-dir% = /etc/MailScanner/rules +%mcp-dir% = /etc/MailScanner/mcp +%spool-dir% = /var/spool/MailScanner +%signature-dir% = /etc/MailScanner/baruwa/signatures +%brules-dir% = /etc/MailScanner/baruwa/rules +Max Children = 5 +Run As User = exim +Run As Group = exim +Queue Scan Interval = 6 +Incoming Queue Dir = /var/spool/exim.in/input +Outgoing Queue Dir = /var/spool/exim/input +Incoming Work Dir = %spool-dir%/incoming +Quarantine Dir = %spool-dir%/quarantine +PID file = /var/run/MailScanner/MailScanner.pid +Restart Every = 7200 +MTA = exim +Sendmail = /usr/sbin/exim -C /etc/exim/exim_out.conf +Sendmail2 = /usr/sbin/exim -C /etc/exim/exim_out.conf +Incoming Work User = exim +Incoming Work Group = clam +Incoming Work Permissions = 0640 +Quarantine User = exim +Quarantine Group = baruwa +Quarantine Permissions = 0660 +Max Unscanned Bytes Per Scan = 100m +Max Unsafe Bytes Per Scan = 50m +Max Unscanned Messages Per Scan = 30 +Max Unsafe Messages Per Scan = 30 +Max Normal Queue Size = 800 +Scan Messages = %rules-dir%/scan.messages.rules +Reject Message = no +Maximum Processing Attempts = 6 +Processing Attempts Database = %spool-dir%/incoming/Processing.db +Maximum Attachments Per Message = 200 +Expand TNEF = yes +Use TNEF Contents = replace +Deliver Unparsable TNEF = no +TNEF Expander = /usr/bin/tnef --maxsize=100000000 +TNEF Timeout = 120 +File Command = /usr/sbin/file-wrapper +File Timeout = 20 +Gunzip Command = /bin/gunzip +Gunzip Timeout = 50 +Unrar Command = /usr/bin/unrar +Unrar Timeout = 50 +Find UU-Encoded Files = no +Maximum Message Size = %brules-dir%/message.size.rules +Maximum Attachment Size = -1 +Minimum Attachment Size = -1 +Maximum Archive Depth = 4 +Find Archives By Content = yes +Unpack Microsoft Documents = yes +Zip Attachments = no +Attachments Zip Filename = MessageAttachments.zip +Attachments Min Total Size To Zip = 100k +Attachment Extensions Not To Zip = .zip .rar .gz .tgz .jpg .jpeg .mpg .mpe .mpeg .mp3 .rpm .htm .html .eml +Add Text Of Doc = no +Antiword = /usr/bin/antiword -f +Antiword Timeout = 50 +Unzip Maximum Files Per Archive = 0 +Unzip Maximum File Size = 50k +Unzip Filenames = *.txt *.ini *.log *.csv +Unzip MimeType = text/plain +Virus Scanning = %brules-dir%/virus.checks.rules +Virus Scanners = auto +Virus Scanner Timeout = 300 +Deliver Disinfected Files = no +Silent Viruses = HTML-IFrame All-Viruses +Still Deliver Silent Viruses = no +Non-Forging Viruses = Joke/ OF97/ WM97/ W97M/ eicar +Spam-Virus Header = X-%org-name%-BaruwaFW-SpamVirus-Report: +Virus Names Which Are Spam = Sanesecurity.Spam*UNOFFICIAL HTML/* *Phish* *Suspected-phishing_safebrowsing* +Block Encrypted Messages = no +Block Unencrypted Messages = no +Allow Password-Protected Archives = yes +Check Filenames In Password-Protected Archives = yes +Allowed Sophos Error Messages = +Sophos IDE Dir = /opt/sophos-av/lib/sav +Sophos Lib Dir = /opt/sophos-av/lib +Monitors For Sophos Updates = /opt/sophos-av/lib/sav/*.ide +Monitors for ClamAV Updates = /var/lib/clamav/*.cvd +ClamAVmodule Maximum Recursion Level = 8 +ClamAVmodule Maximum Files = 1000 +ClamAVmodule Maximum File Size = 10000000 +ClamAVmodule Maximum Compression Ratio = 250 +Clamd Port = 3310 +Clamd Socket = /var/run/clamav/clamd.sock +Clamd Lock File = +Clamd Use Threads = no +ClamAV Full Message Scan = yes +Fpscand Port = 10200 +Dangerous Content Scanning = %rules-dir%/content.scanning.rules +Allow Partial Messages = no +Allow External Message Bodies = no +Find Phishing Fraud = yes +Also Find Numeric Phishing = yes +Use Stricter Phishing Net = yes +Highlight Phishing Fraud = yes +Phishing Safe Sites File = %etc-dir%/phishing.safe.sites.conf +Phishing Bad Sites File = %etc-dir%/phishing.bad.sites.conf +Country Sub-Domains List = %etc-dir%/country.domains.conf +Allow IFrame Tags = disarm +Allow Form Tags = disarm +Allow Script Tags = disarm +Allow WebBugs = disarm +Ignored Web Bug Filenames = spacer pixel.gif pixel.png gap +Known Web Bug Servers = msgtag.com +Web Bug Replacement = https://datafeeds.baruwa.com/1x1spacer.gif +Allow Object Codebase Tags = disarm +Convert Dangerous HTML To Text = no +Convert HTML To Text = no +Archives Are = zip rar ole +Allow Filenames = +Deny Filenames = +Filename Rules = %rules-dir%/filename.rules +Allow Filetypes = +Allow File MIME Types = +Deny Filetypes = +Deny File MIME Types = +Filetype Rules = %rules-dir%/filetype.rules +Archives: Allow Filenames = +Archives: Deny Filenames = +Archives: Filename Rules = %etc-dir%/archives.filename.rules.conf +Archives: Allow Filetypes = +Archives: Allow File MIME Types = +Archives: Deny Filetypes = +Archives: Deny File MIME Types = +Archives: Filetype Rules = %etc-dir%/archives.filetype.rules.conf +Default Rename Pattern = __FILENAME__.disarmed +Quarantine Infections = yes +Quarantine Silent Viruses = no +Quarantine Modified Body = no +Quarantine Whole Message = yes +Quarantine Whole Messages As Queue Files = no +Keep Spam And MCP Archive Clean = yes +Language Strings = %brules-dir%/languages.rules +Rejection Report = %brules-dir%/rejectionreport.rules +Deleted Bad Content Message Report = %brules-dir%/deletedcontentmessage.rules +Deleted Bad Filename Message Report = %brules-dir%/deletedfilenamemessage.rules +Deleted Virus Message Report = %brules-dir%/deletedvirusmessage.rules +Deleted Size Message Report = %brules-dir%/deletedsizemessage.rules +Stored Bad Content Message Report = %brules-dir%/storedcontentmessage.rules +Stored Bad Filename Message Report = %brules-dir%/storedfilenamemessage.rules +Stored Virus Message Report = %brules-dir%/storedvirusmessage.rules +Stored Size Message Report = %brules-dir%/storedsizemessage.rules +Disinfected Report = %brules-dir%/disinfectedreport.rules +Inline HTML Signature = %brules-dir%/html.sigs.rules +Inline Text Signature = %brules-dir%/text.sigs.rules +Signature Image Filename = %brules-dir%/sig.imgs.names.rules +Signature Image Filename = %brules-dir%/sig.imgs.rules +Inline HTML Warning = %brules-dir%/inlinewarninghtml.rules +Inline Text Warning = %brules-dir%/inlinewarningtxt.rules +Sender Content Report = %brules-dir%/sendercontentreport.rules +Sender Error Report = %brules-dir%/sendererrorreport.rules +Sender Bad Filename Report = %brules-dir%/senderfilenamereport.rules +Sender Virus Report = %brules-dir%/sendervirusreport.rules +Sender Size Report = %brules-dir%/sendersizereport.rules +Hide Incoming Work Dir = yes +Include Scanner Name In Reports = yes +Mail Header = X-%org-name%-BaruwaFW: +Spam Header = X-%org-name%-BaruwaFW-SpamCheck: +Spam Score Header = X-%org-name%-BaruwaFW-SpamScore: +Information Header = X-%org-name%-BaruwaFW-Information: +Add Envelope From Header = yes +Add Envelope To Header = no +Envelope From Header = X-BARUWA-BaruwaFW-From: +Envelope To Header = X-%org-name%-BaruwaFW-To: +ID Header = X-%org-name%-BaruwaFW-ID: +IP Protocol Version Header = +Spam Score Character = s +SpamScore Number Instead Of Stars = no +Minimum Stars If On Spam List = 0 +Clean Header Value = Found to be clean +Infected Header Value = Found to be infected +Disinfected Header Value = Disinfected +Information Header Value = Please contact %org-long-name% for more information +Detailed Spam Report = yes +Include Scores In SpamAssassin Report = yes +Always Include SpamAssassin Report = no +Multiple Headers = add +Place New Headers At Top Of Message = yes +Hostname = the %org-name% ($HOSTNAME) Baruwa +Sign Messages Already Processed = no +Sign Clean Messages = %brules-dir%/sign.clean.msgs.rules +Attach Image To Signature = yes +Attach Image To HTML Message Only = yes +Allow Multiple HTML Signatures = no +Dont Sign HTML If Headers Exist = +Mark Infected Messages = yes +Mark Unscanned Messages = no +Unscanned Header Value = Not scanned: please contact %org-long-name% for details +Remove These Headers = X-Mozilla-Status: X-Mozilla-Status2: +Deliver Cleaned Messages = yes +Notify Senders = no +Notify Senders Of Viruses = no +Notify Senders Of Blocked Filenames Or Filetypes = no +Notify Senders Of Blocked Size Attachments = no +Notify Senders Of Other Blocked Content = no +Never Notify Senders Of Precedence = list bulk +Scanned Modify Subject = no +Scanned Subject Text = {Scanned} +Virus Modify Subject = no +Virus Subject Text = {Virus?} +Filename Modify Subject = no +Filename Subject Text = {Filename?} +Content Modify Subject = no +Content Subject Text = {Dangerous Content?} +Size Modify Subject = no +Size Subject Text = {Size} +Disarmed Modify Subject = no +Disarmed Subject Text = {Disarmed} +Phishing Modify Subject = yes +Phishing Subject Text = {Suspected Phishing?} +Spam Modify Subject = no +Spam Subject Text = {Spam?} +High Scoring Spam Modify Subject = no +High Scoring Spam Subject Text = {Spam?} +Warning Is Attachment = yes +Attachment Warning Filename = %org-name%-Attachment-Warning.txt +Attachment Encoding Charset = ISO-8859-1 +Archive Mail = +Missing Mail Archive Is = file +Send Notices = no +Notices Include Full Headers = yes +Hide Incoming Work Dir in Notices = yes +Notice Signature = -- \\n%org-name%\\nEmail Security\\n%website% +Notices From = Baruwa +Notices To = postmaster +Local Postmaster = postmaster +Spam List Definitions = %etc-dir%/spam.lists.conf +Virus Scanner Definitions = %etc-dir%/virus.scanners.conf +Spam Checks = %brules-dir%/spam.checks.rules +Spam List = +Spam Domain List = +Spam Lists To Be Spam = 1 +Spam Lists To Reach High Score = 3 +Spam List Timeout = 10 +Max Spam List Timeouts = 7 +Spam List Timeouts History = 10 +Is Definitely Not Spam = %brules-dir%/approved.senders.rules +Is Definitely Spam = %brules-dir%/banned.senders.rules +Definite Spam Is High Scoring = yes +Ignore Spam Whitelist If Recipients Exceed = 20 +Max Spam Check Size = 4000k +Use Watermarking = no +Add Watermark = yes +Check Watermarks With No Sender = yes +Treat Invalid Watermarks With No Sender as Spam = nothing +Check Watermarks To Skip Spam Checks = yes +Watermark Secret = %org-name%-BaruwaFW-Secret +Watermark Lifetime = 604800 +Watermark Header = X-%org-name%-BaruwaFW-Watermark: +Use SpamAssassin = yes +Max SpamAssassin Size = 800k +Required SpamAssassin Score = %brules-dir%/spam.score.rules +High SpamAssassin Score = %brules-dir%/highspam.score.rules +SpamAssassin Auto Whitelist = yes +SpamAssassin Timeout = 75 +Max SpamAssassin Timeouts = 10 +SpamAssassin Timeouts History = 30 +Check SpamAssassin If On Spam List = yes +Include Binary Attachments In SpamAssassin = no +Spam Score = yes +Cache SpamAssassin Results = yes +SpamAssassin Cache Database File = %spool-dir%/incoming/SpamAssassin.cache.db +Rebuild Bayes Every = 0 +Wait During Bayes Rebuild = no +Use Custom Spam Scanner = no +Max Custom Spam Scanner Size = 20k +Custom Spam Scanner Timeout = 20 +Max Custom Spam Scanner Timeouts = 10 +Custom Spam Scanner Timeout History = 20 +Spam Actions = %brules-dir%/spam.actions.rules +High Scoring Spam Actions = %brules-dir%/highspam.actions.rules +Non Spam Actions = %rules-dir%/nonspam.actions.rules +SpamAssassin Rule Actions = +Sender Spam Report = %brules-dir%/senderspamreport.rules +Sender Spam List Report = %brules-dir%/senderspamrblreport.rules +Sender SpamAssassin Report = %brules-dir%/senderspamsareport.rules +Inline Spam Warning = %brules-dir%/inlinespamwarning.rules +Recipient Spam Report = %brules-dir%/recipientspamreport.rules +Enable Spam Bounce = %rules-dir%/bounce.rules +Bounce Spam As Attachment = no +Syslog Facility = mail +Log Speed = no +Log Spam = no +Log Non Spam = no +Log Delivery And Non-Delivery = no +Log Permitted Filenames = no +Log Permitted Filetypes = no +Log Permitted File MIME Types = no +Log Silent Viruses = no +Log Dangerous HTML Tags = no +Log SpamAssassin Rule Actions = no +SpamAssassin Temporary Dir = /var/spool/MailScanner/incoming/SpamAssassin-Temp +SpamAssassin User State Dir = +SpamAssassin Install Prefix = +SpamAssassin Site Rules Dir = /etc/mail/spamassassin +SpamAssassin Local Rules Dir = +SpamAssassin Local State Dir = +SpamAssassin Default Rules Dir = +DB DSN = DBI:Pg:database=baruwa +DB Username = baruwa +DB Password = password +SQL Serial Number = SELECT MAX(value) AS confserialnumber FROM configurations WHERE internal='confserialnumber' +SQL Quick Peek = SELECT dbvalue(value) AS value FROM quickpeek WHERE external = ? AND (hostname = ? OR hostname='default') LIMIT 1 +SQL Config = SELECT internal, dbvalue(value) AS value, hostname FROM quickpeek WHERE hostname=? OR hostname='default' +SQL Ruleset = SELECT row_number, ruleset AS rule FROM msrulesets WHERE name=? +SQL SpamAssassin Config = +SQL Debug = no +Sphinx Host = 127.0.0.1 +Sphinx Port = 9306 +MCP Checks = no +First Check = spam +MCP Required SpamAssassin Score = 1 +MCP High SpamAssassin Score = 10 +MCP Error Score = 1 +MCP Header = X-%org-name%-BaruwaFW-MCPCheck: +Non MCP Actions = deliver +MCP Actions = deliver +High Scoring MCP Actions = deliver +Bounce MCP As Attachment = no +MCP Modify Subject = start +MCP Subject Text = {MCP?} +High Scoring MCP Modify Subject = start +High Scoring MCP Subject Text = {MCP?} +Is Definitely MCP = no +Is Definitely Not MCP = no +Definite MCP Is High Scoring = no +Always Include MCP Report = no +Detailed MCP Report = yes +Include Scores In MCP Report = no +Log MCP = no +MCP Max SpamAssassin Timeouts = 20 +MCP Max SpamAssassin Size = 100k +MCP SpamAssassin Timeout = 10 +MCP SpamAssassin Prefs File = %mcp-dir%/mcp.spam.assassin.prefs.conf +MCP SpamAssassin User State Dir = +MCP SpamAssassin Local Rules Dir = %mcp-dir% +MCP SpamAssassin Default Rules Dir = %mcp-dir% +MCP SpamAssassin Install Prefix = %mcp-dir% +Recipient MCP Report = %report-dir%/recipient.mcp.report.txt +Sender MCP Report = %report-dir%/sender.mcp.report.txt +Use Default Rules With Multiple Recipients = no +Read IP Address From Received Header = no +Spam Score Number Format = %d.1f +MailScanner Version Number = 4.85.5 +SpamAssassin Cache Timings = 1800,300,10800,172800,600 +Debug = no +Debug SpamAssassin = no +Run In Foreground = no +Always Looked Up Last = &BaruwaLog +Always Looked Up Last After Batch = no +Deliver In Background = yes +Delivery Method = batch +Split Exim Spool = no +Lockfile Dir = %spool-dir%/incoming/Locks +Custom Functions Dir = /usr/share/baruwa/CustomFunctions +Lock Type = +Syslog Socket Type = +Automatic Syntax Check = yes +Minimum Code Status = supported +include /etc/MailScanner/conf.d/*.conf +" + +test Mailscanner.lns get conf = + { "#comment" = "Main configuration file for the MailScanner E-Mail Virus Scanner"} + { "%org-name%" = "BARUWA" } + { "%org-long-name%" = "BARUWA MAILFW" } + { "%web-site%" = "www.baruwa.com" } + { "%etc-dir%" = "/etc/MailScanner" } + { "%reports-base%" = "/etc/MailScanner/reports" } + { "%report-dir%" = "/etc/MailScanner/reports/en" } + { "%rules-dir%" = "/etc/MailScanner/rules" } + { "%mcp-dir%" = "/etc/MailScanner/mcp" } + { "%spool-dir%" = "/var/spool/MailScanner" } + { "%signature-dir%" = "/etc/MailScanner/baruwa/signatures" } + { "%brules-dir%" = "/etc/MailScanner/baruwa/rules" } + { "Max Children" = "5" } + { "Run As User" = "exim" } + { "Run As Group" = "exim" } + { "Queue Scan Interval" = "6" } + { "Incoming Queue Dir" = "/var/spool/exim.in/input" } + { "Outgoing Queue Dir" = "/var/spool/exim/input" } + { "Incoming Work Dir" = "%spool-dir%/incoming" } + { "Quarantine Dir" = "%spool-dir%/quarantine" } + { "PID file" = "/var/run/MailScanner/MailScanner.pid" } + { "Restart Every" = "7200" } + { "MTA" = "exim" } + { "Sendmail" = "/usr/sbin/exim -C /etc/exim/exim_out.conf" } + { "Sendmail2" = "/usr/sbin/exim -C /etc/exim/exim_out.conf" } + { "Incoming Work User" = "exim" } + { "Incoming Work Group" = "clam" } + { "Incoming Work Permissions" = "0640" } + { "Quarantine User" = "exim" } + { "Quarantine Group" = "baruwa" } + { "Quarantine Permissions" = "0660" } + { "Max Unscanned Bytes Per Scan" = "100m" } + { "Max Unsafe Bytes Per Scan" = "50m" } + { "Max Unscanned Messages Per Scan" = "30" } + { "Max Unsafe Messages Per Scan" = "30" } + { "Max Normal Queue Size" = "800" } + { "Scan Messages" = "%rules-dir%/scan.messages.rules" } + { "Reject Message" = "no" } + { "Maximum Processing Attempts" = "6" } + { "Processing Attempts Database" = "%spool-dir%/incoming/Processing.db" } + { "Maximum Attachments Per Message" = "200" } + { "Expand TNEF" = "yes" } + { "Use TNEF Contents" = "replace" } + { "Deliver Unparsable TNEF" = "no" } + { "TNEF Expander" = "/usr/bin/tnef --maxsize=100000000" } + { "TNEF Timeout" = "120" } + { "File Command" = "/usr/sbin/file-wrapper" } + { "File Timeout" = "20" } + { "Gunzip Command" = "/bin/gunzip" } + { "Gunzip Timeout" = "50" } + { "Unrar Command" = "/usr/bin/unrar" } + { "Unrar Timeout" = "50" } + { "Find UU-Encoded Files" = "no" } + { "Maximum Message Size" = "%brules-dir%/message.size.rules" } + { "Maximum Attachment Size" = "-1" } + { "Minimum Attachment Size" = "-1" } + { "Maximum Archive Depth" = "4" } + { "Find Archives By Content" = "yes" } + { "Unpack Microsoft Documents" = "yes" } + { "Zip Attachments" = "no" } + { "Attachments Zip Filename" = "MessageAttachments.zip" } + { "Attachments Min Total Size To Zip" = "100k" } + { "Attachment Extensions Not To Zip" = ".zip .rar .gz .tgz .jpg .jpeg .mpg .mpe .mpeg .mp3 .rpm .htm .html .eml" } + { "Add Text Of Doc" = "no" } + { "Antiword" = "/usr/bin/antiword -f" } + { "Antiword Timeout" = "50" } + { "Unzip Maximum Files Per Archive" = "0" } + { "Unzip Maximum File Size" = "50k" } + { "Unzip Filenames" = "*.txt *.ini *.log *.csv" } + { "Unzip MimeType" = "text/plain" } + { "Virus Scanning" = "%brules-dir%/virus.checks.rules" } + { "Virus Scanners" = "auto" } + { "Virus Scanner Timeout" = "300" } + { "Deliver Disinfected Files" = "no" } + { "Silent Viruses" = "HTML-IFrame All-Viruses" } + { "Still Deliver Silent Viruses" = "no" } + { "Non-Forging Viruses" = "Joke/ OF97/ WM97/ W97M/ eicar" } + { "Spam-Virus Header" = "X-%org-name%-BaruwaFW-SpamVirus-Report:" } + { "Virus Names Which Are Spam" = "Sanesecurity.Spam*UNOFFICIAL HTML/* *Phish* *Suspected-phishing_safebrowsing*" } + { "Block Encrypted Messages" = "no" } + { "Block Unencrypted Messages" = "no" } + { "Allow Password-Protected Archives" = "yes" } + { "Check Filenames In Password-Protected Archives" = "yes" } + { "Allowed Sophos Error Messages" } + { "Sophos IDE Dir" = "/opt/sophos-av/lib/sav" } + { "Sophos Lib Dir" = "/opt/sophos-av/lib" } + { "Monitors For Sophos Updates" = "/opt/sophos-av/lib/sav/*.ide" } + { "Monitors for ClamAV Updates" = "/var/lib/clamav/*.cvd" } + { "ClamAVmodule Maximum Recursion Level" = "8" } + { "ClamAVmodule Maximum Files" = "1000" } + { "ClamAVmodule Maximum File Size" = "10000000" } + { "ClamAVmodule Maximum Compression Ratio" = "250" } + { "Clamd Port" = "3310" } + { "Clamd Socket" = "/var/run/clamav/clamd.sock" } + { "Clamd Lock File" } + { "Clamd Use Threads" = "no" } + { "ClamAV Full Message Scan" = "yes" } + { "Fpscand Port" = "10200" } + { "Dangerous Content Scanning" = "%rules-dir%/content.scanning.rules" } + { "Allow Partial Messages" = "no" } + { "Allow External Message Bodies" = "no" } + { "Find Phishing Fraud" = "yes" } + { "Also Find Numeric Phishing" = "yes" } + { "Use Stricter Phishing Net" = "yes" } + { "Highlight Phishing Fraud" = "yes" } + { "Phishing Safe Sites File" = "%etc-dir%/phishing.safe.sites.conf" } + { "Phishing Bad Sites File" = "%etc-dir%/phishing.bad.sites.conf" } + { "Country Sub-Domains List" = "%etc-dir%/country.domains.conf" } + { "Allow IFrame Tags" = "disarm" } + { "Allow Form Tags" = "disarm" } + { "Allow Script Tags" = "disarm" } + { "Allow WebBugs" = "disarm" } + { "Ignored Web Bug Filenames" = "spacer pixel.gif pixel.png gap" } + { "Known Web Bug Servers" = "msgtag.com" } + { "Web Bug Replacement" = "https://datafeeds.baruwa.com/1x1spacer.gif" } + { "Allow Object Codebase Tags" = "disarm" } + { "Convert Dangerous HTML To Text" = "no" } + { "Convert HTML To Text" = "no" } + { "Archives Are" = "zip rar ole" } + { "Allow Filenames" } + { "Deny Filenames" } + { "Filename Rules" = "%rules-dir%/filename.rules" } + { "Allow Filetypes" } + { "Allow File MIME Types" } + { "Deny Filetypes" } + { "Deny File MIME Types" } + { "Filetype Rules" = "%rules-dir%/filetype.rules" } + { "Archives: Allow Filenames" } + { "Archives: Deny Filenames" } + { "Archives: Filename Rules" = "%etc-dir%/archives.filename.rules.conf" } + { "Archives: Allow Filetypes" } + { "Archives: Allow File MIME Types" } + { "Archives: Deny Filetypes" } + { "Archives: Deny File MIME Types" } + { "Archives: Filetype Rules" = "%etc-dir%/archives.filetype.rules.conf" } + { "Default Rename Pattern" = "__FILENAME__.disarmed" } + { "Quarantine Infections" = "yes" } + { "Quarantine Silent Viruses" = "no" } + { "Quarantine Modified Body" = "no" } + { "Quarantine Whole Message" = "yes" } + { "Quarantine Whole Messages As Queue Files" = "no" } + { "Keep Spam And MCP Archive Clean" = "yes" } + { "Language Strings" = "%brules-dir%/languages.rules" } + { "Rejection Report" = "%brules-dir%/rejectionreport.rules" } + { "Deleted Bad Content Message Report" = "%brules-dir%/deletedcontentmessage.rules" } + { "Deleted Bad Filename Message Report" = "%brules-dir%/deletedfilenamemessage.rules" } + { "Deleted Virus Message Report" = "%brules-dir%/deletedvirusmessage.rules" } + { "Deleted Size Message Report" = "%brules-dir%/deletedsizemessage.rules" } + { "Stored Bad Content Message Report" = "%brules-dir%/storedcontentmessage.rules" } + { "Stored Bad Filename Message Report" = "%brules-dir%/storedfilenamemessage.rules" } + { "Stored Virus Message Report" = "%brules-dir%/storedvirusmessage.rules" } + { "Stored Size Message Report" = "%brules-dir%/storedsizemessage.rules" } + { "Disinfected Report" = "%brules-dir%/disinfectedreport.rules" } + { "Inline HTML Signature" = "%brules-dir%/html.sigs.rules" } + { "Inline Text Signature" = "%brules-dir%/text.sigs.rules" } + { "Signature Image Filename" = "%brules-dir%/sig.imgs.names.rules" } + { "Signature Image Filename" = "%brules-dir%/sig.imgs.rules" } + { "Inline HTML Warning" = "%brules-dir%/inlinewarninghtml.rules" } + { "Inline Text Warning" = "%brules-dir%/inlinewarningtxt.rules" } + { "Sender Content Report" = "%brules-dir%/sendercontentreport.rules" } + { "Sender Error Report" = "%brules-dir%/sendererrorreport.rules" } + { "Sender Bad Filename Report" = "%brules-dir%/senderfilenamereport.rules" } + { "Sender Virus Report" = "%brules-dir%/sendervirusreport.rules" } + { "Sender Size Report" = "%brules-dir%/sendersizereport.rules" } + { "Hide Incoming Work Dir" = "yes" } + { "Include Scanner Name In Reports" = "yes" } + { "Mail Header" = "X-%org-name%-BaruwaFW:" } + { "Spam Header" = "X-%org-name%-BaruwaFW-SpamCheck:" } + { "Spam Score Header" = "X-%org-name%-BaruwaFW-SpamScore:" } + { "Information Header" = "X-%org-name%-BaruwaFW-Information:" } + { "Add Envelope From Header" = "yes" } + { "Add Envelope To Header" = "no" } + { "Envelope From Header" = "X-BARUWA-BaruwaFW-From:" } + { "Envelope To Header" = "X-%org-name%-BaruwaFW-To:" } + { "ID Header" = "X-%org-name%-BaruwaFW-ID:" } + { "IP Protocol Version Header" } + { "Spam Score Character" = "s" } + { "SpamScore Number Instead Of Stars" = "no" } + { "Minimum Stars If On Spam List" = "0" } + { "Clean Header Value" = "Found to be clean" } + { "Infected Header Value" = "Found to be infected" } + { "Disinfected Header Value" = "Disinfected" } + { "Information Header Value" = "Please contact %org-long-name% for more information" } + { "Detailed Spam Report" = "yes" } + { "Include Scores In SpamAssassin Report" = "yes" } + { "Always Include SpamAssassin Report" = "no" } + { "Multiple Headers" = "add" } + { "Place New Headers At Top Of Message" = "yes" } + { "Hostname" = "the %org-name% ($HOSTNAME) Baruwa" } + { "Sign Messages Already Processed" = "no" } + { "Sign Clean Messages" = "%brules-dir%/sign.clean.msgs.rules" } + { "Attach Image To Signature" = "yes" } + { "Attach Image To HTML Message Only" = "yes" } + { "Allow Multiple HTML Signatures" = "no" } + { "Dont Sign HTML If Headers Exist" } + { "Mark Infected Messages" = "yes" } + { "Mark Unscanned Messages" = "no" } + { "Unscanned Header Value" = "Not scanned: please contact %org-long-name% for details" } + { "Remove These Headers" = "X-Mozilla-Status: X-Mozilla-Status2:" } + { "Deliver Cleaned Messages" = "yes" } + { "Notify Senders" = "no" } + { "Notify Senders Of Viruses" = "no" } + { "Notify Senders Of Blocked Filenames Or Filetypes" = "no" } + { "Notify Senders Of Blocked Size Attachments" = "no" } + { "Notify Senders Of Other Blocked Content" = "no" } + { "Never Notify Senders Of Precedence" = "list bulk" } + { "Scanned Modify Subject" = "no" } + { "Scanned Subject Text" = "{Scanned}" } + { "Virus Modify Subject" = "no" } + { "Virus Subject Text" = "{Virus?}" } + { "Filename Modify Subject" = "no" } + { "Filename Subject Text" = "{Filename?}" } + { "Content Modify Subject" = "no" } + { "Content Subject Text" = "{Dangerous Content?}" } + { "Size Modify Subject" = "no" } + { "Size Subject Text" = "{Size}" } + { "Disarmed Modify Subject" = "no" } + { "Disarmed Subject Text" = "{Disarmed}" } + { "Phishing Modify Subject" = "yes" } + { "Phishing Subject Text" = "{Suspected Phishing?}" } + { "Spam Modify Subject" = "no" } + { "Spam Subject Text" = "{Spam?}" } + { "High Scoring Spam Modify Subject" = "no" } + { "High Scoring Spam Subject Text" = "{Spam?}" } + { "Warning Is Attachment" = "yes" } + { "Attachment Warning Filename" = "%org-name%-Attachment-Warning.txt" } + { "Attachment Encoding Charset" = "ISO-8859-1" } + { "Archive Mail" } + { "Missing Mail Archive Is" = "file" } + { "Send Notices" = "no" } + { "Notices Include Full Headers" = "yes" } + { "Hide Incoming Work Dir in Notices" = "yes" } + { "Notice Signature" = "-- \\n%org-name%\\nEmail Security\\n%website%" } + { "Notices From" = "Baruwa" } + { "Notices To" = "postmaster" } + { "Local Postmaster" = "postmaster" } + { "Spam List Definitions" = "%etc-dir%/spam.lists.conf" } + { "Virus Scanner Definitions" = "%etc-dir%/virus.scanners.conf" } + { "Spam Checks" = "%brules-dir%/spam.checks.rules" } + { "Spam List" } + { "Spam Domain List" } + { "Spam Lists To Be Spam" = "1" } + { "Spam Lists To Reach High Score" = "3" } + { "Spam List Timeout" = "10" } + { "Max Spam List Timeouts" = "7" } + { "Spam List Timeouts History" = "10" } + { "Is Definitely Not Spam" = "%brules-dir%/approved.senders.rules" } + { "Is Definitely Spam" = "%brules-dir%/banned.senders.rules" } + { "Definite Spam Is High Scoring" = "yes" } + { "Ignore Spam Whitelist If Recipients Exceed" = "20" } + { "Max Spam Check Size" = "4000k" } + { "Use Watermarking" = "no" } + { "Add Watermark" = "yes" } + { "Check Watermarks With No Sender" = "yes" } + { "Treat Invalid Watermarks With No Sender as Spam" = "nothing" } + { "Check Watermarks To Skip Spam Checks" = "yes" } + { "Watermark Secret" = "%org-name%-BaruwaFW-Secret" } + { "Watermark Lifetime" = "604800" } + { "Watermark Header" = "X-%org-name%-BaruwaFW-Watermark:" } + { "Use SpamAssassin" = "yes" } + { "Max SpamAssassin Size" = "800k" } + { "Required SpamAssassin Score" = "%brules-dir%/spam.score.rules" } + { "High SpamAssassin Score" = "%brules-dir%/highspam.score.rules" } + { "SpamAssassin Auto Whitelist" = "yes" } + { "SpamAssassin Timeout" = "75" } + { "Max SpamAssassin Timeouts" = "10" } + { "SpamAssassin Timeouts History" = "30" } + { "Check SpamAssassin If On Spam List" = "yes" } + { "Include Binary Attachments In SpamAssassin" = "no" } + { "Spam Score" = "yes" } + { "Cache SpamAssassin Results" = "yes" } + { "SpamAssassin Cache Database File" = "%spool-dir%/incoming/SpamAssassin.cache.db" } + { "Rebuild Bayes Every" = "0" } + { "Wait During Bayes Rebuild" = "no" } + { "Use Custom Spam Scanner" = "no" } + { "Max Custom Spam Scanner Size" = "20k" } + { "Custom Spam Scanner Timeout" = "20" } + { "Max Custom Spam Scanner Timeouts" = "10" } + { "Custom Spam Scanner Timeout History" = "20" } + { "Spam Actions" = "%brules-dir%/spam.actions.rules" } + { "High Scoring Spam Actions" = "%brules-dir%/highspam.actions.rules" } + { "Non Spam Actions" = "%rules-dir%/nonspam.actions.rules" } + { "SpamAssassin Rule Actions" } + { "Sender Spam Report" = "%brules-dir%/senderspamreport.rules" } + { "Sender Spam List Report" = "%brules-dir%/senderspamrblreport.rules" } + { "Sender SpamAssassin Report" = "%brules-dir%/senderspamsareport.rules" } + { "Inline Spam Warning" = "%brules-dir%/inlinespamwarning.rules" } + { "Recipient Spam Report" = "%brules-dir%/recipientspamreport.rules" } + { "Enable Spam Bounce" = "%rules-dir%/bounce.rules" } + { "Bounce Spam As Attachment" = "no" } + { "Syslog Facility" = "mail" } + { "Log Speed" = "no" } + { "Log Spam" = "no" } + { "Log Non Spam" = "no" } + { "Log Delivery And Non-Delivery" = "no" } + { "Log Permitted Filenames" = "no" } + { "Log Permitted Filetypes" = "no" } + { "Log Permitted File MIME Types" = "no" } + { "Log Silent Viruses" = "no" } + { "Log Dangerous HTML Tags" = "no" } + { "Log SpamAssassin Rule Actions" = "no" } + { "SpamAssassin Temporary Dir" = "/var/spool/MailScanner/incoming/SpamAssassin-Temp" } + { "SpamAssassin User State Dir" } + { "SpamAssassin Install Prefix" } + { "SpamAssassin Site Rules Dir" = "/etc/mail/spamassassin" } + { "SpamAssassin Local Rules Dir" } + { "SpamAssassin Local State Dir" } + { "SpamAssassin Default Rules Dir" } + { "DB DSN" = "DBI:Pg:database=baruwa" } + { "DB Username" = "baruwa" } + { "DB Password" = "password" } + { "SQL Serial Number" = "SELECT MAX(value) AS confserialnumber FROM configurations WHERE internal='confserialnumber'" } + { "SQL Quick Peek" = "SELECT dbvalue(value) AS value FROM quickpeek WHERE external = ? AND (hostname = ? OR hostname='default') LIMIT 1" } + { "SQL Config" = "SELECT internal, dbvalue(value) AS value, hostname FROM quickpeek WHERE hostname=? OR hostname='default'" } + { "SQL Ruleset" = "SELECT row_number, ruleset AS rule FROM msrulesets WHERE name=?" } + { "SQL SpamAssassin Config" } + { "SQL Debug" = "no" } + { "Sphinx Host" = "127.0.0.1" } + { "Sphinx Port" = "9306" } + { "MCP Checks" = "no" } + { "First Check" = "spam" } + { "MCP Required SpamAssassin Score" = "1" } + { "MCP High SpamAssassin Score" = "10" } + { "MCP Error Score" = "1" } + { "MCP Header" = "X-%org-name%-BaruwaFW-MCPCheck:" } + { "Non MCP Actions" = "deliver" } + { "MCP Actions" = "deliver" } + { "High Scoring MCP Actions" = "deliver" } + { "Bounce MCP As Attachment" = "no" } + { "MCP Modify Subject" = "start" } + { "MCP Subject Text" = "{MCP?}" } + { "High Scoring MCP Modify Subject" = "start" } + { "High Scoring MCP Subject Text" = "{MCP?}" } + { "Is Definitely MCP" = "no" } + { "Is Definitely Not MCP" = "no" } + { "Definite MCP Is High Scoring" = "no" } + { "Always Include MCP Report" = "no" } + { "Detailed MCP Report" = "yes" } + { "Include Scores In MCP Report" = "no" } + { "Log MCP" = "no" } + { "MCP Max SpamAssassin Timeouts" = "20" } + { "MCP Max SpamAssassin Size" = "100k" } + { "MCP SpamAssassin Timeout" = "10" } + { "MCP SpamAssassin Prefs File" = "%mcp-dir%/mcp.spam.assassin.prefs.conf" } + { "MCP SpamAssassin User State Dir" } + { "MCP SpamAssassin Local Rules Dir" = "%mcp-dir%" } + { "MCP SpamAssassin Default Rules Dir" = "%mcp-dir%" } + { "MCP SpamAssassin Install Prefix" = "%mcp-dir%" } + { "Recipient MCP Report" = "%report-dir%/recipient.mcp.report.txt" } + { "Sender MCP Report" = "%report-dir%/sender.mcp.report.txt" } + { "Use Default Rules With Multiple Recipients" = "no" } + { "Read IP Address From Received Header" = "no" } + { "Spam Score Number Format" = "%d.1f" } + { "MailScanner Version Number" = "4.85.5" } + { "SpamAssassin Cache Timings" = "1800,300,10800,172800,600" } + { "Debug" = "no" } + { "Debug SpamAssassin" = "no" } + { "Run In Foreground" = "no" } + { "Always Looked Up Last" = "&BaruwaLog" } + { "Always Looked Up Last After Batch" = "no" } + { "Deliver In Background" = "yes" } + { "Delivery Method" = "batch" } + { "Split Exim Spool" = "no" } + { "Lockfile Dir" = "%spool-dir%/incoming/Locks" } + { "Custom Functions Dir" = "/usr/share/baruwa/CustomFunctions" } + { "Lock Type" } + { "Syslog Socket Type" } + { "Automatic Syntax Check" = "yes" } + { "Minimum Code Status" = "supported" } + { "include" = "/etc/MailScanner/conf.d/*.conf"} \ No newline at end of file diff -Nru augeas-1.3.0/lenses/tests/test_mailscanner_rules.aug augeas-1.4.0/lenses/tests/test_mailscanner_rules.aug --- augeas-1.3.0/lenses/tests/test_mailscanner_rules.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_mailscanner_rules.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,59 @@ +module Test_Mailscanner_Rules = +let conf = "# JKF 10/08/2007 Adobe Acrobat nastiness +rename \.fdf$ Dangerous Adobe Acrobat data-file Opening this file can cause auto-loading of any file from the internet + +# JKF 04/01/2005 More Microsoft security vulnerabilities +deny \.ico$ Windows icon file security vulnerability Possible buffer overflow in Windows +allow \.(jan|feb|mar|apr|may|jun|june|jul|july|aug|sep|sept|oct|nov|dec)\.[a-z0-9]{3}$ - - +deny+delete \.cur$ Windows cursor file security vulnerability Possible buffer overflow in Windows +andrew@baruwa.com,andrew@baruwa.net \.reg$ Possible Windows registry attack Windows registry entries are very dangerous in email +andrew@baruwa.com andrew@baruwa.net \.chm$ Possible compiled Help file-based virus Compiled help files are very dangerous in email +rename to .ppt \.pps$ Renamed .pps to .ppt Renamed .pps to .ppt +" + +test Mailscanner_Rules.lns get conf = + { "#comment" = "JKF 10/08/2007 Adobe Acrobat nastiness" } + { "1" + { "action" = "rename" } + { "regex" = "\.fdf$" } + { "log-text" = "Dangerous Adobe Acrobat data-file" } + { "user-report" = "Opening this file can cause auto-loading of any file from the internet" } + } + {} + { "#comment" = "JKF 04/01/2005 More Microsoft security vulnerabilities" } + { "2" + { "action" = "deny" } + { "regex" = "\.ico$" } + { "log-text" = "Windows icon file security vulnerability" } + { "user-report" = "Possible buffer overflow in Windows" } + } + { "3" + { "action" = "allow" } + { "regex" = "\.(jan|feb|mar|apr|may|jun|june|jul|july|aug|sep|sept|oct|nov|dec)\.[a-z0-9]{3}$" } + { "log-text" = "-" } + { "user-report" = "-" } + } + { "4" + { "action" = "deny+delete" } + { "regex" = "\.cur$" } + { "log-text" = "Windows cursor file security vulnerability" } + { "user-report" = "Possible buffer overflow in Windows" } + } + { "5" + { "action" = "andrew@baruwa.com,andrew@baruwa.net" } + { "regex" = "\.reg$" } + { "log-text" = "Possible Windows registry attack" } + { "user-report" = "Windows registry entries are very dangerous in email" } + } + { "6" + { "action" = "andrew@baruwa.com andrew@baruwa.net" } + { "regex" = "\.chm$" } + { "log-text" = "Possible compiled Help file-based virus" } + { "user-report" = "Compiled help files are very dangerous in email" } + } + { "7" + { "action" = "rename to .ppt" } + { "regex" = "\.pps$" } + { "log-text" = "Renamed .pps to .ppt" } + { "user-report" = "Renamed .pps to .ppt" } + } \ No newline at end of file diff -Nru augeas-1.3.0/lenses/tests/test_nginx.aug augeas-1.4.0/lenses/tests/test_nginx.aug --- augeas-1.3.0/lenses/tests/test_nginx.aug 2012-12-21 22:57:22.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_nginx.aug 2015-06-01 22:03:07.000000000 +0000 @@ -2,9 +2,26 @@ Module: Test_Nginx Provides unit tests and examples for the lens. *) -module Test_nginx = +module Test_nginx = - let conf ="user nginx nginx; +(* Do some limited typechecking on the recursive lens; note that + unrolling once more leads to a typecheck error that seems to + be spurious, though it's not clear why + + Unrolling once more amounts to adding the clause + Nginx.block (Nginx.block Nginx.simple) + to unrolled and results in an error + overlapping lenses in union.get + Example matched by both: 'upstream{}\n' +*) +let unrolled = Nginx.simple | Nginx.block Nginx.simple + +let lns_unrolled = (Util.comment | Util.empty | unrolled) + +(* Normal unit tests *) +let lns = Nginx.lns + +let conf ="user nginx nginx; worker_processes 1; error_log /var/log/nginx/error_log info; @@ -48,45 +65,148 @@ } " - test Nginx.lns get conf = - { "user" = "nginx nginx" } - { "worker_processes" = "1" } - { "error_log" = "/var/log/nginx/error_log info" } - {} - { "events" - { "worker_connections" = "1024" } - { "use" = "epoll" } } - {} - { "#comment" = "comment1" } - { "#comment" = "comment2" } - {} - { "http" - { "#comment" = "comment3" } - { "include" = "/etc/nginx/mime.types" } - { "default_type" = "application/octet-stream" } - { "log_format" = "main +test lns get conf = + { "user" = "nginx nginx" } + { "worker_processes" = "1" } + { "error_log" = "/var/log/nginx/error_log info" } + {} + { "events" + { "worker_connections" = "1024" } + { "use" = "epoll" } } + {} + { "#comment" = "comment1" } + { "#comment" = "comment2" } + {} + { "http" + { "#comment" = "comment3" } + { "include" = "/etc/nginx/mime.types" } + { "default_type" = "application/octet-stream" } + { "log_format" = "main '$remote_addr - $remote_user [$time_local] ' '\"$request\" $status $bytes_sent ' '\"$http_referer\" \"$http_user_agent\" ' '\"$gzip_ratio\"'" } - { "client_header_timeout" = "10m" } - { "client_body_timeout" = "10m" } - { "send_timeout" = "10m" } - { "connection_pool_size" = "256" } - { "client_header_buffer_size" = "2k" } - { "large_client_header_buffers" = "4 8k" } - { "request_pool_size" = "4k" } - { "gzip" = "on" } - { "gzip_min_length" = "1000" } - { "gzip_buffers" = "4 8k" } - { "gzip_types" = "text/plain application/json" } - { "output_buffers" = "1 32k" } - { "postpone_output" = "1460" } - { "sendfile" = "on" } - { "tcp_nopush" = "on" } - { "tcp_nodelay" = "on" } - { "keepalive_timeout" = "75 20" } - { "ignore_invalid_headers" = "on" } - { "index" = "index.html index.php" } - { "include" = "vhosts/*.conf" } } - + { "client_header_timeout" = "10m" } + { "client_body_timeout" = "10m" } + { "send_timeout" = "10m" } + { "connection_pool_size" = "256" } + { "client_header_buffer_size" = "2k" } + { "large_client_header_buffers" = "4 8k" } + { "request_pool_size" = "4k" } + { "gzip" = "on" } + { "gzip_min_length" = "1000" } + { "gzip_buffers" = "4 8k" } + { "gzip_types" = "text/plain application/json" } + { "output_buffers" = "1 32k" } + { "postpone_output" = "1460" } + { "sendfile" = "on" } + { "tcp_nopush" = "on" } + { "tcp_nodelay" = "on" } + { "keepalive_timeout" = "75 20" } + { "ignore_invalid_headers" = "on" } + { "index" = "index.html index.php" } + { "include" = "vhosts/*.conf" } } + +(* location blocks *) +test lns get "location / { }\n" = + { "location" + { "#uri" = "/" } } + +test lns get "location = / { }\n" = + { "location" + { "#comp" = "=" } + { "#uri" = "/" } } + +test lns get "location /documents/ { }\n" = + { "location" + { "#uri" = "/documents/" } } + +test lns get "location ^~ /images/ { }\n" = + { "location" + { "#comp" = "^~" } + { "#uri" = "/images/" } } + +test lns get "location ~* \.(gif|jpg|jpeg)$ { }\n" = + { "location" + { "#comp" = "~*" } + { "#uri" = "\.(gif|jpg|jpeg)$" } } + +test lns get "location @fallback { }\n" = + { "location" + { "#uri" = "@fallback" } } + +(* if blocks *) +test lns get "if ($slow) { + tcp_nodelay on; +}\n" = + { "if" + { "#cond" = "($slow)" } + { "tcp_nodelay" = "on" } } + +test lns get "if ($request_method = POST) { }\n" = + { "if" + { "#cond" = "($request_method = POST)" } } + + +test lns get "if ($http_cookie ~* \"id=([^;]+)(?:;|$)\") { }\n" = + { "if" + { "#cond" = "($http_cookie ~* \"id=([^;]+)(?:;|$)\")" } } + +(* geo blocks *) +test lns get "geo $geo { }\n" = + { "geo" + { "#geo" = "$geo" } } + +test lns get "geo $address $geo { }\n" = + { "geo" + { "#address" = "$address" } + { "#geo" = "$geo" } } + +(* map blocks *) +test lns get "map $http_host $name { }\n" = + { "map" + { "#source" = "$http_host" } + { "#variable" = "$name" } } + +(* split_clients block *) +test lns get "split_clients \"${remote_addr}AAA\" $variable { }\n" = + { "split_clients" + { "#string" = "\"${remote_addr}AAA\"" } + { "#variable" = "$variable" } } + +(* upstream block *) +test lns get "upstream backend { }\n" = + { "upstream" + { "#name" = "backend" } } + +(* GH #179 - recursive blocks *) +let http = "http { + server { + listen 80; + location / { + root\thtml; + } + } + gzip on; +}\n" + +test lns get http = + { "http" + { "server" + { "listen" = "80" } + { "location" + { "#uri" = "/" } + { "root" = "html" } } } + { "gzip" = "on" } } + +(* Make sure we do not screw up the indentation of the file *) +test lns put http after set "/http/gzip" "off" = +"http { + server { + listen 80; + location / { + root\thtml; + } + } + gzip off; +}\n" diff -Nru augeas-1.3.0/lenses/tests/test_pagekite.aug augeas-1.4.0/lenses/tests/test_pagekite.aug --- augeas-1.3.0/lenses/tests/test_pagekite.aug 2014-10-17 16:41:03.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_pagekite.aug 2015-05-22 22:31:25.000000000 +0000 @@ -64,21 +64,27 @@ { } { "service_on" { "1" - { "source" = "raw/22:@kitename" } - { "destination" = "localhost:22" } + { "protocol" = "raw/22" } + { "kitename" = "@kitename" } + { "backend_host" = "localhost" } + { "backend_port" = "22" } { "secret" = "@kitesecret" } } } { "service_on" { "2" - { "source" = "http:192.168.0.1" } - { "destination" = "127.0.0.1:80" } + { "protocol" = "http" } + { "kitename" = "192.168.0.1" } + { "backend_host" = "127.0.0.1" } + { "backend_port" = "80" } } } { "service_on" { "3" - { "source" = "https:yourhostname,fqdn" } - { "destination" = "127.0.0.1:443" } + { "protocol" = "https" } + { "kitename" = "yourhostname,fqdn" } + { "backend_host" = "127.0.0.1" } + { "backend_port" = "443" } } } diff -Nru augeas-1.3.0/lenses/tests/test_passwd.aug augeas-1.4.0/lenses/tests/test_passwd.aug --- augeas-1.3.0/lenses/tests/test_passwd.aug 2013-05-13 23:18:20.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_passwd.aug 2015-06-01 22:47:42.000000000 +0000 @@ -43,6 +43,15 @@ test Passwd.lns get "+\n" = { "@nisdefault" } +test Passwd.lns get "+::::::\n" = + { "@nisdefault" + { "password" = "" } + { "uid" = "" } + { "gid" = "" } + { "name" } + { "home" } + { "shell" } } + test Passwd.lns get "+::::::/sbin/nologin\n" = { "@nisdefault" { "password" = "" } @@ -52,8 +61,44 @@ { "home" } { "shell" = "/sbin/nologin" } } +test Passwd.lns get "+:*:0:0:::\n" = + { "@nisdefault" + { "password" = "*" } + { "uid" = "0" } + { "gid" = "0" } + { "name" } + { "home" } + { "shell" } } + (* NIS entries with overrides, ticket #339 *) test Passwd.lns get "+@bob:::::/home/bob:/bin/bash\n" = { "@nis" = "bob" { "home" = "/home/bob" } { "shell" = "/bin/bash" } } + +(* NIS user entries *) +test Passwd.lns get "+bob::::::\n" = + { "@+nisuser" = "bob" } + +test Passwd.lns get "+bob::::User Comment:/home/bob:/bin/bash\n" = + { "@+nisuser" = "bob" + { "name" = "User Comment" } + { "home" = "/home/bob" } + { "shell" = "/bin/bash" } } + +test Passwd.lns put "+bob::::::\n" after + set "@+nisuser" "alice" += "+alice::::::\n" + +test Passwd.lns put "+bob::::::\n" after + set "@+nisuser/name" "User Comment"; + set "@+nisuser/home" "/home/bob"; + set "@+nisuser/shell" "/bin/bash" += "+bob::::User Comment:/home/bob:/bin/bash\n" + +test Passwd.lns get "-bob::::::\n" = + { "@-nisuser" = "bob" } + +test Passwd.lns put "-bob::::::\n" after + set "@-nisuser" "alice" += "-alice::::::\n" diff -Nru augeas-1.3.0/lenses/tests/test_pgbouncer.aug augeas-1.4.0/lenses/tests/test_pgbouncer.aug --- augeas-1.3.0/lenses/tests/test_pgbouncer.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_pgbouncer.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,55 @@ +module Test_Pgbouncer = + let pgconfig =";; database name = connect string +;; +;; connect string params: +;; dbname= host= port= user= password= +[databases] +; foodb over unix socket +foodb = + +; redirect bardb to bazdb on localhost +bardb = host=localhost dbname=bazdb + +; acceess to dest database will go with single user +forcedb = host=127.0.0.1 port=300 user=baz password=foo client_encoding=UNICODE datestyle=ISO connect_query='SELECT 1' +[pgbouncer] +;;; Administrative settings +logfile = /var/log/pgbouncer/pgbouncer.log +pidfile = /var/run/pgbouncer/pgbouncer.pid +; ip address or * which means all ip-s +listen_addr = 127.0.0.1 +listen_port = 6432 +;auth_file = /8.0/main/global/pg_auth +auth_file = /var/lib/pgsql/data/global/pg_auth +admin_users = postgres +server_reset_query = DISCARD ALL +" + +test Pgbouncer.lns get pgconfig = + { "#comment" = "; database name = connect string" } + { "#comment" = ";" } + { "#comment" = "; connect string params:" } + { "#comment" = "; dbname= host= port= user= password=" } + { "databases" + { "#comment" = "foodb over unix socket" } + { "foodb" } + { } + { "#comment" = "redirect bardb to bazdb on localhost" } + { "bardb" = "host=localhost dbname=bazdb" } + { } + { "#comment" = "acceess to dest database will go with single user" } + { "forcedb" = "host=127.0.0.1 port=300 user=baz password=foo client_encoding=UNICODE datestyle=ISO connect_query='SELECT 1'" } + } + { "pgbouncer" + { "#comment" = ";; Administrative settings" } + { "logfile" = "/var/log/pgbouncer/pgbouncer.log" } + { "pidfile" = "/var/run/pgbouncer/pgbouncer.pid" } + { "#comment" = "ip address or * which means all ip-s" } + { "listen_addr" = "127.0.0.1" } + { "listen_port" = "6432" } + { "#comment" = "auth_file = /8.0/main/global/pg_auth" } + { "auth_file" = "/var/lib/pgsql/data/global/pg_auth" } + { "admin_users" = "postgres" } + { "server_reset_query" = "DISCARD ALL" } + } + \ No newline at end of file diff -Nru augeas-1.3.0/lenses/tests/test_postfix_sasl_smtpd.aug augeas-1.4.0/lenses/tests/test_postfix_sasl_smtpd.aug --- augeas-1.3.0/lenses/tests/test_postfix_sasl_smtpd.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_postfix_sasl_smtpd.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,19 @@ +module Test_Postfix_Sasl_Smtpd = + + + let conf = "pwcheck_method: auxprop saslauthd +auxprop_plugin: plesk +saslauthd_path: /private/plesk_saslauthd +mech_list: CRAM-MD5 PLAIN LOGIN +sql_engine: intentionally disabled +log_level: 4 +" + + + test Postfix_sasl_smtpd.lns get conf = + { "pwcheck_method" = "auxprop saslauthd" } + { "auxprop_plugin" = "plesk" } + { "saslauthd_path" = "/private/plesk_saslauthd" } + { "mech_list" = "CRAM-MD5 PLAIN LOGIN" } + { "sql_engine" = "intentionally disabled" } + { "log_level" = "4" } diff -Nru augeas-1.3.0/lenses/tests/test_puppetfile.aug augeas-1.4.0/lenses/tests/test_puppetfile.aug --- augeas-1.3.0/lenses/tests/test_puppetfile.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_puppetfile.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,58 @@ +(* +Module: Test_Puppetfile + Provides unit tests and examples for the lens. +*) +module Test_Puppetfile = + +(* Test: Puppetfile.lns *) +test Puppetfile.lns get "forge \"https://forgeapi.puppetlabs.com\" + +mod 'puppetlabs-razor' +mod 'puppetlabs-ntp', \"0.0.3\" + +mod 'puppetlabs-apt', + :git => \"git://github.com/puppetlabs/puppetlabs-apt.git\" + +mod 'puppetlabs-stdlib', + :git => \"git://github.com/puppetlabs/puppetlabs-stdlib.git\" + +mod 'puppetlabs-apache', '0.6.0', + :github_tarball => 'puppetlabs/puppetlabs-apache' + +metadata\n" = + { "forge" = "https://forgeapi.puppetlabs.com" } + { } + { "1" = "puppetlabs-razor" } + { "2" = "puppetlabs-ntp" + { "@version" = "0.0.3" } + } + { } + { "3" = "puppetlabs-apt" + { "git" = "git://github.com/puppetlabs/puppetlabs-apt.git" } + } + { } + { "4" = "puppetlabs-stdlib" + { "git" = "git://github.com/puppetlabs/puppetlabs-stdlib.git" } + } + { } + { "5" = "puppetlabs-apache" + { "@version" = "0.6.0" } + { "github_tarball" = "puppetlabs/puppetlabs-apache" } + } + { } + { "metadata" } + +(* Test: Puppetfile.lns + Complex version conditions *) +test Puppetfile.lns get "mod 'puppetlabs/stdlib', '< 5.0.0' +mod 'theforeman/concat_native', '>= 1.3.0 < 1.4.0' +mod 'herculesteam/augeasproviders', '2.1.x'\n" = + { "1" = "puppetlabs/stdlib" + { "@version" = "< 5.0.0" } + } + { "2" = "theforeman/concat_native" + { "@version" = ">= 1.3.0 < 1.4.0" } + } + { "3" = "herculesteam/augeasproviders" + { "@version" = "2.1.x" } + } diff -Nru augeas-1.3.0/lenses/tests/test_pylonspaste.aug augeas-1.4.0/lenses/tests/test_pylonspaste.aug --- augeas-1.3.0/lenses/tests/test_pylonspaste.aug 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_pylonspaste.aug 2015-05-22 22:31:25.000000000 +0000 @@ -0,0 +1,75 @@ +module Test_Pylonspaste = + let pylons_conf ="# baruwa - Pylons configuration +# The %(here)s variable will be replaced with the parent directory of this file +[uwsgi] +socket = /var/run/baruwa/baruwa.sock +processes = 5 +uid = baruwa +daemonize = /var/log/uwsgi/uwsgi-baruwa.log + +[server:main] +use = egg:Paste#http +host = 0.0.0.0 +port = 5000 + +[app:main] +use = egg:baruwa +full_stack = true +static_files = false +set debug = false + +[identifiers] +plugins = + form;browser + auth_tkt + +[authenticators] +plugins = + sa_auth + baruwa_pop3_auth + baruwa_imap_auth + baruwa_smtp_auth + baruwa_ldap_auth + baruwa_radius_auth +" + +test Pylonspaste.lns get pylons_conf = + { "#comment" = "baruwa - Pylons configuration" } + { "#comment" = "The %(here)s variable will be replaced with the parent directory of this file" } + { "uwsgi" + { "socket" = "/var/run/baruwa/baruwa.sock" } + { "processes" = "5" } + { "uid" = "baruwa" } + { "daemonize" = "/var/log/uwsgi/uwsgi-baruwa.log" } + { } + } + { "server:main" + { "use" = "egg:Paste#http" } + { "host" = "0.0.0.0" } + { "port" = "5000" } + { } + } + { "app:main" + { "use" = "egg:baruwa" } + { "full_stack" = "true" } + { "static_files" = "false" } + { "debug" = "false" } + { } + } + { "identifiers" + { "plugins" + { "1" = "form;browser" } + { "2" = "auth_tkt" } + } + {} + } + { "authenticators" + { "plugins" + { "1" = "sa_auth" } + { "2" = "baruwa_pop3_auth" } + { "3" = "baruwa_imap_auth" } + { "4" = "baruwa_smtp_auth" } + { "5" = "baruwa_ldap_auth" } + { "6" = "baruwa_radius_auth" } + } + } diff -Nru augeas-1.3.0/lenses/tests/test_pythonpaste.aug augeas-1.4.0/lenses/tests/test_pythonpaste.aug --- augeas-1.3.0/lenses/tests/test_pythonpaste.aug 2012-11-02 15:20:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_pythonpaste.aug 2015-05-22 22:31:25.000000000 +0000 @@ -39,3 +39,20 @@ /: public_version_api /v3: a_new_api_version " + + (* Paste can define global config in DEFAULT, then override with "set" in sections, RHBZ#1175545 *) + test PythonPaste.lns get "[DEFAULT] +log_name = swift +log_facility = LOG_LOCAL1 + +[app:proxy-server] +use = egg:swift#proxy +set log_name = proxy-server\n" = + { "DEFAULT" + { "log_name" = "swift" } + { "log_facility" = "LOG_LOCAL1" } + { } } + { "app:proxy-server" + { "use" = "egg:swift#proxy" } + { "log_name" = "proxy-server" + { "@set" } } } diff -Nru augeas-1.3.0/lenses/tests/test_shadow.aug augeas-1.4.0/lenses/tests/test_shadow.aug --- augeas-1.3.0/lenses/tests/test_shadow.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_shadow.aug 2015-06-01 22:03:07.000000000 +0000 @@ -43,3 +43,39 @@ { "inactive_days" = "" } { "expire_date" = "" } { "flag" = "" } } + +test Shadow.lns get "+\n" = + { "@nisdefault" } + +test Shadow.lns get "+::::::::\n" = + { "@nisdefault" + { "password" = "" } + { "lastchange_date" = "" } + { "minage_days" = "" } + { "maxage_days" = "" } + { "warn_days" = "" } + { "inactive_days" = "" } + { "expire_date" = "" } + { "flag" = "" } } + +test Shadow.lns put "+\n" after + set "@nisdefault/password" ""; + set "@nisdefault/lastchange_date" ""; + set "@nisdefault/minage_days" ""; + set "@nisdefault/maxage_days" ""; + set "@nisdefault/warn_days" ""; + set "@nisdefault/inactive_days" ""; + set "@nisdefault/expire_date" ""; + set "@nisdefault/flag" "" += "+::::::::\n" + +test Shadow.lns put "+::::::::\n" after + rm "@nisdefault/password"; + rm "@nisdefault/lastchange_date"; + rm "@nisdefault/minage_days"; + rm "@nisdefault/maxage_days"; + rm "@nisdefault/warn_days"; + rm "@nisdefault/inactive_days"; + rm "@nisdefault/expire_date"; + rm "@nisdefault/flag" += "+\n" diff -Nru augeas-1.3.0/lenses/tests/test_shellvars.aug augeas-1.4.0/lenses/tests/test_shellvars.aug --- augeas-1.3.0/lenses/tests/test_shellvars.aug 2014-10-17 15:52:20.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_shellvars.aug 2015-06-01 22:03:07.000000000 +0000 @@ -406,7 +406,6 @@ (* Empty comment before entries *) test Shellvars.lns get "# \nfoo=bar\n" = - { } { "foo" = "bar" } (* Empty comment after entries *) @@ -470,6 +469,25 @@ { "@case_entry" = "1" { "TestVar" = "\"test1\"" } } } + (* case: support ;; on the same line with multiple commands *) + test lns get "case $ARG in + 0) Foo=0; Bar=1;; + 1) + Foo=2 + Bar=3; Baz=4;; +esac\n" = + { "@case" = "$ARG" + { "@case_entry" = "0" + { "Foo" = "0" } + { "Bar" = "1" } + } + { "@case_entry" = "1" + { "Foo" = "2" } + { "Bar" = "3" } + { "Baz" = "4" } + } + } + (* Test: Shellvars.lns Support `##` bashism in conditions (GH issue #118) *) test Shellvars.lns get "if [ \"${APACHE_CONFDIR##/etc/apache2-}\" != \"${APACHE_CONFDIR}\" ] ; then @@ -489,6 +507,35 @@ { "MALLOC_PERTURB_" = "$(($RANDOM % 255 + 1))" { "export" } } + (* + * Github issue 202 + *) + let starts_with_blank = "\n \nVAR=value\n" + + test lns get starts_with_blank = { "VAR" = "value" } + + (* It is now possible to insert at the beginning of a file + * that starts with blank lines *) + test lns put starts_with_blank after + insb "#comment" "/*[1]"; + set "/#comment[1]" "a comment" = + " # a comment\nVAR=value\n" + + (* Modifications of the file lose the blank lines though *) + test lns put starts_with_blank after + set "/VAR2" "abc" = "VAR=value\nVAR2=abc\n" + + test lns put starts_with_blank after + rm "/VAR"; + set "/VAR2" "abc" = "VAR2=abc\n" + + test lns put starts_with_blank after + rm "/VAR" = "" + + (* Support associative arrays *) + test lns get "var[alpha_beta,gamma]=something\n" = + { "var[alpha_beta,gamma]" = "something" } + (* Local Variables: *) (* mode: caml *) (* End: *) diff -Nru augeas-1.3.0/lenses/tests/test_shellvars_list.aug augeas-1.4.0/lenses/tests/test_shellvars_list.aug --- augeas-1.3.0/lenses/tests/test_shellvars_list.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_shellvars_list.aug 2015-05-22 22:31:25.000000000 +0000 @@ -128,6 +128,17 @@ { "value" = "ping/icmp" } { "#comment" = "ping" } } + (* Test: Shellvars_list.lns + Support double-quoted continued lines *) + test Shellvars_list.lns get "DAEMON_OPTS=\"-a :6081 \ + -T localhost:6082\"\n" = + { "DAEMON_OPTS" + { "quote" = "\"" } + { "value" = "-a" } + { "value" = ":6081" } + { "value" = "-T" } + { "value" = "localhost:6082" } } + (* Local Variables: *) (* mode: caml *) (* End: *) diff -Nru augeas-1.3.0/lenses/tests/test_sudoers.aug augeas-1.4.0/lenses/tests/test_sudoers.aug --- augeas-1.3.0/lenses/tests/test_sudoers.aug 2014-06-19 22:27:11.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_sudoers.aug 2015-05-22 22:31:25.000000000 +0000 @@ -315,3 +315,14 @@ { "runas_user" = "ALL" } } } } + +(* Test: Sudoers.spec + allow + in user-/groupnames *) +test Sudoers.spec get "group+user somehost = ALL\n" = + { "spec" + { "user" = "group+user" } + { "host_group" + { "host" = "somehost" } + { "command" = "ALL" } + } + } diff -Nru augeas-1.3.0/lenses/tests/test_sysconfig.aug augeas-1.4.0/lenses/tests/test_sysconfig.aug --- augeas-1.3.0/lenses/tests/test_sysconfig.aug 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/lenses/tests/test_sysconfig.aug 2015-05-22 22:31:25.000000000 +0000 @@ -148,6 +148,15 @@ test lns get "#MOUNTD_NFS_V3\n#\n" = { "#comment" = "MOUNTD_NFS_V3" } + (* Handle leading whitespace at the beginning of a line correctly *) + test lns get " var=value\n" = { "var" = "value" } + + test lns put " var=value\n" after set "/var" "val2" = " var=val2\n" + + test lns get "\t \tvar=value\n" = { "var" = "value" } + + test lns get " export var=value\n" = { "var" = "value" { "export" } } + (* Local Variables: *) (* mode: caml *) (* End: *) diff -Nru augeas-1.3.0/lenses/xinetd.aug augeas-1.4.0/lenses/xinetd.aug --- augeas-1.3.0/lenses/xinetd.aug 2013-01-04 00:04:02.000000000 +0000 +++ augeas-1.4.0/lenses/xinetd.aug 2015-05-22 22:31:25.000000000 +0000 @@ -74,7 +74,7 @@ * about how to write that down. The resulting regular expressions * would simply be prohibitively large. *) - let body (attr:lens) = Build.block_newlines + let body (attr:lens) = Build.block_newlines_spc (indent . attr . Util.eol) Util.comment diff -Nru augeas-1.3.0/Makefile.in augeas-1.4.0/Makefile.in --- augeas-1.3.0/Makefile.in 2014-11-07 22:31:55.000000000 +0000 +++ augeas-1.4.0/Makefile.in 2015-06-02 00:23:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -88,6 +88,7 @@ build/ac-aux/config.sub build/ac-aux/depcomp \ build/ac-aux/install-sh build/ac-aux/missing \ build/ac-aux/ylwrap build/ac-aux/ltmain.sh \ + $(top_srcdir)/build/ac-aux/compile \ $(top_srcdir)/build/ac-aux/config.guess \ $(top_srcdir)/build/ac-aux/config.rpath \ $(top_srcdir)/build/ac-aux/config.sub \ @@ -1248,8 +1249,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -1525,10 +1526,16 @@ $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -1570,9 +1577,10 @@ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ diff -Nru augeas-1.3.0/man/augparse.1 augeas-1.4.0/man/augparse.1 --- augeas-1.3.0/man/augparse.1 2013-02-06 20:08:51.000000000 +0000 +++ augeas-1.4.0/man/augparse.1 2015-05-22 18:46:34.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== @@ -38,6 +38,8 @@ . ds PI \(*p . ds L" `` . ds R" '' +. ds C` +. ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. @@ -48,17 +50,24 @@ .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX .. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. +. if !\nF==2 \{ +. nr % 0 +. nr F 2 +. \} +. \} .\} +.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -124,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "AUGPARSE 1" -.TH AUGPARSE 1 "2013-02-06" "Augeas 1.0.0" "Augeas" +.TH AUGPARSE 1 "2015-05-22" "Augeas 1.3.0" "Augeas" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -188,8 +197,8 @@ .RE .PP which applies the \fIget\fR direction of the lens \s-1LENS\s0 to \s-1STRING\s0 and compares -it with the given \s-1RESULT\s0. \s-1RESULT\s0 can either be a tree literal, the symbol -\&\fB?\fR to print the result of applying \s-1LENS\s0 to \s-1STRING\s0, or the symbol \fB*\fR to +it with the given \s-1RESULT. RESULT\s0 can either be a tree literal, the symbol +\&\fB?\fR to print the result of applying \s-1LENS\s0 to \s-1STRING,\s0 or the symbol \fB*\fR to indicate that the test should produce an exception. .PP The syntax for \fBput\fR tests is @@ -198,11 +207,11 @@ test \s-1LENS\s0 put \s-1STRING\s0 after \s-1COMMANDS\s0 = \s-1RESULT\s0 .RE .PP -which first applies the \fIget\fR direction of the lens \s-1LENS\s0 to \s-1STRING\s0, then +which first applies the \fIget\fR direction of the lens \s-1LENS\s0 to \s-1STRING,\s0 then applies the given \s-1COMMANDS\s0 to the resulting tree, and finally transforms -the modified tree back to a string using the \fIput\fR direction of \s-1LENS\s0. The -resulting string is then compared to \s-1RESULT\s0, which can be a string, the -symbol \fB?\fR to print the result of applying \s-1LENS\s0 to \s-1STRING\s0, or the symbol +the modified tree back to a string using the \fIput\fR direction of \s-1LENS.\s0 The +resulting string is then compared to \s-1RESULT,\s0 which can be a string, the +symbol \fB?\fR to print the result of applying \s-1LENS\s0 to \s-1STRING,\s0 or the symbol \&\fB*\fR to indicate that the test should produce an exception. .SH "SEE ALSO" .IX Header "SEE ALSO" diff -Nru augeas-1.3.0/man/Makefile.in augeas-1.4.0/man/Makefile.in --- augeas-1.3.0/man/Makefile.in 2014-11-07 22:31:55.000000000 +0000 +++ augeas-1.4.0/man/Makefile.in 2015-06-02 00:23:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. diff -Nru augeas-1.3.0/NEWS augeas-1.4.0/NEWS --- augeas-1.3.0/NEWS 2014-11-07 23:04:10.000000000 +0000 +++ augeas-1.4.0/NEWS 2015-06-02 00:23:11.000000000 +0000 @@ -1,3 +1,80 @@ +1.4.0 - 2015-05-22 + - General changes/additions + * add a aug_escape_name call to sanitize strings for use in path + expressions. There are a few characters that are special in path + expressions. This function makes it possible to have them all escaped + so that the resulting string can be used in a path expression and is + guaranteed to only match a node with exactly that name + * paths generated by Augeas are now properly escaped so that, e.g., the + strings returned by aug_match can always be fed to aug_get, even if + they contain special characters + * augtool: correctly record history when reading commands from a file + and then switching to interactive mode (Robert Drake) + * augtool: new command 'errors' that pretty-prints /augeas//error + messages; improve the information provided with 'short iteration' + errors + * fix segfault when saving to a file that was not writable (Issue #178) + * augtool: on interrupt (Ctrl-C), cancel current line instead of + exiting (jeremy Lin) + * updated parser.y to work with Bison 3.0.2 + * fix put-symlink-augsave test to run on Solaris (Geoffrey Gardella, + issue #242) + - Lens changes/additions + * AFS_Cellalias: new lens (Pat Riehecky) + * Authorized_keys: allow double quotes in option values (Issue #135) + * Chrony: fix typo in log flag 'measurements' (Pat Riehecky) + * Clamav: new lens (Andrew Colin Kissa) + * Dns_Zone: New lens to parse DNS zone files (Kaarle Ritvanen) + * Dnsmasq: Parse the structure of the 'address' and 'server' options + (incompatible change) (Kaarle Ritvanen) + * Erlang: parse kernel app config, handle empty lists (RHBZ#1175546) + * Exports: support brackets in machine names (Vincent Desjardins) + * Grub: support password stanza inside boot/title section (Issue #229) + * Httpd: handle eol after opening tag (Issue #220); fix type checking + issue (Issue #223) + * Iscsid: new lens (Joey Boggs and Pat Riehecky) (Issue #174) + * Jaas: several improvements to cover more valid syntax (Steve Shipway) + * Known_Hosts: handle aliases for the host name + * Krb5: support keyword krb524_server; allow realm names starting + with lower-case characters (Jurjen Bokma) + * Limits: allow comments at end of line (timdeluxe) + * Logrotate: support 'dateformat' directive (Issue #217) + support 'maxsize' directive (RHBZ#1213292) + do not require a space before an opening '{' (Issue #123) + * Mailscanner: new lens (Andrew Colin Kissa) + * Mailscanner_Rules: new lens for MailScanner rules (Andrew Colin Kissa) + * NagiosCfg: default to no spaces around equal (Issue #177) + * Nginx: significantly reworked, now parses entire Nginx stock + config successfully (Issue #179) + * Pagekite: more fine-grained control of service_on entries; instead of + 'source' and 'destination', parse into protocol, kitename, + backend_host, backend_port, and secret (Michael Pimmer) + (incompatible change) + * Passwd: support nis [+-]username syntax (Borislav Stoichkov); fix + @nisdefault on OpenBSD (Matt Dainty) + * Pgbouncer: new lense for the pgbouncer connection pooler (Andrew + Colin Kissa) + * Postfix_sasl_smtpd: new lens contributed by larsen0815 (Issue #182) + * Postgresql: look for postgresql.conf in paths used on Red Hat based + distros (Haotian Liu) + * Puppetfile: new lens to parse librarian-puppet's Puppetfile + * Pylonspaste: new lense for Pylon's paste init configuration files + (Andrew Colin Kissa) + * PythonPaste: parse "set" keyword for default overrides (RHBZ#1175545) + * Shadow: allow NIS entries (Borislav Stoichkov) + * Shellvars: case: support ;; on same line with multiple commands + (Kaarle Ritvanen); make insertion at the beginning of a + file that starts with blank lines work; the new lens will + remove blank lines from the beginning of a file as soon as + lines are added to or removed from it (GH issue #202); + handle associative arrays; add /etc/periodic.conf for + FreeBSD (Michael Moll) + * Shellvars_list: support double-quoted continued lines + * Sudoers: allow '+' in user/groupnames (Andreas Grüninger) + * Sysctl: add /boot/loader.conf for FreeBSD (Michael Moll) + * Sysconfig: handle leading whitespace at beginning of a line, + RHBZ#761246 + 1.3.0 - 2014-11-07 - General changes/additions * Add missing cp entry in manpage (GH issue #78) @@ -107,7 +184,7 @@ fix for block's brackets upon write, fixes broken tests for mailbox, fixes indention, - test case for block_args with ", + test case for block_args with "" fixes broken indention Use Quote module * Exports: Permit colons for IPv6 client addresses, bug #366 diff -Nru augeas-1.3.0/src/augeas.c augeas-1.4.0/src/augeas.c --- augeas-1.3.0/src/augeas.c 2014-10-17 16:41:03.000000000 +0000 +++ augeas-1.4.0/src/augeas.c 2015-06-01 22:03:07.000000000 +0000 @@ -1985,6 +1985,20 @@ return result; } +int aug_escape_name(augeas *aug, const char *in, char **out) { + int result; + + api_entry(aug); + ARG_CHECK(in == NULL, aug, "aug_escape_name: IN must not be NULL"); + ARG_CHECK(out == NULL, aug, "aug_escape_name: OUT must not be NULL"); + + result = pathx_escape_name(in, out); + ERR_NOMEM(result < 0, aug); + error: + api_exit(aug); + return result; +} + int aug_print(const struct augeas *aug, FILE *out, const char *pathin) { struct pathx *p; int result; @@ -2031,7 +2045,7 @@ int __aug_load_module_file(struct augeas *aug, const char *filename) { api_entry(aug); - int r = load_module_file(aug, filename); + int r = load_module_file(aug, filename, NULL); api_exit(aug); return r; } diff -Nru augeas-1.3.0/src/augeas.h augeas-1.4.0/src/augeas.h --- augeas-1.3.0/src/augeas.h 2014-10-17 15:52:20.000000000 +0000 +++ augeas-1.4.0/src/augeas.h 2015-05-22 22:31:25.000000000 +0000 @@ -370,6 +370,23 @@ const char *node_in, const char *path, const char *node_out); +/* Function: aug_escape_name + * + * Escape special characters in a string such that it can be used as part + * of a path expressions and only matches a node named exactly + * IN. Characters that have special meanings in path expressions, such as + * '[' and ']' are prefixed with a '\\'. Note that this function assumes + * that it is passed a name, not a path, and will therefore escape '/', + * too. + * + * On return, *OUT is NULL if IN does not need any escaping at all, and + * points to an escaped copy of IN otherwise. + * + * Returns: + * 0 on success, or a negative value on failure + */ +int aug_escape_name(augeas *aug, const char *in, char **out); + /* Function: aug_print * * Print each node matching PATH and its descendants to OUT. diff -Nru augeas-1.3.0/src/augeas_sym.version augeas-1.4.0/src/augeas_sym.version --- augeas-1.3.0/src/augeas_sym.version 2014-10-17 15:52:20.000000000 +0000 +++ augeas-1.4.0/src/augeas_sym.version 2015-06-02 00:23:11.000000000 +0000 @@ -65,3 +65,8 @@ global: aug_cp; } AUGEAS_0.16.0; + +AUGEAS_0.20.0 { + global: + aug_escape_name; +} AUGEAS_0.18.0; diff -Nru augeas-1.3.0/src/augrun.c augeas-1.4.0/src/augrun.c --- augeas-1.3.0/src/augrun.c 2014-10-17 15:52:20.000000000 +0000 +++ augeas-1.4.0/src/augrun.c 2015-06-01 22:03:07.000000000 +0000 @@ -1015,7 +1015,7 @@ r = aug_save(cmd->aug); if (r == -1) { ERR_REPORT(cmd, AUG_ECMDRUN, - "saving failed (run 'print /augeas//error' for details)"); + "saving failed (run 'errors' for details)"); } else { r = aug_match(cmd->aug, "/augeas/events/saved", NULL); if (r > 0) { @@ -1033,7 +1033,7 @@ .opts = cmd_save_opts, .handler = cmd_save, .synopsis = "save all pending changes", - .help = "Save all pending changes to disk. How exactly that is done depends on\n the value of the node /augeas/save, which can be changed by the user.\n The possible values for it are\n \n noop - do not write files; useful for finding errors that\n might happen during a save\n backup - save the original file in a file by appending the extension\n '.augsave' and overwrite the original with new content\n newfile - leave the original file untouched and write new content to\n a file with extension '.augnew' next to the original file\n overwrite - overwrite the original file with new content\n \n Save always tries to save all files for which entries in the tree have\n changed. When saving fails, some files will be written. Details about\n why a save failed can by found by issuing the command 'print\n /augeas//error' (note the double slash)" + .help = "Save all pending changes to disk. How exactly that is done depends on\n the value of the node /augeas/save, which can be changed by the user.\n The possible values for it are\n \n noop - do not write files; useful for finding errors that\n might happen during a save\n backup - save the original file in a file by appending the extension\n '.augsave' and overwrite the original with new content\n newfile - leave the original file untouched and write new content to\n a file with extension '.augnew' next to the original file\n overwrite - overwrite the original file with new content\n \n Save always tries to save all files for which entries in the tree have\n changed. When saving fails, some files will be written. Details about\n why a save failed can by found by running the 'errors' command" }; static void cmd_load(struct command *cmd) { @@ -1041,7 +1041,7 @@ r = aug_load(cmd->aug); if (r == -1) { ERR_REPORT(cmd, AUG_ECMDRUN, - "loading failed (run 'print /augeas//error' for details)"); + "loading failed (run 'errors' for details)"); } } @@ -1175,6 +1175,114 @@ .help = cmd_retrieve_help }; +/* Given a path "/augeas/files/FILENAME/error", return FILENAME */ +static char *err_filename(const char *match) { + int noise = strlen(AUGEAS_META_FILES) + strlen("/error"); + if (strlen(match) < noise + 1) + goto error; + return strndup(match + strlen(AUGEAS_META_FILES), strlen(match) - noise); + error: + return strdup("(no filename)"); +} + +static const char *err_get(struct augeas *aug, + const char *match, const char *child) { + char *path = NULL; + const char *value = ""; + int r; + + r = pathjoin(&path, 2, match, child); + ERR_NOMEM(r < 0, aug); + + aug_get(aug, path, &value); + ERR_BAIL(aug); + + error: + free(path); + return value; +} + +static void cmd_errors(struct command *cmd) { + char **matches = NULL; + int cnt = 0; + char *filename = NULL; + struct augeas *aug = cmd->aug; + + cnt = aug_match(aug, "/augeas//error", &matches); + ERR_BAIL(cmd); + ERR_THROW(cnt < 0, aug, AUG_ECMDRUN, + " (problem retrieving error messages)\n"); + if (cnt == 0) { + fprintf(cmd->out, " (no errors)\n"); + goto done; + } + + for (int i=0; i < cnt; i++) { + const char *match = matches[i]; + const char *line = err_get(aug, match, "line"); + const char *char_pos = err_get(aug, match, "char"); + const char *lens = err_get(aug, match, "lens"); + const char *last = err_get(aug, match, "lens/last_matched"); + const char *next = err_get(aug, match, "lens/next_not_matched"); + const char *msg = err_get(aug, match, "message"); + const char *kind = NULL; + + aug_get(aug, match, &kind); + ERR_BAIL(aug); + + filename = err_filename(match); + ERR_NOMEM(filename == NULL, aug); + + if (i>0) + fprintf(cmd->out, "\n"); + + if (line != NULL) { + fprintf(cmd->out, "Error in %s:%s.%s (%s)\n", + filename, line, char_pos, kind); + } else { + fprintf(cmd->out, "Error in %s (%s)\n", filename, kind); + } + + if (msg != NULL) + fprintf(cmd->out, " %s\n", msg); + if (lens != NULL) + fprintf(cmd->out, " Lens: %s\n", lens); + if (last != NULL) + fprintf(cmd->out, " Last matched: %s\n", last); + if (next != NULL) + fprintf(cmd->out, " Next (no match): %s\n", next); + } + + done: + error: + for (int i=0; i < cnt; i++) + free(matches[i]); + free(matches); + free(filename); +} + +static const struct command_opt_def cmd_errors_opts[] = { + CMD_OPT_DEF_LAST +}; + +static const char const cmd_errors_help[] = + "Show all the errors encountered in processing files. For each error,\n" + " print detailed information about where it happened and how. The same\n" + " information can be retrieved by running 'print /augeas//error'\n\n" + " For each error, the file in which the error occurred together with the\n" + " line number and position in that line is shown, as well as information\n" + " about the lens that encountered the error. For some errors, the last\n" + " lens that matched successfully and the next lens that should have\n" + " matched but didn't are also shown\n"; + +static const struct command_def cmd_errors_def = { + .name = "errors", + .opts = cmd_errors_opts, + .handler = cmd_errors, + .synopsis = "show all errors encountered in processing files", + .help = cmd_errors_help +}; + /* Groups of commands */ static const struct command_grp_def cmd_grp_admin_def = { .name = "Admin", @@ -1199,6 +1307,7 @@ &cmd_ls_def, &cmd_match_def, &cmd_print_def, + &cmd_errors_def, &cmd_span_def, &cmd_def_last } diff -Nru augeas-1.3.0/src/augtool.c augeas-1.4.0/src/augtool.c --- augeas-1.3.0/src/augtool.c 2014-10-17 15:52:20.000000000 +0000 +++ augeas-1.4.0/src/augtool.c 2015-06-01 22:03:07.000000000 +0000 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -136,8 +137,10 @@ if (STREQLEN(chend, end, strlen(end))) { if (child_count(child) > 0) { char *c = realloc(child, strlen(child)+2); - if (c == NULL) + if (c == NULL) { + free(child); return NULL; + } child = c; strcat(child, "/"); } @@ -145,8 +148,10 @@ /* strip off context if the user didn't give it */ if (ctx != NULL) { char *c = realloc(child, strlen(child)-strlen(ctx)+1); - if (c == NULL) + if (c == NULL) { + free(child); return NULL; + } int ctxidx = strlen(ctx); if (child[ctxidx] == SEP) ctxidx++; @@ -171,7 +176,7 @@ "get", "label", "ins", "load", "ls", "match", "mv", "cp", "rename", "print", "dump-xml", "rm", "save", "set", "setm", "clearm", "span", "store", "retrieve", "transform", - "help", "touch", "insert", "move", "copy", NULL }; + "help", "touch", "insert", "move", "copy", "errors", NULL }; static int current = 0; const char *name; @@ -426,6 +431,25 @@ } } +static void sigint_handler(ATTRIBUTE_UNUSED int signum) { + // Cancel the current line of input, along with undo info for that line. + rl_replace_line("", 1); + + // Move the cursor to the next screen line, then force a re-display. + rl_crlf(); + rl_forced_update_display(); +} + +static void install_signal_handlers(void) { + // On Ctrl-C, cancel the current line (rather than exit the program). + struct sigaction sigint_action; + MEMZERO(&sigint_action, 1); + sigint_action.sa_handler = sigint_handler; + sigemptyset(&sigint_action.sa_mask); + sigint_action.sa_flags = 0; + sigaction(SIGINT, &sigint_action, NULL); +} + static int main_loop(void) { char *line = NULL; int ret = 0; @@ -446,6 +470,8 @@ } } + install_signal_handlers(); + // make readline silent by default echo_commands = echo_commands || isatty(fileno(stdin)); if (echo_commands) @@ -468,10 +494,11 @@ echo_commands = true; // reopen in stream - if ((rl_instream = fopen("/dev/tty", "r")) == NULL) { + if (freopen("/dev/tty", "r", stdin) == NULL) { perror("Failed to open terminal for reading"); return -1; } + rl_instream = stdin; // reopen stdout and stream to a tty if originally silenced or // not connected to a tty, for full interactive mode diff -Nru augeas-1.3.0/src/builtin.c augeas-1.4.0/src/builtin.c --- augeas-1.3.0/src/builtin.c 2012-11-02 15:20:12.000000000 +0000 +++ augeas-1.4.0/src/builtin.c 2015-06-01 22:03:07.000000000 +0000 @@ -97,6 +97,16 @@ return lns_make_square(ref(info), ref(l1->lens), ref(l2->lens), ref(l3->lens), check); } +static void exn_lns_error_detail(struct value *exn, const char *label, + struct lens *lens) { + if (lens == NULL) + return; + + char *s = format_info(lens->info); + exn_printf_line(exn, "%s: %s", label, s); + free(s); +} + static struct value *make_exn_lns_error(struct info *info, struct lns_error *err, const char *text) { @@ -106,11 +116,9 @@ return info->error->exn; v = make_exn_value(ref(info), "%s", err->message); - if (err->lens != NULL) { - char *s = format_info(err->lens->info); - exn_printf_line(v, "Lens: %s", s); - free(s); - } + exn_lns_error_detail(v, "Lens", err->lens); + exn_lns_error_detail(v, " Last match", err->last); + exn_lns_error_detail(v, " Not matching", err->next); if (err->pos >= 0) { char *pos = format_pos(text, err->pos); size_t line, ofs; diff -Nru augeas-1.3.0/src/fa.c augeas-1.4.0/src/fa.c --- augeas-1.3.0/src/fa.c 2012-11-02 15:20:12.000000000 +0000 +++ augeas-1.4.0/src/fa.c 2015-05-22 22:31:25.000000000 +0000 @@ -899,6 +899,8 @@ struct state_set *accept = state_set_init(-1, S_NONE); int r; + E(accept == NULL); + r = mark_reachable(fa); E(r < 0); @@ -908,6 +910,7 @@ } return accept; error: + state_set_free(accept); return NULL; } @@ -957,7 +960,9 @@ int r; all = fa_states(fa); + E(all == NULL); accept = fa_accept_states(fa); + E(accept == NULL); F(state_set_init_data(all)); @@ -2794,6 +2799,9 @@ static bitset *alphabet(struct fa *fa) { bitset *bs = bitset_init(UCHAR_NUM); + if (bs == NULL) + return NULL; + list_for_each(s, fa->initial) { for (int i=0; i < s->tused; i++) { for (uint c = s->trans[i].min; c <= s->trans[i].max; c++) @@ -2806,6 +2814,9 @@ static bitset *last_chars(struct fa *fa) { bitset *bs = bitset_init(UCHAR_NUM); + if (bs == NULL) + return NULL; + list_for_each(s, fa->initial) { for (int i=0; i < s->tused; i++) { if (s->trans[i].to->accept) { @@ -2821,6 +2832,9 @@ bitset *bs = bitset_init(UCHAR_NUM); struct state *s = fa->initial; + if (bs == NULL) + return NULL; + for (int i=0; i < s->tused; i++) { for (uint c = s->trans[i].min; c <= s->trans[i].max; c++) bitset_set(bs, c); @@ -2828,29 +2842,36 @@ return bs; } -/* Return true if F1 and F2 are known to be unambiguously concatenable - * according to simple heuristics. Return false if they need to be checked - * further to decide ambiguity */ -static bool is_splittable(struct fa *fa1, struct fa *fa2) { +/* Return 1 if F1 and F2 are known to be unambiguously concatenable + * according to simple heuristics. Return 0 if they need to be checked + * further to decide ambiguity + * Return -1 if an allocation fails + */ +static int is_splittable(struct fa *fa1, struct fa *fa2) { bitset *alpha1 = NULL; bitset *alpha2 = NULL; bitset *last1 = NULL; bitset *first2 = NULL; - bool result = false; + bool result = -1; alpha2 = alphabet(fa2); last1 = last_chars(fa1); + if (alpha2 == NULL || last1 == NULL) + goto done; if (bitset_disjoint(last1, alpha2, UCHAR_NUM)) { - result = true; + result = 1; goto done; } alpha1 = alphabet(fa1); first2 = first_chars(fa2); + if (alpha1 == NULL || first2 == NULL) + goto done; if (bitset_disjoint(first2, alpha1, UCHAR_NUM)) { - result = true; + result = 1; goto done; } + result = 0; done: bitset_free(alpha1); bitset_free(alpha2); @@ -2880,7 +2901,10 @@ if (v != NULL) *v = NULL; - if (is_splittable(fa1, fa2)) + r = is_splittable(fa1, fa2); + if (r < 0) + goto error; + if (r == 1) return 0; #define Xs "\001" diff -Nru augeas-1.3.0/src/get.c augeas-1.4.0/src/get.c --- augeas-1.3.0/src/get.c 2012-11-02 15:20:12.000000000 +0000 +++ augeas-1.4.0/src/get.c 2015-06-01 22:03:07.000000000 +0000 @@ -233,7 +233,8 @@ if (state->error != NULL) return; - CALLOC(state->error, 1); + if (ALLOC(state->error) < 0) + return; state->error->lens = ref(lens); if (REG_MATCHED(state)) state->error->pos = REG_END(state); @@ -688,6 +689,90 @@ return skel; } +/* Given a lens that does not match at the current position, try to find + * the left-most child LAST that does match and the lens next to it NEXT + * that does not match. Return the length of the match. + * + * If no such child exists, return 0 + */ +static int try_match(struct lens *lens, struct state *state, + uint start, uint end, + struct lens **last, struct lens **next) { + int result = 0, r; + + switch(lens->tag) { + case L_VALUE: + case L_LABEL: + case L_SEQ: + case L_COUNTER: + *last = lens; + return result; + break; + case L_DEL: + case L_KEY: + case L_STORE: + result = regexp_match(lens->ctype, state->text, end, start, NULL); + if (result >= 0) + *last = lens; + return result; + case L_CONCAT: + for (int i=0; i < lens->nchildren; i++) { + struct lens *child = lens->children[i]; + struct lens *next_child = + (i < lens->nchildren - 1) ? lens->children[i+1] : NULL; + + r = regexp_match(child->ctype, state->text, end, start, NULL); + if (r >= 0) { + result += r; + start += r; + *last = child; + } else if (result > 0) { + if (*next == NULL) + *next = child; + return result; + } else { + result = try_match(child, state, start, end, last, next); + if (result > 0 && *next == NULL) + *next = next_child; + return result; + } + } + return result; + break; + case L_UNION: + for (int i=0; i < lens->nchildren; i++) { + struct lens *child = lens->children[i]; + result = try_match(child, state, start, end, last, next); + if (result > 0) + return result; + } + return 0; + break; + case L_SUBTREE: + case L_STAR: + case L_MAYBE: + case L_SQUARE: + return try_match(lens->child, state, start, end, last, next); + break; + default: + BUG_ON(true, state->info, "illegal lens tag %d", lens->tag); + break; + } + error: + return 0; +} + +static void short_iteration_error(struct lens *lens, struct state *state, + uint start, uint end) { + int match_count; + + get_error(state, lens, "%s", short_iteration); + + match_count = try_match(lens->child, state, start, end, + &state->error->last, &state->error->next); + state->error->pos = start + match_count; +} + static struct tree *get_quant_star(struct lens *lens, struct state *state) { ensure0(lens->tag == L_STAR, state->info); struct lens *child = lens->child; @@ -713,8 +798,7 @@ state->regs = old_regs; state->nreg = old_nreg; if (size != 0) { - get_error(state, lens, "%s", short_iteration); - state->error->pos = start; + short_iteration_error(lens, state, start, end); } return tree; } @@ -802,6 +886,7 @@ children = get_lens(lens->child, state); tree = make_tree(state->key, state->value, NULL, children); + ERR_NOMEM(tree == NULL, state->info); tree->span = state->span; if (state->span != NULL) { diff -Nru augeas-1.3.0/src/internal.c augeas-1.4.0/src/internal.c --- augeas-1.3.0/src/internal.c 2012-11-02 15:20:12.000000000 +0000 +++ augeas-1.4.0/src/internal.c 2015-05-22 22:31:25.000000000 +0000 @@ -336,6 +336,8 @@ char *path; const char *label; + char *escaped = NULL; + int cnt = 0, ind = 0, r; list_for_each(t, siblings) { @@ -356,11 +358,21 @@ else label = tree->label; + r = pathx_escape_name(label, &escaped); + if (r < 0) + return NULL; + + if (escaped != NULL) + label = escaped; + if (cnt > 1) { r = asprintf(&path, "%s/%s[%d]", ppath, label, ind); } else { r = asprintf(&path, "%s/%s", ppath, label); } + + free(escaped); + if (r == -1) return NULL; return path; diff -Nru augeas-1.3.0/src/internal.h augeas-1.4.0/src/internal.h --- augeas-1.3.0/src/internal.h 2013-06-14 20:40:40.000000000 +0000 +++ augeas-1.4.0/src/internal.h 2015-06-01 21:54:39.000000000 +0000 @@ -575,6 +575,16 @@ const struct tree *tree); void free_symtab(struct pathx_symtab *symtab); +/* Escape a name so that it is safe to pass to parse_name and have it + * interpreted as the literal name of a path component. + * + * On return, *OUT will be NULL if IN does not need escaping, otherwise it + * will contain an escaped copy of IN which the caller must free. + * + * Returns -1 if it failed to allocate memory for *OUT, 0 on success + */ +int pathx_escape_name(const char *in, char **out); + /* Debug helpers, all defined in internal.c. When ENABLE_DEBUG is not * set, they compile to nothing. */ diff -Nru augeas-1.3.0/src/lens.c augeas-1.4.0/src/lens.c --- augeas-1.3.0/src/lens.c 2013-08-28 18:29:27.000000000 +0000 +++ augeas-1.4.0/src/lens.c 2015-06-01 22:03:07.000000000 +0000 @@ -1109,11 +1109,24 @@ return result; } -static int lns_format_subtree_atype(struct lens *l, char **buf) { +static int format_atype(struct lens *l, char **buf, uint indent); + +static int format_indent(char **buf, uint indent) { + if (ALLOC_N(*buf, indent+1) < 0) + return -1; + memset(*buf, ' ', indent); + return 0; +} + +static int format_subtree_atype(struct lens *l, char **buf, uint indent) { char *k = NULL, *v = NULL; const struct regexp *ktype = l->child->ktype; const struct regexp *vtype = l->child->vtype; int r, result = -1; + char *si = NULL; + + if (format_indent(&si, indent) < 0) + goto done; if (ktype != NULL) { k = regexp_escape(ktype); @@ -1125,30 +1138,32 @@ if (v == NULL) goto done; if (k == NULL) - r = xasprintf(buf, "{ = /%s/ }", k, v); + r = xasprintf(buf, "%s{ = /%s/ }", si, k, v); else - r = xasprintf(buf, "{ /%s/ = /%s/ }", k, v); + r = xasprintf(buf, "%s{ /%s/ = /%s/ }", si, k, v); } else { if (k == NULL) - r = xasprintf(buf, "{ }", k); + r = xasprintf(buf, "%s{ }", si, k); else - r = xasprintf(buf, "{ /%s/ }", k); + r = xasprintf(buf, "%s{ /%s/ }", si, k); } if (r < 0) goto done; result = 0; done: + FREE(si); FREE(v); FREE(k); return result; } -static int lns_format_rep_atype(struct lens *l, char **buf, char quant) { +static int format_rep_atype(struct lens *l, char **buf, + uint indent, char quant) { char *a = NULL; int r, result = -1; - r = lns_format_atype(l->child, &a); + r = format_atype(l->child, &a, indent); if (r < 0) goto done; if (strlen(a) == 0) { @@ -1172,7 +1187,7 @@ return result; } -static int lns_format_concat_atype(struct lens *l, char **buf) { +static int format_concat_atype(struct lens *l, char **buf, uint indent) { char **c = NULL, *s = NULL, *p; int r, result = -1; size_t len = 0, nconc = 0; @@ -1181,10 +1196,10 @@ goto done; for (int i=0; i < l->nchildren; i++) { - r = lns_format_atype(l->children[i], c+i); + r = format_atype(l->children[i], c+i, indent); if (r < 0) goto done; - len += strlen(c[i]) + 2; + len += strlen(c[i]) + 3; if (strlen(c[i]) > 0) nconc += 1; if (l->children[i]->tag == L_UNION) @@ -1198,9 +1213,15 @@ bool needs_parens = nconc > 1 && l->children[i]->tag == L_UNION; if (strlen(c[i]) == 0) continue; - if (needs_parens) + if (i > 0) + *p++ = '\n'; + char *t = c[i]; + if (needs_parens) { + for (int j=0; j < indent; j++) + *p++ = *t++; *p++ = '('; - p = stpcpy(p, c[i]); + } + p = stpcpy(p, t); if (needs_parens) *p++ = ')'; } @@ -1217,7 +1238,7 @@ return result; } -static int lns_format_union_atype(struct lens *l, char **buf) { +static int format_union_atype(struct lens *l, char **buf, uint indent) { char **c = NULL, *s = NULL, *p; int r, result = -1; size_t len = 0; @@ -1226,10 +1247,10 @@ goto done; for (int i=0; i < l->nchildren; i++) { - r = lns_format_atype(l->children[i], c+i); + r = format_atype(l->children[i], c+i, indent + 2); if (r < 0) goto done; - len += strlen(c[i]) + 2; + len += strlen(c[i]) + 3; } len += l->nchildren - 1; @@ -1238,12 +1259,25 @@ p = s; for (int i=0; i < l->nchildren; i++) { - if (i > 0) - p = stpcpy(p, " | "); - if (strlen(c[i]) == 0) + char *t = c[i]; + if (i > 0) { + *p++ = '\n'; + if (strlen(t) >= indent+2) { + p = stpncpy(p, t, indent+2); + t += indent+2; + } else { + memset(p, ' ', indent+2); + p += indent+2; + } + p = stpcpy(p, "| "); + } else { + /* Skip additional indent */ + t += 2; + } + if (strlen(t) == 0) p = stpcpy(p, "()"); else - p = stpcpy(p, c[i]); + p = stpcpy(p, t); } *buf = s; s = NULL; @@ -1257,7 +1291,7 @@ return result; } -static int lns_format_rec_atype(struct lens *l, char **buf) { +static int format_rec_atype(struct lens *l, char **buf, uint indent) { int r; if (l->rec_internal) { @@ -1266,7 +1300,7 @@ } char *c = NULL; - r = lns_format_atype(l->body, &c); + r = format_atype(l->body, &c, indent); if (r < 0) return -1; r = xasprintf(buf, "<>", c); @@ -1274,7 +1308,7 @@ return (r < 0) ? -1 : 0; } -int lns_format_atype(struct lens *l, char **buf) { +static int format_atype(struct lens *l, char **buf, uint indent) { *buf = NULL; switch(l->tag) { @@ -1289,25 +1323,25 @@ return (*buf == NULL) ? -1 : 0; break; case L_SUBTREE: - return lns_format_subtree_atype(l, buf); + return format_subtree_atype(l, buf, indent); break; case L_STAR: - return lns_format_rep_atype(l, buf, '*'); + return format_rep_atype(l, buf, indent, '*'); break; case L_MAYBE: - return lns_format_rep_atype(l, buf, '?'); + return format_rep_atype(l, buf, indent, '?'); break; case L_CONCAT: - return lns_format_concat_atype(l, buf); + return format_concat_atype(l, buf, indent); break; case L_UNION: - return lns_format_union_atype(l, buf); + return format_union_atype(l, buf, indent); break; case L_REC: - return lns_format_rec_atype(l, buf); + return format_rec_atype(l, buf, indent); break; case L_SQUARE: - return lns_format_concat_atype(l->child, buf); + return format_concat_atype(l->child, buf, indent); break; default: BUG_LENS_TAG(l); @@ -1316,6 +1350,12 @@ return -1; } +int lns_format_atype(struct lens *l, char **buf) { + int r = 0; + r = format_atype(l, buf, 4); + return r; +} + /* * Recursive lenses */ diff -Nru augeas-1.3.0/src/lens.h augeas-1.4.0/src/lens.h --- augeas-1.3.0/src/lens.h 2012-11-02 15:20:12.000000000 +0000 +++ augeas-1.4.0/src/lens.h 2015-06-01 22:03:07.000000000 +0000 @@ -170,6 +170,8 @@ struct lns_error { struct lens *lens; + struct lens *last; /* The last lens that matched */ + struct lens *next; /* The next lens that should match but doesn't */ int pos; /* Errors from get/parse */ char *path; /* Errors from put, pos will be -1 */ char *message; diff -Nru augeas-1.3.0/src/lexer.c augeas-1.4.0/src/lexer.c --- augeas-1.3.0/src/lexer.c 2012-11-09 20:02:23.000000000 +0000 +++ augeas-1.4.0/src/lexer.c 2015-06-01 22:52:03.000000000 +0000 @@ -15,7 +15,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -60,7 +60,6 @@ typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -91,6 +90,8 @@ #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -176,6 +177,11 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -211,11 +217,6 @@ #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -233,7 +234,7 @@ /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -312,7 +313,7 @@ YY_BUFFER_STATE augl__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE augl__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE augl__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE augl__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); void *augl_alloc (yy_size_t ,yyscan_t yyscanner ); void *augl_realloc (void *,yy_size_t ,yyscan_t yyscanner ); @@ -344,7 +345,7 @@ /* Begin user sect3 */ -#define augl_wrap(n) 1 +#define augl_wrap(yyscanner) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -581,7 +582,7 @@ return u; } -#line 585 "lexer.c" +#line 586 "lexer.c" #define INITIAL 0 #define COMMENT 1 @@ -611,8 +612,8 @@ size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - int yy_n_chars; - int yyleng_r; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -669,7 +670,7 @@ void augl_set_out (FILE * out_str ,yyscan_t yyscanner ); -int augl_get_leng (yyscan_t yyscanner ); +yy_size_t augl_get_leng (yyscan_t yyscanner ); char *augl_get_text (yyscan_t yyscanner ); @@ -742,7 +743,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -829,7 +830,7 @@ #line 80 "lexer.l" -#line 833 "lexer.c" +#line 834 "lexer.c" yylval = yylval_param; @@ -903,7 +904,7 @@ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - int yyl; + yy_size_t yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) @@ -1141,7 +1142,7 @@ #line 181 "lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1145 "lexer.c" +#line 1146 "lexer.c" case YY_END_OF_BUFFER: { @@ -1327,21 +1328,21 @@ else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1372,7 +1373,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1469,6 +1470,7 @@ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 97); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } @@ -1485,7 +1487,7 @@ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yyg->yy_n_chars + 2; + register yy_size_t number_to_move = yyg->yy_n_chars + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -1539,7 +1541,7 @@ else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1826,7 +1828,7 @@ */ static void augl_ensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -1919,17 +1921,17 @@ /** Setup the input buffer state to scan the given bytes. The next call to augl_lex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE augl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE augl__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2039,7 +2041,7 @@ /** Get the length of the current token. * @param yyscanner The scanner object. */ -int augl_get_leng (yyscan_t yyscanner) +yy_size_t augl_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -2075,7 +2077,7 @@ /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "augl_set_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "augl_set_lineno called with no buffer" ); yylineno = line_number; } @@ -2090,7 +2092,7 @@ /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "augl_set_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "augl_set_column called with no buffer" ); yycolumn = column_no; } diff -Nru augeas-1.3.0/src/Makefile.in augeas-1.4.0/src/Makefile.in --- augeas-1.3.0/src/Makefile.in 2014-11-07 22:31:56.000000000 +0000 +++ augeas-1.4.0/src/Makefile.in 2015-06-02 00:23:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -1435,14 +1435,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru augeas-1.3.0/src/parser.c augeas-1.4.0/src/parser.c --- augeas-1.3.0/src/parser.c 2012-11-09 20:02:23.000000000 +0000 +++ augeas-1.4.0/src/parser.c 2015-06-01 22:52:03.000000000 +0000 @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,23 +58,17 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 1 /* Substitute the variable and function names. */ #define yyparse augl_parse #define yylex augl_lex #define yyerror augl_error -#define yylval augl_lval -#define yychar augl_char #define yydebug augl_debug #define yynerrs augl_nerrs -#define yylloc augl_lloc -/* Copy the first part of user declarations. */ -/* Line 268 of yacc.c */ -#line 1 "parser.y" +/* Copy the first part of user declarations. */ +#line 1 "parser.y" /* yacc.c:339 */ #include @@ -106,7 +100,7 @@ do { \ (Current).filename = augl_get_info(scanner)->filename; \ (Current).error = augl_get_info(scanner)->error; \ - if (YYID (N)) { \ + if (N) { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ @@ -119,14 +113,15 @@ } \ } while (0) +#line 117 "parser.c" /* yacc.c:339 */ -/* Line 268 of yacc.c */ -#line 125 "parser.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -136,37 +131,42 @@ # define YYERROR_VERBOSE 1 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "y.tab.h". */ +#ifndef YY_AUGL_PARSER_H_INCLUDED +# define YY_AUGL_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int augl_debug; #endif - -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - DQUOTED = 258, - REGEXP = 259, - LIDENT = 260, - UIDENT = 261, - QIDENT = 262, - ARROW = 263, - KW_MODULE = 264, - KW_AUTOLOAD = 265, - KW_LET = 266, - KW_LET_REC = 267, - KW_IN = 268, - KW_STRING = 269, - KW_REGEXP = 270, - KW_LENS = 271, - KW_TEST = 272, - KW_GET = 273, - KW_PUT = 274, - KW_AFTER = 275 - }; + enum yytokentype + { + DQUOTED = 258, + REGEXP = 259, + LIDENT = 260, + UIDENT = 261, + QIDENT = 262, + ARROW = 263, + KW_MODULE = 264, + KW_AUTOLOAD = 265, + KW_LET = 266, + KW_LET_REC = 267, + KW_IN = 268, + KW_STRING = 269, + KW_REGEXP = 270, + KW_LENS = 271, + KW_TEST = 272, + KW_GET = 273, + KW_PUT = 274, + KW_AFTER = 275 + }; #endif /* Tokens. */ #define DQUOTED 258 @@ -188,15 +188,12 @@ #define KW_PUT 274 #define KW_AFTER 275 - - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 293 of yacc.c */ -#line 89 "parser.y" +#line 89 "parser.y" /* yacc.c:355 */ struct term *term; struct type *type; @@ -210,33 +207,31 @@ int intval; enum quant_tag quant; - - -/* Line 293 of yacc.c */ -#line 217 "parser.c" -} YYSTYPE; +#line 211 "parser.c" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif -/* "%code provides" blocks. */ -/* Line 340 of yacc.c */ -#line 46 "parser.y" + +int augl_parse (struct term **term, yyscan_t scanner); +/* "%code provides" blocks. */ +#line 46 "parser.y" /* yacc.c:355 */ #include "info.h" @@ -247,15 +242,12 @@ }; +#line 246 "parser.c" /* yacc.c:355 */ - -/* Line 340 of yacc.c */ -#line 254 "parser.c" +#endif /* !YY_AUGL_PARSER_H_INCLUDED */ /* Copy the second part of user declarations. */ - -/* Line 343 of yacc.c */ -#line 114 "parser.y" +#line 114 "parser.y" /* yacc.c:358 */ /* Lexer */ extern int augl_lex (YYSTYPE * yylval_param,struct info * yylloc_param ,yyscan_t yyscanner); @@ -318,9 +310,7 @@ } while(0); - -/* Line 343 of yacc.c */ -#line 324 "parser.c" +#line 314 "parser.c" /* yacc.c:358 */ #ifdef short # undef short @@ -334,11 +324,8 @@ #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -358,8 +345,7 @@ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -373,39 +359,68 @@ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -423,9 +438,9 @@ # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -435,8 +450,8 @@ # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -452,7 +467,7 @@ # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -460,15 +475,13 @@ # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -478,8 +491,8 @@ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -505,35 +518,35 @@ elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do +/* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -549,17 +562,19 @@ #define YYNNTS 25 /* YYNRULES -- Number of rules. */ #define YYNRULES 61 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 113 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 275 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -593,44 +608,7 @@ }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 9, 12, 13, 20, 26, 32, 38, - 39, 43, 49, 51, 53, 61, 63, 67, 69, 73, - 75, 77, 81, 83, 87, 89, 92, 94, 96, 98, - 100, 104, 108, 111, 114, 116, 118, 120, 122, 124, - 126, 128, 130, 133, 134, 140, 142, 144, 146, 150, - 152, 154, 156, 158, 162, 167, 171, 176, 177, 180, - 185, 187 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 37, 0, -1, 9, 6, 21, 38, 39, -1, 10, - 5, -1, -1, 11, 5, 52, 21, 42, 39, -1, - 12, 5, 21, 42, 39, -1, 17, 40, 21, 42, - 39, -1, 17, 40, 21, 41, 39, -1, -1, 48, - 18, 42, -1, 48, 19, 48, 20, 42, -1, 22, - -1, 23, -1, 11, 5, 52, 21, 42, 13, 42, - -1, 43, -1, 43, 24, 44, -1, 44, -1, 44, - 25, 45, -1, 45, -1, 57, -1, 45, 26, 46, - -1, 46, -1, 46, 27, 47, -1, 47, -1, 47, - 49, -1, 49, -1, 51, -1, 3, -1, 4, -1, - 28, 42, 29, -1, 30, 42, 31, -1, 28, 29, - -1, 48, 50, -1, 48, -1, 23, -1, 32, -1, - 22, -1, 5, -1, 7, -1, 18, -1, 19, -1, - 53, 52, -1, -1, 28, 54, 33, 55, 29, -1, - 5, -1, 18, -1, 19, -1, 56, 8, 55, -1, - 56, -1, 14, -1, 15, -1, 16, -1, 28, 55, - 29, -1, 57, 34, 59, 35, -1, 34, 59, 35, - -1, 58, 34, 59, 35, -1, -1, 60, 58, -1, - 60, 21, 3, 58, -1, 3, -1, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 179, 179, 182, 185, 187, 192, 197, 202, 208, @@ -643,7 +621,7 @@ }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 1 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -656,13 +634,13 @@ "start", "autoload", "decls", "test_exp", "test_special_res", "exp", "composeexp", "unionexp", "minusexp", "catexp", "appexp", "aexp", "rexp", "rep", "qid", "param_list", "param", "id", "type", "atype", "tree_const", - "tree_const2", "tree_branch", "tree_label", 0 + "tree_const2", "tree_branch", "tree_label", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -672,60 +650,18 @@ }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 36, 37, 38, 38, 39, 39, 39, 39, 39, - 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, - 44, 45, 45, 46, 46, 47, 47, 48, 48, 48, - 48, 48, 48, 49, 49, 50, 50, 50, 51, 51, - 51, 51, 52, 52, 53, 54, 54, 54, 55, 55, - 56, 56, 56, 56, 57, 57, 58, 58, 59, 59, - 60, 60 -}; +#define YYPACT_NINF -90 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 5, 2, 0, 6, 5, 5, 5, 0, - 3, 5, 1, 1, 7, 1, 3, 1, 3, 1, - 1, 3, 1, 3, 1, 2, 1, 1, 1, 1, - 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 0, 5, 1, 1, 1, 3, 1, - 1, 1, 1, 3, 4, 3, 4, 0, 2, 4, - 1, 0 -}; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-90))) -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 0, 0, 0, 1, 4, 0, 9, 3, 0, - 0, 0, 2, 43, 0, 28, 29, 38, 39, 40, - 41, 0, 0, 0, 0, 27, 0, 0, 43, 0, - 0, 32, 61, 0, 15, 17, 19, 22, 24, 34, - 26, 20, 0, 0, 0, 0, 45, 46, 47, 0, - 0, 42, 9, 43, 60, 0, 57, 30, 0, 0, - 0, 0, 25, 37, 35, 36, 33, 61, 31, 12, - 13, 9, 9, 10, 0, 0, 9, 6, 0, 55, - 0, 58, 16, 18, 21, 23, 0, 8, 7, 0, - 50, 51, 52, 0, 0, 49, 5, 0, 57, 61, - 54, 11, 0, 44, 0, 0, 59, 0, 53, 48, - 0, 56, 14 -}; +#define YYTABLE_NINF -1 -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 2, 7, 12, 23, 71, 33, 34, 35, 36, - 37, 38, 39, 40, 66, 25, 27, 28, 49, 94, - 95, 41, 81, 55, 56 -}; +#define yytable_value_is_error(Yytable_value) \ + 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -90 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { -1, 8, 16, -4, -90, 14, 26, 53, -90, 27, @@ -742,7 +678,26 @@ 55, -90, -90 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 0, 0, 1, 4, 0, 9, 3, 0, + 0, 0, 2, 43, 0, 28, 29, 38, 39, 40, + 41, 0, 0, 0, 0, 27, 0, 0, 43, 0, + 0, 32, 61, 0, 15, 17, 19, 22, 24, 34, + 26, 20, 0, 0, 0, 0, 45, 46, 47, 0, + 0, 42, 9, 43, 60, 0, 57, 30, 0, 0, + 0, 0, 25, 37, 35, 36, 33, 61, 31, 12, + 13, 9, 9, 10, 0, 0, 9, 6, 0, 55, + 0, 58, 16, 18, 21, 23, 0, 8, 7, 0, + 50, 51, 52, 0, 0, 49, 5, 0, 57, 61, + 54, 11, 0, 44, 0, 0, 59, 0, 53, 48, + 0, 56, 14 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -90, -90, -90, -34, -90, -90, -22, -90, 61, 66, @@ -750,10 +705,17 @@ -90, -90, 31, -64, -90 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 2, 7, 12, 23, 71, 33, 34, 35, 36, + 37, 38, 39, 40, 66, 25, 27, 28, 49, 94, + 95, 41, 81, 55, 56 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 42, 62, 24, 86, 102, 51, 46, 52, 1, 90, @@ -771,12 +733,6 @@ 21, 32, 22, 85, 0, 83, 0, 0, 0, 106 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-90)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 22, 38, 11, 67, 93, 28, 5, 29, 9, 14, @@ -794,8 +750,8 @@ 28, 34, 30, 61, -1, 59, -1, -1, -1, 98 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 9, 37, 6, 0, 21, 10, 38, 5, 11, @@ -812,79 +768,106 @@ 13, 35, 42 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 36, 37, 38, 38, 39, 39, 39, 39, 39, + 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, + 44, 45, 45, 46, 46, 47, 47, 48, 48, 48, + 48, 48, 48, 49, 49, 50, 50, 50, 51, 51, + 51, 51, 52, 52, 53, 54, 54, 54, 55, 55, + 56, 56, 56, 56, 57, 57, 58, 58, 59, 59, + 60, 60 +}; -#define YYRECOVERING() (!!yyerrstatus) + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 5, 2, 0, 6, 5, 5, 5, 0, + 3, 5, 1, 1, 7, 1, 3, 1, 3, 1, + 1, 3, 1, 3, 1, 2, 1, 1, 1, 1, + 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 0, 5, 1, 1, 1, 3, 1, + 1, 1, 1, 3, 4, 3, 4, 0, 2, 4, + 1, 0 +}; -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (&yylloc, term, scanner, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#define YYTERROR 1 -#define YYERRCODE 256 + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, term, scanner, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) #endif +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know @@ -892,86 +875,75 @@ #ifndef YY_LOCATION_PRINT # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif +/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ -/* YYLEX -- calling `yylex' with the right arguments. */ +YY_ATTRIBUTE_UNUSED +static unsigned +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) +{ + unsigned res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); + } + return res; + } -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc, scanner) -#endif +# define YY_LOCATION_PRINT(File, Loc) \ + yy_location_print_ (File, &(Loc)) -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif +#endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, term, scanner); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location, term, scanner); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct term **term, yyscan_t scanner) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, term, scanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - struct term **term; - yyscan_t scanner; -#endif { - if (!yyvaluep) - return; + FILE *yyo = yyoutput; + YYUSE (yyo); YYUSE (yylocationp); YYUSE (term); YYUSE (scanner); + if (!yyvaluep) + return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -979,25 +951,11 @@ | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct term **term, yyscan_t scanner) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, term, scanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - struct term **term; - yyscan_t scanner; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); @@ -1010,16 +968,8 @@ | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1030,52 +980,42 @@ YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, struct term **term, yyscan_t scanner) -#else static void -yy_reduce_print (yyvsp, yylsp, yyrule, term, scanner) - YYSTYPE *yyvsp; - YYLTYPE *yylsp; - int yyrule; - struct term **term; - yyscan_t scanner; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, struct term **term, yyscan_t scanner) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , term, scanner); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) , term, scanner); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule, term, scanner); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, term, scanner); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1089,7 +1029,7 @@ /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1112,15 +1052,8 @@ # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1136,16 +1069,8 @@ # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1175,27 +1100,27 @@ char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1218,12 +1143,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = 0; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1231,10 +1155,6 @@ int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1283,11 +1203,13 @@ break; } yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } } } } @@ -1307,10 +1229,12 @@ # undef YYCASE_ } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } if (*yymsg_alloc < yysize) { @@ -1347,91 +1271,49 @@ | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct term **term, yyscan_t scanner) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp, term, scanner) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; - struct term **term; - yyscan_t scanner; -#endif { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (term); YYUSE (scanner); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (struct term **term, yyscan_t scanner); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (struct term **term, yyscan_t scanner) -#else -int -yyparse (term, scanner) - struct term **term; - yyscan_t scanner; -#endif -#endif { /* The lookahead symbol. */ int yychar; + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Location data for the lookahead symbol. */ -YYLTYPE yylloc; +static YYLTYPE yyloc_default +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +YYLTYPE yylloc = yyloc_default; /* Number of syntax errors so far. */ int yynerrs; @@ -1441,11 +1323,11 @@ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. + 'yyss': related to states. + 'yyvs': related to semantic values. + 'yyls': related to locations. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1471,7 +1353,7 @@ int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1490,10 +1372,9 @@ Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yyls = yylsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yylsp = yyls = yylsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1503,24 +1384,8 @@ yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - yylsp = yyls; - -#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL - /* Initialize the default location before parsing starts. */ - yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 1; -#endif - /* User initialization code. */ - -/* Line 1590 of yacc.c */ -#line 66 "parser.y" +#line 66 "parser.y" /* yacc.c:1429 */ { yylloc.first_line = 1; yylloc.first_column = 0; @@ -1530,10 +1395,8 @@ yylloc.error = augl_get_info(scanner)->error; } -/* Line 1590 of yacc.c */ -#line 1535 "parser.c" +#line 1399 "parser.c" /* yacc.c:1429 */ yylsp[0] = yylloc; - goto yysetstate; /*------------------------------------------------------------. @@ -1554,26 +1417,26 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1581,23 +1444,23 @@ # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1607,10 +1470,10 @@ yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1639,7 +1502,7 @@ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, &yylloc, scanner); } if (yychar <= YYEOF) @@ -1679,7 +1542,9 @@ yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END *++yylsp = yylloc; goto yynewstate; @@ -1702,7 +1567,7 @@ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1717,436 +1582,376 @@ switch (yyn) { case 2: - -/* Line 1806 of yacc.c */ -#line 180 "parser.y" - { (*term) = make_module((yyvsp[(2) - (5)].string), (yyvsp[(4) - (5)].string), (yyvsp[(5) - (5)].term), &(yylsp[(1) - (5)])); } +#line 180 "parser.y" /* yacc.c:1646 */ + { (*term) = make_module((yyvsp[-3].string), (yyvsp[-1].string), (yyvsp[0].term), &(yylsp[-4])); } +#line 1588 "parser.c" /* yacc.c:1646 */ break; case 3: - -/* Line 1806 of yacc.c */ -#line 183 "parser.y" - { (yyval.string) = (yyvsp[(2) - (2)].string); } +#line 183 "parser.y" /* yacc.c:1646 */ + { (yyval.string) = (yyvsp[0].string); } +#line 1594 "parser.c" /* yacc.c:1646 */ break; case 4: - -/* Line 1806 of yacc.c */ -#line 185 "parser.y" +#line 185 "parser.y" /* yacc.c:1646 */ { (yyval.string) = NULL; } +#line 1600 "parser.c" /* yacc.c:1646 */ break; case 5: - -/* Line 1806 of yacc.c */ -#line 188 "parser.y" +#line 188 "parser.y" /* yacc.c:1646 */ { - LOC_MERGE((yylsp[(1) - (6)]), (yylsp[(1) - (6)]), (yylsp[(5) - (6)])); - (yyval.term) = make_bind((yyvsp[(2) - (6)].string), (yyvsp[(3) - (6)].term), (yyvsp[(5) - (6)].term), (yyvsp[(6) - (6)].term), &(yylsp[(1) - (6)])); + LOC_MERGE((yylsp[-5]), (yylsp[-5]), (yylsp[-1])); + (yyval.term) = make_bind((yyvsp[-4].string), (yyvsp[-3].term), (yyvsp[-1].term), (yyvsp[0].term), &(yylsp[-5])); } +#line 1609 "parser.c" /* yacc.c:1646 */ break; case 6: - -/* Line 1806 of yacc.c */ -#line 193 "parser.y" +#line 193 "parser.y" /* yacc.c:1646 */ { - LOC_MERGE((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), (yylsp[(4) - (5)])); - (yyval.term) = make_bind_rec((yyvsp[(2) - (5)].string), (yyvsp[(4) - (5)].term), (yyvsp[(5) - (5)].term), &(yylsp[(1) - (5)])); + LOC_MERGE((yylsp[-4]), (yylsp[-4]), (yylsp[-1])); + (yyval.term) = make_bind_rec((yyvsp[-3].string), (yyvsp[-1].term), (yyvsp[0].term), &(yylsp[-4])); } +#line 1618 "parser.c" /* yacc.c:1646 */ break; case 7: - -/* Line 1806 of yacc.c */ -#line 198 "parser.y" +#line 198 "parser.y" /* yacc.c:1646 */ { - LOC_MERGE((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), (yylsp[(4) - (5)])); - (yyval.term) = make_test((yyvsp[(2) - (5)].term), (yyvsp[(4) - (5)].term), TR_CHECK, (yyvsp[(5) - (5)].term), &(yylsp[(1) - (5)])); + LOC_MERGE((yylsp[-4]), (yylsp[-4]), (yylsp[-1])); + (yyval.term) = make_test((yyvsp[-3].term), (yyvsp[-1].term), TR_CHECK, (yyvsp[0].term), &(yylsp[-4])); } +#line 1627 "parser.c" /* yacc.c:1646 */ break; case 8: - -/* Line 1806 of yacc.c */ -#line 203 "parser.y" +#line 203 "parser.y" /* yacc.c:1646 */ { - LOC_MERGE((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), (yylsp[(4) - (5)])); - (yyval.term) = make_test((yyvsp[(2) - (5)].term), NULL, (yyvsp[(4) - (5)].intval), (yyvsp[(5) - (5)].term), &(yylsp[(1) - (5)])); + LOC_MERGE((yylsp[-4]), (yylsp[-4]), (yylsp[-1])); + (yyval.term) = make_test((yyvsp[-3].term), NULL, (yyvsp[-1].intval), (yyvsp[0].term), &(yylsp[-4])); } +#line 1636 "parser.c" /* yacc.c:1646 */ break; case 9: - -/* Line 1806 of yacc.c */ -#line 208 "parser.y" +#line 208 "parser.y" /* yacc.c:1646 */ { (yyval.term) = NULL; } +#line 1642 "parser.c" /* yacc.c:1646 */ break; case 10: - -/* Line 1806 of yacc.c */ -#line 213 "parser.y" - { (yyval.term) = make_get_test((yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); } +#line 213 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_get_test((yyvsp[-2].term), (yyvsp[0].term), &(yyloc)); } +#line 1648 "parser.c" /* yacc.c:1646 */ break; case 11: - -/* Line 1806 of yacc.c */ -#line 215 "parser.y" - { (yyval.term) = make_put_test((yyvsp[(1) - (5)].term), (yyvsp[(3) - (5)].term), (yyvsp[(5) - (5)].term), &(yyloc)); } +#line 215 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_put_test((yyvsp[-4].term), (yyvsp[-2].term), (yyvsp[0].term), &(yyloc)); } +#line 1654 "parser.c" /* yacc.c:1646 */ break; case 12: - -/* Line 1806 of yacc.c */ -#line 218 "parser.y" +#line 218 "parser.y" /* yacc.c:1646 */ { (yyval.intval) = TR_PRINT; } +#line 1660 "parser.c" /* yacc.c:1646 */ break; case 13: - -/* Line 1806 of yacc.c */ -#line 220 "parser.y" +#line 220 "parser.y" /* yacc.c:1646 */ { (yyval.intval) = TR_EXN; } +#line 1666 "parser.c" /* yacc.c:1646 */ break; case 14: - -/* Line 1806 of yacc.c */ -#line 224 "parser.y" +#line 224 "parser.y" /* yacc.c:1646 */ { - LOC_MERGE((yylsp[(1) - (7)]), (yylsp[(1) - (7)]), (yylsp[(6) - (7)])); - (yyval.term) = make_let((yyvsp[(2) - (7)].string), (yyvsp[(3) - (7)].term), (yyvsp[(5) - (7)].term), (yyvsp[(7) - (7)].term), &(yylsp[(1) - (7)])); + LOC_MERGE((yylsp[-6]), (yylsp[-6]), (yylsp[-1])); + (yyval.term) = make_let((yyvsp[-5].string), (yyvsp[-4].term), (yyvsp[-2].term), (yyvsp[0].term), &(yylsp[-6])); } +#line 1675 "parser.c" /* yacc.c:1646 */ break; case 16: - -/* Line 1806 of yacc.c */ -#line 231 "parser.y" - { (yyval.term) = make_binop(A_COMPOSE, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); } +#line 231 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_binop(A_COMPOSE, (yyvsp[-2].term), (yyvsp[0].term), &(yyloc)); } +#line 1681 "parser.c" /* yacc.c:1646 */ break; case 17: - -/* Line 1806 of yacc.c */ -#line 233 "parser.y" - { (yyval.term) = (yyvsp[(1) - (1)].term); } +#line 233 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = (yyvsp[0].term); } +#line 1687 "parser.c" /* yacc.c:1646 */ break; case 18: - -/* Line 1806 of yacc.c */ -#line 236 "parser.y" - { (yyval.term) = make_binop(A_UNION, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); } +#line 236 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_binop(A_UNION, (yyvsp[-2].term), (yyvsp[0].term), &(yyloc)); } +#line 1693 "parser.c" /* yacc.c:1646 */ break; case 19: - -/* Line 1806 of yacc.c */ -#line 238 "parser.y" - { (yyval.term) = (yyvsp[(1) - (1)].term); } +#line 238 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = (yyvsp[0].term); } +#line 1699 "parser.c" /* yacc.c:1646 */ break; case 20: - -/* Line 1806 of yacc.c */ -#line 240 "parser.y" - { (yyval.term) = make_tree_value((yyvsp[(1) - (1)].tree), &(yylsp[(1) - (1)])); } +#line 240 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_tree_value((yyvsp[0].tree), &(yylsp[0])); } +#line 1705 "parser.c" /* yacc.c:1646 */ break; case 21: - -/* Line 1806 of yacc.c */ -#line 243 "parser.y" - { (yyval.term) = make_binop(A_MINUS, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); } +#line 243 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_binop(A_MINUS, (yyvsp[-2].term), (yyvsp[0].term), &(yyloc)); } +#line 1711 "parser.c" /* yacc.c:1646 */ break; case 22: - -/* Line 1806 of yacc.c */ -#line 245 "parser.y" - { (yyval.term) = (yyvsp[(1) - (1)].term); } +#line 245 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = (yyvsp[0].term); } +#line 1717 "parser.c" /* yacc.c:1646 */ break; case 23: - -/* Line 1806 of yacc.c */ -#line 248 "parser.y" - { (yyval.term) = make_binop(A_CONCAT, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); } +#line 248 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_binop(A_CONCAT, (yyvsp[-2].term), (yyvsp[0].term), &(yyloc)); } +#line 1723 "parser.c" /* yacc.c:1646 */ break; case 24: - -/* Line 1806 of yacc.c */ -#line 250 "parser.y" - { (yyval.term) = (yyvsp[(1) - (1)].term); } +#line 250 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = (yyvsp[0].term); } +#line 1729 "parser.c" /* yacc.c:1646 */ break; case 25: - -/* Line 1806 of yacc.c */ -#line 253 "parser.y" - { (yyval.term) = make_binop(A_APP, (yyvsp[(1) - (2)].term), (yyvsp[(2) - (2)].term), &(yyloc)); } +#line 253 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_binop(A_APP, (yyvsp[-1].term), (yyvsp[0].term), &(yyloc)); } +#line 1735 "parser.c" /* yacc.c:1646 */ break; case 26: - -/* Line 1806 of yacc.c */ -#line 255 "parser.y" - { (yyval.term) = (yyvsp[(1) - (1)].term); } +#line 255 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = (yyvsp[0].term); } +#line 1741 "parser.c" /* yacc.c:1646 */ break; case 27: - -/* Line 1806 of yacc.c */ -#line 258 "parser.y" - { (yyval.term) = make_ident((yyvsp[(1) - (1)].string), &(yylsp[(1) - (1)])); } +#line 258 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_ident((yyvsp[0].string), &(yylsp[0])); } +#line 1747 "parser.c" /* yacc.c:1646 */ break; case 28: - -/* Line 1806 of yacc.c */ -#line 260 "parser.y" - { (yyval.term) = make_string_term((yyvsp[(1) - (1)].string), &(yylsp[(1) - (1)])); } +#line 260 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_string_term((yyvsp[0].string), &(yylsp[0])); } +#line 1753 "parser.c" /* yacc.c:1646 */ break; case 29: - -/* Line 1806 of yacc.c */ -#line 262 "parser.y" - { (yyval.term) = make_regexp_term((yyvsp[(1) - (1)].regexp).pattern, (yyvsp[(1) - (1)].regexp).nocase, &(yylsp[(1) - (1)])); } +#line 262 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_regexp_term((yyvsp[0].regexp).pattern, (yyvsp[0].regexp).nocase, &(yylsp[0])); } +#line 1759 "parser.c" /* yacc.c:1646 */ break; case 30: - -/* Line 1806 of yacc.c */ -#line 264 "parser.y" - { (yyval.term) = (yyvsp[(2) - (3)].term); } +#line 264 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = (yyvsp[-1].term); } +#line 1765 "parser.c" /* yacc.c:1646 */ break; case 31: - -/* Line 1806 of yacc.c */ -#line 266 "parser.y" - { (yyval.term) = make_unop(A_BRACKET, (yyvsp[(2) - (3)].term), &(yyloc)); } +#line 266 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_unop(A_BRACKET, (yyvsp[-1].term), &(yyloc)); } +#line 1771 "parser.c" /* yacc.c:1646 */ break; case 32: - -/* Line 1806 of yacc.c */ -#line 268 "parser.y" +#line 268 "parser.y" /* yacc.c:1646 */ { (yyval.term) = make_unit_term(&(yyloc)); } +#line 1777 "parser.c" /* yacc.c:1646 */ break; case 33: - -/* Line 1806 of yacc.c */ -#line 271 "parser.y" - { (yyval.term) = make_rep((yyvsp[(1) - (2)].term), (yyvsp[(2) - (2)].quant), &(yyloc)); } +#line 271 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_rep((yyvsp[-1].term), (yyvsp[0].quant), &(yyloc)); } +#line 1783 "parser.c" /* yacc.c:1646 */ break; case 34: - -/* Line 1806 of yacc.c */ -#line 273 "parser.y" - { (yyval.term) = (yyvsp[(1) - (1)].term); } +#line 273 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = (yyvsp[0].term); } +#line 1789 "parser.c" /* yacc.c:1646 */ break; case 35: - -/* Line 1806 of yacc.c */ -#line 276 "parser.y" +#line 276 "parser.y" /* yacc.c:1646 */ { (yyval.quant) = Q_STAR; } +#line 1795 "parser.c" /* yacc.c:1646 */ break; case 36: - -/* Line 1806 of yacc.c */ -#line 278 "parser.y" +#line 278 "parser.y" /* yacc.c:1646 */ { (yyval.quant) = Q_PLUS; } +#line 1801 "parser.c" /* yacc.c:1646 */ break; case 37: - -/* Line 1806 of yacc.c */ -#line 280 "parser.y" +#line 280 "parser.y" /* yacc.c:1646 */ { (yyval.quant) = Q_MAYBE; } +#line 1807 "parser.c" /* yacc.c:1646 */ break; case 38: - -/* Line 1806 of yacc.c */ -#line 283 "parser.y" - { (yyval.string) = (yyvsp[(1) - (1)].string); } +#line 283 "parser.y" /* yacc.c:1646 */ + { (yyval.string) = (yyvsp[0].string); } +#line 1813 "parser.c" /* yacc.c:1646 */ break; case 39: - -/* Line 1806 of yacc.c */ -#line 285 "parser.y" - { (yyval.string) = (yyvsp[(1) - (1)].string); } +#line 285 "parser.y" /* yacc.c:1646 */ + { (yyval.string) = (yyvsp[0].string); } +#line 1819 "parser.c" /* yacc.c:1646 */ break; case 40: - -/* Line 1806 of yacc.c */ -#line 287 "parser.y" +#line 287 "parser.y" /* yacc.c:1646 */ { (yyval.string) = strdup("get"); } +#line 1825 "parser.c" /* yacc.c:1646 */ break; case 41: - -/* Line 1806 of yacc.c */ -#line 289 "parser.y" +#line 289 "parser.y" /* yacc.c:1646 */ { (yyval.string) = strdup("put"); } +#line 1831 "parser.c" /* yacc.c:1646 */ break; case 42: - -/* Line 1806 of yacc.c */ -#line 292 "parser.y" - { (yyval.term) = (yyvsp[(2) - (2)].term); list_cons((yyval.term), (yyvsp[(1) - (2)].term)); } +#line 292 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = (yyvsp[0].term); list_cons((yyval.term), (yyvsp[-1].term)); } +#line 1837 "parser.c" /* yacc.c:1646 */ break; case 43: - -/* Line 1806 of yacc.c */ -#line 294 "parser.y" +#line 294 "parser.y" /* yacc.c:1646 */ { (yyval.term) = NULL; } +#line 1843 "parser.c" /* yacc.c:1646 */ break; case 44: - -/* Line 1806 of yacc.c */ -#line 297 "parser.y" - { (yyval.term) = make_param((yyvsp[(2) - (5)].string), (yyvsp[(4) - (5)].type), clone_info(&(yylsp[(1) - (5)]))); } +#line 297 "parser.y" /* yacc.c:1646 */ + { (yyval.term) = make_param((yyvsp[-3].string), (yyvsp[-1].type), clone_info(&(yylsp[-4]))); } +#line 1849 "parser.c" /* yacc.c:1646 */ break; case 45: - -/* Line 1806 of yacc.c */ -#line 300 "parser.y" - { (yyval.string) = (yyvsp[(1) - (1)].string); } +#line 300 "parser.y" /* yacc.c:1646 */ + { (yyval.string) = (yyvsp[0].string); } +#line 1855 "parser.c" /* yacc.c:1646 */ break; case 46: - -/* Line 1806 of yacc.c */ -#line 302 "parser.y" +#line 302 "parser.y" /* yacc.c:1646 */ { (yyval.string) = strdup("get"); } +#line 1861 "parser.c" /* yacc.c:1646 */ break; case 47: - -/* Line 1806 of yacc.c */ -#line 304 "parser.y" +#line 304 "parser.y" /* yacc.c:1646 */ { (yyval.string) = strdup("put"); } +#line 1867 "parser.c" /* yacc.c:1646 */ break; case 48: - -/* Line 1806 of yacc.c */ -#line 307 "parser.y" - { (yyval.type) = make_arrow_type((yyvsp[(1) - (3)].type), (yyvsp[(3) - (3)].type)); } +#line 307 "parser.y" /* yacc.c:1646 */ + { (yyval.type) = make_arrow_type((yyvsp[-2].type), (yyvsp[0].type)); } +#line 1873 "parser.c" /* yacc.c:1646 */ break; case 49: - -/* Line 1806 of yacc.c */ -#line 309 "parser.y" - { (yyval.type) = (yyvsp[(1) - (1)].type); } +#line 309 "parser.y" /* yacc.c:1646 */ + { (yyval.type) = (yyvsp[0].type); } +#line 1879 "parser.c" /* yacc.c:1646 */ break; case 50: - -/* Line 1806 of yacc.c */ -#line 312 "parser.y" +#line 312 "parser.y" /* yacc.c:1646 */ { (yyval.type) = make_base_type(T_STRING); } +#line 1885 "parser.c" /* yacc.c:1646 */ break; case 51: - -/* Line 1806 of yacc.c */ -#line 314 "parser.y" +#line 314 "parser.y" /* yacc.c:1646 */ { (yyval.type) = make_base_type(T_REGEXP); } +#line 1891 "parser.c" /* yacc.c:1646 */ break; case 52: - -/* Line 1806 of yacc.c */ -#line 316 "parser.y" +#line 316 "parser.y" /* yacc.c:1646 */ { (yyval.type) = make_base_type(T_LENS); } +#line 1897 "parser.c" /* yacc.c:1646 */ break; case 53: - -/* Line 1806 of yacc.c */ -#line 318 "parser.y" - { (yyval.type) = (yyvsp[(2) - (3)].type); } +#line 318 "parser.y" /* yacc.c:1646 */ + { (yyval.type) = (yyvsp[-1].type); } +#line 1903 "parser.c" /* yacc.c:1646 */ break; case 54: - -/* Line 1806 of yacc.c */ -#line 321 "parser.y" - { (yyval.tree) = tree_concat((yyvsp[(1) - (4)].tree), (yyvsp[(3) - (4)].tree)); } +#line 321 "parser.y" /* yacc.c:1646 */ + { (yyval.tree) = tree_concat((yyvsp[-3].tree), (yyvsp[-1].tree)); } +#line 1909 "parser.c" /* yacc.c:1646 */ break; case 55: - -/* Line 1806 of yacc.c */ -#line 323 "parser.y" - { (yyval.tree) = tree_concat((yyvsp[(2) - (3)].tree), NULL); } +#line 323 "parser.y" /* yacc.c:1646 */ + { (yyval.tree) = tree_concat((yyvsp[-1].tree), NULL); } +#line 1915 "parser.c" /* yacc.c:1646 */ break; case 56: - -/* Line 1806 of yacc.c */ -#line 326 "parser.y" +#line 326 "parser.y" /* yacc.c:1646 */ { - (yyval.tree) = tree_concat((yyvsp[(1) - (4)].tree), (yyvsp[(3) - (4)].tree)); + (yyval.tree) = tree_concat((yyvsp[-3].tree), (yyvsp[-1].tree)); } +#line 1923 "parser.c" /* yacc.c:1646 */ break; case 57: - -/* Line 1806 of yacc.c */ -#line 330 "parser.y" +#line 330 "parser.y" /* yacc.c:1646 */ { (yyval.tree) = NULL; } +#line 1929 "parser.c" /* yacc.c:1646 */ break; case 58: - -/* Line 1806 of yacc.c */ -#line 333 "parser.y" +#line 333 "parser.y" /* yacc.c:1646 */ { - (yyval.tree) = make_tree((yyvsp[(1) - (2)].string), NULL, NULL, (yyvsp[(2) - (2)].tree)); + (yyval.tree) = make_tree((yyvsp[-1].string), NULL, NULL, (yyvsp[0].tree)); } +#line 1937 "parser.c" /* yacc.c:1646 */ break; case 59: - -/* Line 1806 of yacc.c */ -#line 337 "parser.y" +#line 337 "parser.y" /* yacc.c:1646 */ { - (yyval.tree) = make_tree((yyvsp[(1) - (4)].string), (yyvsp[(3) - (4)].string), NULL, (yyvsp[(4) - (4)].tree)); + (yyval.tree) = make_tree((yyvsp[-3].string), (yyvsp[-1].string), NULL, (yyvsp[0].tree)); } +#line 1945 "parser.c" /* yacc.c:1646 */ break; case 61: - -/* Line 1806 of yacc.c */ -#line 342 "parser.y" +#line 342 "parser.y" /* yacc.c:1646 */ { (yyval.string) = NULL; } +#line 1951 "parser.c" /* yacc.c:1646 */ break; - -/* Line 1806 of yacc.c */ -#line 2150 "parser.c" +#line 1955 "parser.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2169,7 +1974,7 @@ *++yyvsp = yyval; *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2184,9 +1989,9 @@ goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2237,20 +2042,20 @@ if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, term, scanner); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, term, scanner); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2270,7 +2075,7 @@ goto yyerrorlab; yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2283,35 +2088,37 @@ | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, term, scanner); + yystos[yystate], yyvsp, yylsp, term, scanner); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END yyerror_range[2] = yylloc; /* Using YYLLOC is tempting, but would change the location of @@ -2340,7 +2147,7 @@ yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -2359,14 +2166,14 @@ yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, term, scanner); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, term, scanner); + yystos[*yyssp], yyvsp, yylsp, term, scanner); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2377,14 +2184,9 @@ if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - - -/* Line 2067 of yacc.c */ -#line 343 "parser.y" +#line 343 "parser.y" /* yacc.c:1906 */ int augl_parse_file(struct augeas *aug, const char *name, @@ -2691,4 +2493,3 @@ } syntax_error(&info, "%s", s); } - diff -Nru augeas-1.3.0/src/parser.h augeas-1.4.0/src/parser.h --- augeas-1.3.0/src/parser.h 2012-08-14 18:24:25.000000000 +0000 +++ augeas-1.4.0/src/parser.h 2012-11-02 15:20:12.000000000 +0000 @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,36 +26,44 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +#ifndef YY_AUGL_PARSER_H_INCLUDED +# define YY_AUGL_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int augl_debug; +#endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - DQUOTED = 258, - REGEXP = 259, - LIDENT = 260, - UIDENT = 261, - QIDENT = 262, - ARROW = 263, - KW_MODULE = 264, - KW_AUTOLOAD = 265, - KW_LET = 266, - KW_LET_REC = 267, - KW_IN = 268, - KW_STRING = 269, - KW_REGEXP = 270, - KW_LENS = 271, - KW_TEST = 272, - KW_GET = 273, - KW_PUT = 274, - KW_AFTER = 275 - }; + enum yytokentype + { + DQUOTED = 258, + REGEXP = 259, + LIDENT = 260, + UIDENT = 261, + QIDENT = 262, + ARROW = 263, + KW_MODULE = 264, + KW_AUTOLOAD = 265, + KW_LET = 266, + KW_LET_REC = 267, + KW_IN = 268, + KW_STRING = 269, + KW_REGEXP = 270, + KW_LENS = 271, + KW_TEST = 272, + KW_GET = 273, + KW_PUT = 274, + KW_AFTER = 275 + }; #endif /* Tokens. */ #define DQUOTED 258 @@ -77,15 +85,12 @@ #define KW_PUT 274 #define KW_AFTER 275 - - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 2068 of yacc.c */ -#line 89 "parser.y" +#line 89 "parser.y" /* yacc.c:1909 */ struct term *term; struct type *type; @@ -99,37 +104,31 @@ int intval; enum quant_tag quant; - - -/* Line 2068 of yacc.c */ -#line 106 "parser.h" -} YYSTYPE; +#line 108 "parser.h" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif - - +/* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +}; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif +int augl_parse (struct term **term, yyscan_t scanner); /* "%code provides" blocks. */ - -/* Line 2068 of yacc.c */ -#line 46 "parser.y" +#line 46 "parser.y" /* yacc.c:1909 */ #include "info.h" @@ -140,7 +139,6 @@ }; +#line 143 "parser.h" /* yacc.c:1909 */ - -/* Line 2068 of yacc.c */ -#line 147 "parser.h" +#endif /* !YY_AUGL_PARSER_H_INCLUDED */ diff -Nru augeas-1.3.0/src/parser.y augeas-1.4.0/src/parser.y --- augeas-1.3.0/src/parser.y 2012-11-02 15:20:12.000000000 +0000 +++ augeas-1.4.0/src/parser.y 2015-06-01 21:54:39.000000000 +0000 @@ -29,7 +29,7 @@ do { \ (Current).filename = augl_get_info(scanner)->filename; \ (Current).error = augl_get_info(scanner)->error; \ - if (YYID (N)) { \ + if (N) { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ @@ -56,7 +56,7 @@ %locations %error-verbose -%name-prefix="augl_" +%name-prefix "augl_" %defines %pure-parser %parse-param {struct term **term} diff -Nru augeas-1.3.0/src/pathx.c augeas-1.4.0/src/pathx.c --- augeas-1.3.0/src/pathx.c 2012-11-21 00:14:39.000000000 +0000 +++ augeas-1.4.0/src/pathx.c 2015-05-22 22:31:25.000000000 +0000 @@ -123,6 +123,15 @@ static const char *const axis_sep = "::"; +/* The characters that can follow a name in a location expression (aka path) + * The parser will assume that name (path component) is finished when it + * encounters any of these characters, unless they are escaped by preceding + * them with a '\\'. + * + * See parse_name for the gory details + */ +static const char const name_follow[] = "][|/=()!,"; + /* Doubly linked list of location steps. Besides the information from the * path expression, also contains information to iterate over a node set, * in particular, the context node CTX for the step, and the current node @@ -1607,17 +1616,43 @@ push_expr(expr, state); } +int pathx_escape_name(const char *in, char **out) { + const char *p; + int num_to_escape = 0; + char *s; + + *out = NULL; + + for (p = in; *p; p++) { + if (strchr(name_follow, *p) || isspace(*p) || *p == '\\') + num_to_escape += 1; + } + + if (num_to_escape == 0) + return 0; + + if (ALLOC_N(*out, strlen(in) + num_to_escape + 1) < 0) + return -1; + + for (p = in, s = *out; *p; p++) { + if (strchr(name_follow, *p) || isspace(*p) || *p == '\\') + *s++ = '\\'; + *s++ = *p; + } + *s = '\0'; + return 0; +} + /* * NameNoWS ::= [^][|/\= \t\n] | \\. * NameWS ::= [^][|/\=] | \\. * Name ::= NameNoWS NameWS* NameNoWS | NameNoWS */ static char *parse_name(struct state *state) { - static const char const follow[] = "][|/=()!,"; const char *s = state->pos; char *result; - while (*state->pos != '\0' && strchr(follow, *state->pos) == NULL) { + while (*state->pos != '\0' && strchr(name_follow, *state->pos) == NULL) { /* This is a hack: since we allow spaces in names, we need to avoid * gobbling up stuff that is in follow(Name), e.g. 'or' so that * things like [name1 or name2] still work. diff -Nru augeas-1.3.0/src/syntax.c augeas-1.4.0/src/syntax.c --- augeas-1.3.0/src/syntax.c 2013-05-16 00:56:06.000000000 +0000 +++ augeas-1.4.0/src/syntax.c 2015-06-01 22:03:07.000000000 +0000 @@ -1962,7 +1962,8 @@ return filename; } -int load_module_file(struct augeas *aug, const char *filename) { +int load_module_file(struct augeas *aug, const char *filename, + const char *name) { struct term *term = NULL; int result = -1; @@ -1977,10 +1978,18 @@ goto error; struct module *module = compile(term, aug); - ERR_THROW(module == NULL, aug, AUG_ESYNTAX, - "Failed to load %s", filename); + bool bad_module = (module == NULL); + if (bad_module && name != NULL) { + /* Put an empty placeholder on the module list so that + * we don't retry loading this module everytime its mentioned + */ + module = module_create(name); + } + if (module != NULL) + list_append(aug->modules, module); + + ERR_THROW(bad_module, aug, AUG_ESYNTAX, "Failed to load %s", filename); - list_append(aug->modules, module); result = 0; error: // FIXME: This leads to a bad free of a string used in a del lens @@ -1998,7 +2007,7 @@ if ((filename = module_filename(aug, name)) == NULL) return -1; - if (load_module_file(aug, filename) == -1) + if (load_module_file(aug, filename, name) == -1) goto error; free(filename); diff -Nru augeas-1.3.0/src/syntax.h augeas-1.4.0/src/syntax.h --- augeas-1.3.0/src/syntax.h 2013-01-23 18:03:37.000000000 +0000 +++ augeas-1.4.0/src/syntax.h 2015-06-01 22:03:07.000000000 +0000 @@ -274,7 +274,7 @@ struct module *builtin_init(struct error *); -int load_module_file(struct augeas *aug, const char *filename); +int load_module_file(struct augeas *aug, const char *filename, const char *name); /* The name of the builtin function that checks recursive lenses */ #define LNS_CHECK_REC_NAME "lns_check_rec" diff -Nru augeas-1.3.0/src/transform.c augeas-1.4.0/src/transform.c --- augeas-1.3.0/src/transform.c 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/src/transform.c 2015-06-02 00:07:40.000000000 +0000 @@ -61,6 +61,8 @@ */ static const char *const s_path = "path"; static const char *const s_lens = "lens"; +static const char *const s_last = "last_matched"; +static const char *const s_next = "next_not_matched"; static const char *const s_info = "info"; static const char *const s_mtime = "mtime"; @@ -328,9 +330,9 @@ } ATTRIBUTE_FORMAT(printf, 4, 5) -static void err_set(struct augeas *aug, - struct tree *err_info, const char *sub, - const char *format, ...) { +static struct tree *err_set(struct augeas *aug, + struct tree *err_info, const char *sub, + const char *format, ...) { int r; va_list ap; char *value = NULL; @@ -351,6 +353,22 @@ error: free(value); + return tree; +} + +static struct tree *err_lens_entry(struct augeas *aug, struct tree *where, + struct lens *lens, const char *label) { + struct tree *result = NULL; + + if (lens == NULL) + return NULL; + + char *fi = format_info(lens->info); + if (fi != NULL) { + result = err_set(aug, where, label, "%s", fi); + free(fi); + } + return result; } /* Record an error in the tree. The error will show up underneath @@ -400,12 +418,10 @@ if (err->path != NULL) { err_set(aug, err_info, s_path, "%s%s", path, err->path); } - if (err->lens != NULL) { - char *fi = format_info(err->lens->info); - if (fi != NULL) { - err_set(aug, err_info, s_lens, "%s", fi); - free(fi); - } + struct tree *t = err_lens_entry(aug, err_info, err->lens, s_lens); + if (t != NULL) { + err_lens_entry(aug, t, err->last, s_last); + err_lens_entry(aug, t, err->next, s_next); } err_set(aug, err_info, s_message, "%s", err->message); } else if (errnum != 0) { @@ -847,9 +863,16 @@ int selinux_enabled = (is_selinux_enabled() > 0); security_context_t con = NULL; - int from_fd = fileno(from); + int from_fd; int to_fd = fileno(to); + if (from == NULL) { + *err_status = "replace_from_missing"; + return -1; + } + + from_fd = fileno(from); + ret = fstat(from_fd, &st); if (ret < 0) { *err_status = "replace_stat"; @@ -1135,7 +1158,6 @@ if (augorig_exists) { if (transfer_file_attrs(augorig_canon_fp, fp, &err_status) != 0) { - err_status = "xfer_attrs"; goto done; } } else { @@ -1330,21 +1352,34 @@ } int remove_file(struct augeas *aug, struct tree *tree) { - char *path = NULL; - const char *filename = NULL; const char *err_status = NULL; char *dyn_err_status = NULL; char *augsave = NULL, *augorig = NULL, *augorig_canon = NULL; + struct tree *path = NULL; + const char *file_path = NULL; + char *meta_path = NULL; int r; - path = path_of_tree(tree); + path = tree_child(tree, s_path); if (path == NULL) { + err_status = "no child called 'path' for file entry"; + goto error; + } + file_path = path->value + strlen(AUGEAS_FILES_TREE); + path = NULL; + + if (file_path == NULL) { + err_status = "no path for file"; + goto error; + } + + meta_path = path_of_tree(tree); + if (meta_path == NULL) { err_status = "path_of_tree"; goto error; } - filename = path + strlen(AUGEAS_META_FILES); - if ((augorig = strappend(aug->root, filename + 1)) == NULL) { + if ((augorig = strappend(aug->root, file_path)) == NULL) { err_status = "root_file"; goto error; } @@ -1359,7 +1394,7 @@ } } - r = file_saved_event(aug, path + strlen(AUGEAS_META_TREE)); + r = file_saved_event(aug, meta_path + strlen(AUGEAS_META_TREE)); if (r < 0) { err_status = "saved_event"; goto error; @@ -1389,9 +1424,10 @@ goto error; } } + path = NULL; tree_unlink(aug, tree); done: - free(path); + free(meta_path); free(augorig); free(augorig_canon); free(augsave); @@ -1400,9 +1436,9 @@ { const char *emsg = dyn_err_status == NULL ? err_status : dyn_err_status; - store_error(aug, filename, path, emsg, errno, NULL, NULL); + store_error(aug, file_path, meta_path, emsg, errno, NULL, NULL); } - free(path); + free(meta_path); free(augorig); free(augorig_canon); free(augsave); diff -Nru augeas-1.3.0/src/try augeas-1.4.0/src/try --- augeas-1.3.0/src/try 2013-06-14 20:40:40.000000000 +0000 +++ augeas-1.4.0/src/try 2015-05-22 22:31:25.000000000 +0000 @@ -33,7 +33,7 @@ libtool --mode=execute valgrind --leak-check=full ./augtool --nostdinc < $AUGCMDS elif [[ "x$1" == "xcli" ]] ; then shift - ./augtool --nostdinc "$@" + exec ./augtool --nostdinc "$@" else ./augtool --nostdinc "$@" < $AUGCMDS echo diff -Nru augeas-1.3.0/tests/lens-afs_cellalias.sh augeas-1.4.0/tests/lens-afs_cellalias.sh --- augeas-1.3.0/tests/lens-afs_cellalias.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-afs_cellalias.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-clamav.sh augeas-1.4.0/tests/lens-clamav.sh --- augeas-1.3.0/tests/lens-clamav.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-clamav.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-dns_zone.sh augeas-1.4.0/tests/lens-dns_zone.sh --- augeas-1.3.0/tests/lens-dns_zone.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-dns_zone.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-iscsid.sh augeas-1.4.0/tests/lens-iscsid.sh --- augeas-1.3.0/tests/lens-iscsid.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-iscsid.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-mailscanner_rules.sh augeas-1.4.0/tests/lens-mailscanner_rules.sh --- augeas-1.3.0/tests/lens-mailscanner_rules.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-mailscanner_rules.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-mailscanner.sh augeas-1.4.0/tests/lens-mailscanner.sh --- augeas-1.3.0/tests/lens-mailscanner.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-mailscanner.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-pgbouncer.sh augeas-1.4.0/tests/lens-pgbouncer.sh --- augeas-1.3.0/tests/lens-pgbouncer.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-pgbouncer.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-postfix_sasl_smtpd.sh augeas-1.4.0/tests/lens-postfix_sasl_smtpd.sh --- augeas-1.3.0/tests/lens-postfix_sasl_smtpd.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-postfix_sasl_smtpd.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-puppetfile.sh augeas-1.4.0/tests/lens-puppetfile.sh --- augeas-1.3.0/tests/lens-puppetfile.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-puppetfile.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/lens-pylonspaste.sh augeas-1.4.0/tests/lens-pylonspaste.sh --- augeas-1.3.0/tests/lens-pylonspaste.sh 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/lens-pylonspaste.sh 2015-05-21 19:34:56.000000000 +0000 @@ -0,0 +1,16 @@ +#! /bin/sh +# Run one lens test. +# Derive names of inputs from the name of this script. + +[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR +LENS_DIR=$abs_top_srcdir/lenses + +me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'` + +t=$LENS_DIR/tests/test_$me.aug + +if [ -n "$VALGRIND" ] ; then + exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t" +else + exec augparse --nostdinc -I "$LENS_DIR" "$t" +fi diff -Nru augeas-1.3.0/tests/Makefile.am augeas-1.4.0/tests/Makefile.am --- augeas-1.3.0/tests/Makefile.am 2014-10-17 16:41:03.000000000 +0000 +++ augeas-1.4.0/tests/Makefile.am 2015-05-22 22:31:25.000000000 +0000 @@ -20,6 +20,7 @@ lens-access.sh \ lens-activemq_conf.sh \ lens-activemq_xml.sh \ + lens-afs_cellalias.sh \ lens-aliases.sh \ lens-anacron.sh \ lens-approx.sh \ @@ -42,6 +43,7 @@ lens-cgrules.sh \ lens-channels.sh \ lens-chrony.sh \ + lens-clamav.sh \ lens-cobblersettings.sh \ lens-cobblermodules.sh \ lens-collectd.sh \ @@ -56,6 +58,7 @@ lens-device_map.sh \ lens-dhclient.sh \ lens-dhcpd.sh \ + lens-dns_zone.sh \ lens-dnsmasq.sh \ lens-dovecot.sh \ lens-dpkg.sh \ @@ -85,6 +88,7 @@ lens-interfaces.sh \ lens-iptables.sh \ lens-iproute2.sh \ + lens-iscsid.sh \ lens-jettyrealm.sh \ lens-jmxaccess.sh \ lens-jmxpassword.sh \ @@ -104,6 +108,8 @@ lens-logwatch.sh \ lens-lokkit.sh \ lens-lvm.sh \ + lens-mailscanner.sh \ + lens-mailscanner_rules.sh \ lens-mcollective.sh \ lens-mdadm_conf.sh \ lens-memcached.sh \ @@ -136,11 +142,13 @@ lens-passwd.sh \ lens-pbuilder.sh \ lens-pg_hba.sh \ + lens-pgbouncer.sh \ lens-php.sh \ lens-phpvars.sh \ lens-postfix_access.sh \ lens-postfix_main.sh \ lens-postfix_master.sh \ + lens-postfix_sasl_smtpd.sh \ lens-postfix_transport.sh \ lens-postfix_virtual.sh \ lens-postgresql.sh \ @@ -148,7 +156,9 @@ lens-protocols.sh \ lens-puppet.sh \ lens-puppet_auth.sh \ + lens-puppetfile.sh \ lens-puppetfileserver.sh \ + lens-pylonspaste.sh \ lens-pythonpaste.sh \ lens-qpid.sh \ lens-quote.sh \ diff -Nru augeas-1.3.0/tests/Makefile.in augeas-1.4.0/tests/Makefile.in --- augeas-1.3.0/tests/Makefile.in 2014-11-07 22:31:56.000000000 +0000 +++ augeas-1.4.0/tests/Makefile.in 2015-06-02 00:23:21.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -1389,6 +1389,7 @@ lens-access.sh \ lens-activemq_conf.sh \ lens-activemq_xml.sh \ + lens-afs_cellalias.sh \ lens-aliases.sh \ lens-anacron.sh \ lens-approx.sh \ @@ -1411,6 +1412,7 @@ lens-cgrules.sh \ lens-channels.sh \ lens-chrony.sh \ + lens-clamav.sh \ lens-cobblersettings.sh \ lens-cobblermodules.sh \ lens-collectd.sh \ @@ -1425,6 +1427,7 @@ lens-device_map.sh \ lens-dhclient.sh \ lens-dhcpd.sh \ + lens-dns_zone.sh \ lens-dnsmasq.sh \ lens-dovecot.sh \ lens-dpkg.sh \ @@ -1454,6 +1457,7 @@ lens-interfaces.sh \ lens-iptables.sh \ lens-iproute2.sh \ + lens-iscsid.sh \ lens-jettyrealm.sh \ lens-jmxaccess.sh \ lens-jmxpassword.sh \ @@ -1473,6 +1477,8 @@ lens-logwatch.sh \ lens-lokkit.sh \ lens-lvm.sh \ + lens-mailscanner.sh \ + lens-mailscanner_rules.sh \ lens-mcollective.sh \ lens-mdadm_conf.sh \ lens-memcached.sh \ @@ -1505,11 +1511,13 @@ lens-passwd.sh \ lens-pbuilder.sh \ lens-pg_hba.sh \ + lens-pgbouncer.sh \ lens-php.sh \ lens-phpvars.sh \ lens-postfix_access.sh \ lens-postfix_main.sh \ lens-postfix_master.sh \ + lens-postfix_sasl_smtpd.sh \ lens-postfix_transport.sh \ lens-postfix_virtual.sh \ lens-postgresql.sh \ @@ -1517,7 +1525,9 @@ lens-protocols.sh \ lens-puppet.sh \ lens-puppet_auth.sh \ + lens-puppetfile.sh \ lens-puppetfileserver.sh \ + lens-pylonspaste.sh \ lens-pythonpaste.sh \ lens-qpid.sh \ lens-quote.sh \ @@ -1720,14 +1730,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -1984,6 +1994,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-afs_cellalias.sh.log: lens-afs_cellalias.sh + @p='lens-afs_cellalias.sh'; \ + b='lens-afs_cellalias.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) lens-aliases.sh.log: lens-aliases.sh @p='lens-aliases.sh'; \ b='lens-aliases.sh'; \ @@ -2138,6 +2155,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-clamav.sh.log: lens-clamav.sh + @p='lens-clamav.sh'; \ + b='lens-clamav.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) lens-cobblersettings.sh.log: lens-cobblersettings.sh @p='lens-cobblersettings.sh'; \ b='lens-cobblersettings.sh'; \ @@ -2236,6 +2260,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-dns_zone.sh.log: lens-dns_zone.sh + @p='lens-dns_zone.sh'; \ + b='lens-dns_zone.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) lens-dnsmasq.sh.log: lens-dnsmasq.sh @p='lens-dnsmasq.sh'; \ b='lens-dnsmasq.sh'; \ @@ -2439,6 +2470,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-iscsid.sh.log: lens-iscsid.sh + @p='lens-iscsid.sh'; \ + b='lens-iscsid.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) lens-jettyrealm.sh.log: lens-jettyrealm.sh @p='lens-jettyrealm.sh'; \ b='lens-jettyrealm.sh'; \ @@ -2572,6 +2610,20 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-mailscanner.sh.log: lens-mailscanner.sh + @p='lens-mailscanner.sh'; \ + b='lens-mailscanner.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-mailscanner_rules.sh.log: lens-mailscanner_rules.sh + @p='lens-mailscanner_rules.sh'; \ + b='lens-mailscanner_rules.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) lens-mcollective.sh.log: lens-mcollective.sh @p='lens-mcollective.sh'; \ b='lens-mcollective.sh'; \ @@ -2796,6 +2848,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-pgbouncer.sh.log: lens-pgbouncer.sh + @p='lens-pgbouncer.sh'; \ + b='lens-pgbouncer.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) lens-php.sh.log: lens-php.sh @p='lens-php.sh'; \ b='lens-php.sh'; \ @@ -2831,6 +2890,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-postfix_sasl_smtpd.sh.log: lens-postfix_sasl_smtpd.sh + @p='lens-postfix_sasl_smtpd.sh'; \ + b='lens-postfix_sasl_smtpd.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) lens-postfix_transport.sh.log: lens-postfix_transport.sh @p='lens-postfix_transport.sh'; \ b='lens-postfix_transport.sh'; \ @@ -2880,12 +2946,26 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-puppetfile.sh.log: lens-puppetfile.sh + @p='lens-puppetfile.sh'; \ + b='lens-puppetfile.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) lens-puppetfileserver.sh.log: lens-puppetfileserver.sh @p='lens-puppetfileserver.sh'; \ b='lens-puppetfileserver.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +lens-pylonspaste.sh.log: lens-pylonspaste.sh + @p='lens-pylonspaste.sh'; \ + b='lens-pylonspaste.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) lens-pythonpaste.sh.log: lens-pythonpaste.sh @p='lens-pythonpaste.sh'; \ diff -Nru augeas-1.3.0/tests/root/etc/httpd/conf.d/ssl.conf augeas-1.4.0/tests/root/etc/httpd/conf.d/ssl.conf --- augeas-1.3.0/tests/root/etc/httpd/conf.d/ssl.conf 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/root/etc/httpd/conf.d/ssl.conf 2015-06-01 23:16:17.000000000 +0000 @@ -0,0 +1,222 @@ +# +# This is the Apache server configuration file providing SSL support. +# It contains the configuration directives to instruct the server how to +# serve pages over an https connection. For detailing information about these +# directives see +# +# Do NOT simply read the instructions in here without understanding +# what they do. They're here only as hints or reminders. If you are unsure +# consult the online docs. You have been warned. +# + +LoadModule ssl_module modules/mod_ssl.so + +# +# When we also provide SSL we have to listen to the +# the HTTPS port in addition. +# +Listen 443 + +## +## SSL Global Context +## +## All SSL configuration in this context applies both to +## the main server and all SSL-enabled virtual hosts. +## + +# Pass Phrase Dialog: +# Configure the pass phrase gathering process. +# The filtering dialog program (`builtin' is a internal +# terminal dialog) has to provide the pass phrase on stdout. +SSLPassPhraseDialog builtin + +# Inter-Process Session Cache: +# Configure the SSL Session Cache: First the mechanism +# to use and second the expiring timeout (in seconds). +SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000) +SSLSessionCacheTimeout 300 + +# Semaphore: +# Configure the path to the mutual exclusion semaphore the +# SSL engine uses internally for inter-process synchronization. +SSLMutex default + +# Pseudo Random Number Generator (PRNG): +# Configure one or more sources to seed the PRNG of the +# SSL library. The seed data should be of good random quality. +# WARNING! On some platforms /dev/random blocks if not enough entropy +# is available. This means you then cannot use the /dev/random device +# because it would lead to very long connection times (as long as +# it requires to make more entropy available). But usually those +# platforms additionally provide a /dev/urandom device which doesn't +# block. So, if available, use this one instead. Read the mod_ssl User +# Manual for more details. +SSLRandomSeed startup file:/dev/urandom 256 +SSLRandomSeed connect builtin +#SSLRandomSeed startup file:/dev/random 512 +#SSLRandomSeed connect file:/dev/random 512 +#SSLRandomSeed connect file:/dev/urandom 512 + +# +# Use "SSLCryptoDevice" to enable any supported hardware +# accelerators. Use "openssl engine -v" to list supported +# engine names. NOTE: If you enable an accelerator and the +# server does not start, consult the error logs and ensure +# your accelerator is functioning properly. +# +SSLCryptoDevice builtin +#SSLCryptoDevice ubsec + +## +## SSL Virtual Host Context +## + + + +# General setup for the virtual host, inherited from global configuration +#DocumentRoot "/var/www/html" +#ServerName www.example.com:443 + +# Use separate log files for the SSL virtual host; note that LogLevel +# is not inherited from httpd.conf. +ErrorLog logs/ssl_error_log +TransferLog logs/ssl_access_log +LogLevel warn + +# SSL Engine Switch: +# Enable/Disable SSL for this virtual host. +SSLEngine on + +# SSL Protocol support: +# List the enable protocol levels with which clients will be able to +# connect. Disable SSLv2 access by default: +SSLProtocol all -SSLv2 + +# SSL Cipher Suite: +# List the ciphers that the client is permitted to negotiate. +# See the mod_ssl documentation for a complete list. +SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW + +# Server Certificate: +# Point SSLCertificateFile at a PEM encoded certificate. If +# the certificate is encrypted, then you will be prompted for a +# pass phrase. Note that a kill -HUP will prompt again. A new +# certificate can be generated using the genkey(1) command. +SSLCertificateFile /etc/pki/tls/certs/localhost.crt + +# Server Private Key: +# If the key is not combined with the certificate, use this +# directive to point at the key file. Keep in mind that if +# you've both a RSA and a DSA private key you can configure +# both in parallel (to also allow the use of DSA ciphers, etc.) +SSLCertificateKeyFile /etc/pki/tls/private/localhost.key + +# Server Certificate Chain: +# Point SSLCertificateChainFile at a file containing the +# concatenation of PEM encoded CA certificates which form the +# certificate chain for the server certificate. Alternatively +# the referenced file can be the same as SSLCertificateFile +# when the CA certificates are directly appended to the server +# certificate for convinience. +#SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt + +# Certificate Authority (CA): +# Set the CA certificate verification path where to find CA +# certificates for client authentication or alternatively one +# huge file containing all of them (file must be PEM encoded) +#SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt + +# Client Authentication (Type): +# Client certificate verification type and depth. Types are +# none, optional, require and optional_no_ca. Depth is a +# number which specifies how deeply to verify the certificate +# issuer chain before deciding the certificate is not valid. +#SSLVerifyClient require +#SSLVerifyDepth 10 + +# Access Control: +# With SSLRequire you can do per-directory access control based +# on arbitrary complex boolean expressions containing server +# variable checks and other lookup directives. The syntax is a +# mixture between C and Perl. See the mod_ssl documentation +# for more details. +# +#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ +# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \ +# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \ +# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \ +# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \ +# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/ +# + +# SSL Engine Options: +# Set various options for the SSL engine. +# o FakeBasicAuth: +# Translate the client X.509 into a Basic Authorisation. This means that +# the standard Auth/DBMAuth methods can be used for access control. The +# user name is the `one line' version of the client's X.509 certificate. +# Note that no password is obtained from the user. Every entry in the user +# file needs this password: `xxj31ZMTZzkVA'. +# o ExportCertData: +# This exports two additional environment variables: SSL_CLIENT_CERT and +# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the +# server (always existing) and the client (only existing when client +# authentication is used). This can be used to import the certificates +# into CGI scripts. +# o StdEnvVars: +# This exports the standard SSL/TLS related `SSL_*' environment variables. +# Per default this exportation is switched off for performance reasons, +# because the extraction step is an expensive operation and is usually +# useless for serving static content. So one usually enables the +# exportation for CGI and SSI requests only. +# o StrictRequire: +# This denies access when "SSLRequireSSL" or "SSLRequire" applied even +# under a "Satisfy any" situation, i.e. when it applies access is denied +# and no other module can change it. +# o OptRenegotiate: +# This enables optimized SSL connection renegotiation handling when SSL +# directives are used in per-directory context. +#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + +# SSL Protocol Adjustments: +# The safe and default but still SSL/TLS standard compliant shutdown +# approach is that mod_ssl sends the close notify alert but doesn't wait for +# the close notify alert from client. When you need a different shutdown +# approach you can use one of the following variables: +# o ssl-unclean-shutdown: +# This forces an unclean shutdown when the connection is closed, i.e. no +# SSL close notify alert is send or allowed to received. This violates +# the SSL/TLS standard but is needed for some brain-dead browsers. Use +# this when you receive I/O errors because of the standard approach where +# mod_ssl sends the close notify alert. +# o ssl-accurate-shutdown: +# This forces an accurate shutdown when the connection is closed, i.e. a +# SSL close notify alert is send and mod_ssl waits for the close notify +# alert of the client. This is 100% SSL/TLS standard compliant, but in +# practice often causes hanging connections with brain-dead browsers. Use +# this only for browsers where you know that their SSL implementation +# works correctly. +# Notice: Most problems of broken clients are also related to the HTTP +# keep-alive facility, so you usually additionally want to disable +# keep-alive for those clients, too. Use variable "nokeepalive" for this. +# Similarly, one has to force some clients to use HTTP/1.0 to workaround +# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and +# "force-response-1.0" for this. +SetEnvIf User-Agent ".*MSIE.*" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + +# Per-Server Logging: +# The home of a custom SSL log file. Use this when you want a +# compact non-error SSL logfile on a virtual host basis. +CustomLog logs/ssl_request_log \ + "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" + + + diff -Nru augeas-1.3.0/tests/root/etc/nginx/nginx.conf augeas-1.4.0/tests/root/etc/nginx/nginx.conf --- augeas-1.3.0/tests/root/etc/nginx/nginx.conf 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/root/etc/nginx/nginx.conf 2015-06-01 22:03:07.000000000 +0000 @@ -0,0 +1,117 @@ + +user nobody; +worker_processes 1; + +error_log logs/error.log; +error_log logs/error.log notice; +error_log logs/error.log info; + +pid logs/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log logs/access.log main; + + sendfile on; + tcp_nopush on; + + keepalive_timeout 0; + keepalive_timeout 65; + + gzip on; + + server { + listen 80; + server_name localhost; + + charset koi8-r; + + access_log logs/host.access.log main; + + location / { + root html; + index index.html index.htm; + } + + error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + + location ~ \.php$ { + proxy_pass http://127.0.0.1; + } + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + location ~ \.php$ { + root html; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + include fastcgi_params; + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + location ~ /\.ht { + deny all; + } + } + + + # another virtual host using mix of IP-, name-, and port-based configuration + + server { + listen 8000; + listen somename:8080; + server_name somename alias another.alias; + + location / { + root html; + index index.html index.htm; + } + } + + + # HTTPS server + # + server { + listen 443 ssl; + server_name localhost; + + ssl_certificate cert.pem; + ssl_certificate_key cert.key; + + ssl_session_cache shared:SSL:1m; + ssl_session_timeout 5m; + + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + location / { + root html; + index index.html index.htm; + } + } + +} diff -Nru augeas-1.3.0/tests/root/test.txt~ augeas-1.4.0/tests/root/test.txt~ --- augeas-1.3.0/tests/root/test.txt~ 1970-01-01 00:00:00.000000000 +0000 +++ augeas-1.4.0/tests/root/test.txt~ 2015-03-04 00:36:48.000000000 +0000 @@ -0,0 +1,2 @@ + +VAR="test" diff -Nru augeas-1.3.0/tests/run.tests augeas-1.4.0/tests/run.tests --- augeas-1.3.0/tests/run.tests 2012-11-02 15:20:12.000000000 +0000 +++ augeas-1.4.0/tests/run.tests 2015-05-22 22:31:25.000000000 +0000 @@ -440,13 +440,13 @@ set /white\ space/\[section value print /white\ space/\[section prints - /white space/[section = "value" + /white\ space/\[section = "value" test set-squote-escaped-bracket 2 set '/augeas/\[section' value print '/augeas/\[section' prints - /augeas/[section = "value" + /augeas/\[section = "value" test set-squote-escaped-path 2 set '/white\ space' value diff -Nru augeas-1.3.0/tests/test-api.c augeas-1.4.0/tests/test-api.c --- augeas-1.3.0/tests/test-api.c 2013-08-28 18:29:27.000000000 +0000 +++ augeas-1.4.0/tests/test-api.c 2015-05-22 22:31:25.000000000 +0000 @@ -625,6 +625,23 @@ CuAssertStrEquals(tc, hosts, hosts_out); } +static void testAugEscape(CuTest *tc) { + static const char *const in = "a/[]b|=c()!, \td"; + static const char *const exp = "a\\/\\[\\]b\\|\\=c\\(\\)\\!\\,\\ \\\td"; + char *out; + struct augeas *aug; + int r; + + aug = aug_init(root, loadpath, AUG_NO_STDINC|AUG_NO_LOAD); + CuAssertPtrNotNull(tc, aug); + + r = aug_escape_name(aug, in, &out); + CuAssertRetSuccess(tc, r); + + CuAssertStrEquals(tc, out, exp); + free(out); +} + int main(void) { char *output = NULL; CuSuite* suite = CuSuiteNew(); @@ -643,6 +660,7 @@ SUITE_ADD_TEST(suite, testToXml); SUITE_ADD_TEST(suite, testTextStore); SUITE_ADD_TEST(suite, testTextRetrieve); + SUITE_ADD_TEST(suite, testAugEscape); abs_top_srcdir = getenv("abs_top_srcdir"); if (abs_top_srcdir == NULL) diff -Nru augeas-1.3.0/tests/test-put-symlink-augsave.sh augeas-1.4.0/tests/test-put-symlink-augsave.sh --- augeas-1.3.0/tests/test-put-symlink-augsave.sh 2014-01-27 10:36:08.000000000 +0000 +++ augeas-1.4.0/tests/test-put-symlink-augsave.sh 2015-06-01 22:03:07.000000000 +0000 @@ -17,7 +17,7 @@ cat < $HOSTS 127.0.0.1 localhost EOF -HOSTS_SUM=$(sum $HOSTS) +HOSTS_SUM=$(sum $HOSTS | cut -d ' ' -f 1) touch $ATTACK_FILE (cd $(dirname $HOSTS) && ln -s ../other/attack $(basename $HOSTS).augsave) @@ -37,7 +37,7 @@ exit 1 fi -if [ ! "x${HOSTS_SUM}" = "x$(sum $HOSTS_AUGSAVE)" ]; then +if [ ! "x${HOSTS_SUM}" = "x$(sum $HOSTS_AUGSAVE | cut -d ' ' -f 1)" ]; then echo "/etc/hosts.augsave has changed from the original /etc/hosts" exit 1 fi diff -Nru augeas-1.3.0/tests/test-save.c augeas-1.4.0/tests/test-save.c --- augeas-1.3.0/tests/test-save.c 2014-11-07 23:14:09.000000000 +0000 +++ augeas-1.4.0/tests/test-save.c 2015-06-02 00:07:01.000000000 +0000 @@ -296,6 +296,86 @@ testUmask(tc, 0022, 0644); } +/* Test that handling of 'strange' characters in path names works as + * expected. In particular, that paths with characters that have special + * meaning in path expressions are escaped properly. + * + * This test isn't all that specific to save, but since these tests set up + * a copy of tests/root/ that is modifiable, it was convenient to put this + * test here. + */ +static void testPathEscaping(CuTest *tc) { + /* Path expression with characters escaped */ + static const char *const weird = + "/files/etc/sysconfig/network-scripts/ifcfg-weird\\ \\[\\!\\]\\ \\(used\\ to\\ fail\\)"; + /* Path without any escaping */ + static const char *const weird_no_escape = + "/files/etc/sysconfig/network-scripts/ifcfg-weird [!] (used to fail)"; + + char *fname = NULL, *s = NULL; + const char *v; + int r; + + /* Construct the file name in the file system and check the file is there */ + r = asprintf(&fname, "%s%s", root, weird_no_escape + strlen("/files")); + CuAssertPositive(tc, r); + + r = access(fname, R_OK); + CuAssertIntEquals(tc, 0, r); + + /* Make sure weird is in the tree */ + r = aug_match(aug, weird, NULL); + CuAssertIntEquals(tc, 1, r); + + /* Make sure we can get to the metadata about weird */ + r = asprintf(&s, "/augeas%s/path", weird); + CuAssertPositive(tc, r); + + r = aug_get(aug, s, &v); + CuAssertIntEquals(tc, 1, r); + CuAssertStrEquals(tc, weird_no_escape, v); + + /* Delete it from the tree and save it; make sure it gets removed + from the file system */ + r = aug_rm(aug, weird); + CuAssertPositive(tc, r); + + r = aug_save(aug); + CuAssertRetSuccess(tc, r); + + r = access(fname, R_OK); + CuAssertIntEquals(tc, -1, r); + CuAssertIntEquals(tc, ENOENT, errno); +} + +/* Test that we handle failure to save a file because we lack permission on + * the target file is handled gracefully. + * + * As reported in https://github.com/hercules-team/augeas/issues/178, this + * used to lead to a SEGV + */ +static void testSaveNoPermission(CuTest *tc) { + int r; + char *path = NULL; + const char *v; + + r = asprintf(&path, "%s/etc/hosts", root); + CuAssertPositive(tc, r); + + r = aug_set(aug, "/files/etc/hosts/1/alias[1]", "othername"); + CuAssertRetSuccess(tc, r); + + r = chmod(path, 0); + CuAssertRetSuccess(tc, r); + + r = aug_save(aug); + CuAssertIntEquals(tc, -1, r); + + r = aug_get(aug, "/augeas/files/etc/hosts/error", &v); + CuAssertIntEquals(tc, 1, r); + CuAssertStrEquals(tc, "replace_from_missing", v); +} + int main(void) { char *output = NULL; CuSuite* suite = CuSuiteNew(); @@ -314,6 +394,7 @@ CuSuiteSetup(suite, setup, teardown); + SUITE_ADD_TEST(suite, testSaveNoPermission); SUITE_ADD_TEST(suite, testSaveNewFile); SUITE_ADD_TEST(suite, testRemoveNoPermission); SUITE_ADD_TEST(suite, testNonExistentLens); @@ -324,6 +405,7 @@ SUITE_ADD_TEST(suite, testUmask077); SUITE_ADD_TEST(suite, testUmask027); SUITE_ADD_TEST(suite, testUmask022); + SUITE_ADD_TEST(suite, testPathEscaping); CuSuiteRun(suite); CuSuiteSummary(suite, &output); diff -Nru augeas-1.3.0/tests/xpath.tests augeas-1.4.0/tests/xpath.tests --- augeas-1.3.0/tests/xpath.tests 2012-11-21 00:14:39.000000000 +0000 +++ augeas-1.4.0/tests/xpath.tests 2015-05-22 22:31:25.000000000 +0000 @@ -278,7 +278,7 @@ # Paths with whitespace in them test php1 $php/mail function - /files/etc/php.ini/mail function + /files/etc/php.ini/mail\ function test php2 $php[mail function] /files/etc/php.ini @@ -287,10 +287,10 @@ /files/etc/php.ini test php4 $php/mail function/SMTP - /files/etc/php.ini/mail function/SMTP = localhost + /files/etc/php.ini/mail\ function/SMTP = localhost test php5 $php/mail\ function - /files/etc/php.ini/mail function + /files/etc/php.ini/mail\ function test expr-or /files/etc/group/root/*[self::gid or self::user] /files/etc/group/root/gid = 0 @@ -315,3 +315,19 @@ test ctx_file_pred etc/network/interfaces/iface[. = "lo"] /files/etc/network/interfaces/iface[1] = lo + +# Test matching with characters that need escaping in the filename +test escape1 /files/etc/sysconfig/network-scripts/* + /files/etc/sysconfig/network-scripts/ifcfg-eth0 + /files/etc/sysconfig/network-scripts/ifcfg-wlan0 + /files/etc/sysconfig/network-scripts/ifcfg-weird\ \[\!\]\ \(used\ to\ fail\) + /files/etc/sysconfig/network-scripts/ifcfg-Auto_FRITZ\!Box_Fon_WLAN_7112 + /files/etc/sysconfig/network-scripts/ifcfg-lo + /files/etc/sysconfig/network-scripts/ifcfg-Auto-ALICE-WLAN38_\(automatisch\) + /files/etc/sysconfig/network-scripts/ifcfg-br0 + +test escape2 /files/etc/sysconfig/network-scripts/ifcfg-weird\ \[\!\]\ \(used\ to\ fail\)/DEVICE + /files/etc/sysconfig/network-scripts/ifcfg-weird\ \[\!\]\ \(used\ to\ fail\)/DEVICE = weird + +test escape3 /files/etc/sysconfig/network-scripts/*[DEVICE = 'weird'] + /files/etc/sysconfig/network-scripts/ifcfg-weird\ \[\!\]\ \(used\ to\ fail\)