I was testing out the functionality of body rename:

  files:

    "/tmp/foo"
        rename => moveit,
        action => immediate;

}

body rename moveit {
   newname => "moved";
}

It appears that nothing is done. A quick run through the debugger show
that it does indeed do nothing. Function of interest is VerifyName
(file_operators.c:927):

/* Normal disable - has priority */

if (attr.rename.disable)
   {
   char newname[CF_BUFSIZE];

   if (attr.rename.newname && strlen(attr.rename.newname) > 0)
      {
      if (IsAbsPath(attr.rename.newname))
         {
         strncpy(path,attr.rename.newname,CF_BUFSIZE-1);
         }
      else
         {
         strcpy(newname,path);
         ChopLastNode(newname);

         if (!JoinPath(newname,attr.rename.newname))
            {
            return;
            }
         }
      }

attr.rename.disable is not set as it is a rename, not a disable, so
the attr.rename.newname if clause is never activated.
   else
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to