help-cfengine
[Top][All Lists]
Advanced

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

Re: Possible bug in AppendIfNoLineMatching under solaris 9?


From: mark
Subject: Re: Possible bug in AppendIfNoLineMatching under solaris 9?
Date: Thu, 1 May 2003 17:28:48 +0200 (MEST)

I'm afraid this is a typo that managed to come into 1.6.0. Sorry.

The problem is in edittools.c. Line 528 Should be:

      case AppendIfNoLineMatching:


               Debug("AppendIfNoLineMatching : %s\n",EDITBUFF);

               if (strcmp(EDITBUFF,"") == 0)
                  {
                  snprintf(OUTPUT,bufsize*2,"SetLine not set when calling 
AppendIfNoLineMatching %s\n",expdata);
                  CfLog(cferror,OUTPUT,"");
                  continue;
                  }

               if (strcmp(expdata,"ThisLine") == 0)
                  {
                  if (LocateNextItemMatching(filestart,EDITBUFF) == NULL)
                     {
                     AppendItem(&filestart,EDITBUFF,NULL);
                     }           

                  break;
                  }
               
               if (LocateNextItemMatching(filestart,expdata) == NULL)
                  {
                  AppendItem(&filestart,EDITBUFF,NULL);
                  }
               break;

Note EDITBUFF instead of expdata at the end.

M


On  1 May, Paul Dlug wrote:
> I have the following in my cfengine config:
> 
> any::
>     { /etc/mail/aliases
>       SetLine "root:$(tab)root_grp@ridge.aps.org"
>       AppendIfNoLineMatching "^root:[[:space:]]*root_grp@ridge.*"
>       DefineClasses newaliases
>     }
> 
> Under FreeBSD 4.8 with cfengine 2.0.3 this works and properly appends 
> "root:   root_grp@ridge.aps.org"
> 
> Under Solaris 9 with cfengine 2.0.6 this appends:
> ^root:[[:space:]]*root_grp@ridge.*
> 
> And will keep appending every time it runs.
> 
> This doesn't seem to be a problem on another solaris 9 host I have, 
> only difference being the above host with the problem is at a newer 
> patch revision. Both hosts are running the same build (built a package 
> of cfengine on the first host (one with the issue) and installed on the 
> other host (not having problems)).
> 
> Does anyone have any suggestions as to what may be wrong?
> 
> 
>  From cfagent -v -q:
> Begin editing /etc/mail/aliases
> Set current line to root:       root_grp@ridge.aps.org
> Appending [^root:[[:space:]]*root_grp@ridge.*]
> End editing /etc/mail/aliases
> 
> 
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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