bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

message "cfengine:: Appending" with Inform = ( on )


From: Maurice Bremond
Subject: message "cfengine:: Appending" with Inform = ( on )
Date: Wed, 15 Dec 2004 17:36:17 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hi, 

This little bug happens with cfengine-2.1.11, and the latest
cfengine-snapshot on solaris 8,9 and fedora 2 but it should happens on
all platforms.


cfagent with the short input below always prints the message :

cfengine:: Appending [emergency]

That message in this case is not supposed to be printed.

The message is not printed if the last action in the input file is not
editfiles:

The input is :

# -*- cfengine -*-

control: 

   any::

      Inform = ( on )

      actionsequence = ( 

         processes.emergency
         editfiles

         )

editfiles:

   me::

   { /etc/passwd

   LocateLineMatching "root"

   }


Looking in the code :

The message occurs with :
src/item.c:306

if (!PARSING && (ACTION == editfiles))
   {
   snprintf(OUTPUT,CF_BUFSIZE,"Appending [%s]\n",itemstring);
   CfLog(cfinform,OUTPUT,"");
   }

I understand the variable ACTION in this case is in the state of the last
action parsed, but it should be something like "none".

This little patch to src/parse.c corrects the behavior and works with
src/parse.c of the latest cfengine snapshot.

*** /scratch/tmp/cfengine-2.1.11/src/parse.c~   2004-10-26 16:20:41.000000000 
+0200
--- /scratch/tmp/cfengine-2.1.11/src/parse.c    2004-12-15 17:06:00.752323881 
+0100
***************
*** 80,85 ****
--- 80,85 ----
        }
     
     ParseFile(filename,sp);
+    ACTION=none;
     }
  
  for (ptr = VIMPORT; ptr != NULL; ptr=ptr->next)

Maurice Bremond

INRIA Rhône-Alpes
France


reply via email to

[Prev in Thread] Current Thread [Next in Thread]