Hi,

It looks to me like install.c and convinstall.c should be counting
levels of the new BeginGroups introduced in 2.1.18.

I'm not very familiar with the code, so I could very well be wrong
here.

A friend forwarded me a problem that he was having with 2.1.19p1, using
the following input:

#---------------------------------------
control:

    actionsequence = ( editfiles )
    sysadm         = ( [EMAIL PROTECTED] )
    smtpserver     = ( mail.example.com )
    domain         = ( example.com )

editfiles:

    linux::

        { /etc/sysconfig/rhn/up2date
            WarnIfFileMissing "up2date does not exist"
            BeginGroupIfLineMatching "useNoSSLForPackages=0"
               HashCommentLinesMatching "useNoSSLForPackages=0"
               InsertLine "## Line inserted by cfengine 9 Mar 2006"
               InsertLine "useNoSSLForPackages=1"
            EndGroup
            BeginGroupIfLineMatching "httpProxy="
               HashCommentLinesMatching "httpProxy="
               InsertLine "## Line inserted by cfengine 9 Mar 2006"
               InsertLine "httpProxy=squid.ems.psu.edu:3128"
            EndGroup
            BeginGroupIfLineMatching "enableProxy=0"
               HashCommentLinesMatching "enableProxy=0"
               InsertLine "## Line inserted by cfengine 9 Mar 2006"
               InsertLine "enableProxy=1"
            EndGroup
        }
#---------------------------------------


It would generate the following errors on RedHat Enterprise Linux
versions 3 and 4, cfengine-2.1.19p1:

cf:cfengine::.../cfagent.conf:1319: EndGroup without Begin
cf:cfengine::.../cfagent.conf:1324: EndGroup without Begin
cf:cfengine::.../cfagent.conf:1329: EndGroup without Begin
cf:cfengine::.../cfagent.conf:1330: Editfiles Begin/End mismatch before
or at line

I believe this is because install.c and convinstall.c are missing cases
for BeginGroupIfMatch, BeginGroupIfLineMatching, and
BeginGroupIfLineContaining in AddEditAction().

The following patch fixes his problem, though, so I thought I would
post the issue here.

Hope this is helpful.

-Scott
--------------------------------
Scott A. Woods
West Arete Computing, Inc.
http://westarete.com


diff -Naur src.old/convinstall.c src/convinstall.c
--- src.old/convinstall.c       Fri Mar 10 10:03:52 2006
+++ src/convinstall.c   Fri Mar 10 10:06:38 2006
@@ -2962,8 +2962,11 @@
                 }
              break;

+         case BeginGroupIfMatch:
          case BeginGroupIfNoMatch:
+         case BeginGroupIfLineMatching:
          case BeginGroupIfNoLineMatching:
+         case BeginGroupIfLineContaining:
          case BeginGroupIfNoLineContaining:
          case BeginGroupIfNoSuchLine:
          case BeginGroupIfDefined:
diff -Naur src.old/install.c src/install.c
--- src.old/install.c   Fri Mar 10 10:03:51 2006
+++ src/install.c       Fri Mar 10 10:06:20 2006
@@ -3068,8 +3068,11 @@
                 }
              break;

+         case BeginGroupIfMatch:
          case BeginGroupIfNoMatch:
+         case BeginGroupIfLineMatching:
          case BeginGroupIfNoLineMatching:
+         case BeginGroupIfLineContaining:
          case BeginGroupIfNoLineContaining:
          case BeginGroupIfNoSuchLine:
          case BeginGroupIfDefined:

_______________________________________________
Bug-cfengine mailing list
[EMAIL PROTECTED]
http://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to