According to the documentation, the following rule should remove the symbolic 
link if the target is not present, but it doesn't, it leaves the dead link. Is 
there a fix/work-around?

links:
    /usr/bin/brsh -> /bb/bin/brsh nofile=kill

Currently running version 2.1.21, and gone through link.c source code.  On line 
472, we have code:

if (!nofile)
  {
  if (stat(absto,&buf) == -1)
     {
     return(false);  /* no error warning, since the higher level routine uses 
this */
     }


Given that nofile=kill will result in nofile being set to 0, this condition is 
executed and since the symbolic link exists, it simply returns.

Later in the code on line 621, we have code

      if (!nofile)
         {
         KillOldLink(from,ptr->defines);      /* Check whether link points 
somewhere */
         return true;
         }

Which would remove this symlink if the target is present, but it never gets 
here.

Any help would be appreciated. Thanks - Jim


_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to