Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1689

Failure to remove dangling symlink?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.5
    • Component/s: Promise type: files
    • Labels:
      None
    • Platform:
      Any
    • Found in version (details):
      3.6.1 RPM
    • Steps to reproduce:
      Acceptance/unit test attached

      Description

      Firstly the "known good" case:

      a. By whatever means is appropriate (e.g. "ln -s" command) create a symlink to a known good file.
      b. Create and run a CFE policy to remove that symlink, using the CFE 3.6.x "body delete tidy".
      c. Verify that the symlink has gone.

      Now the suspect case. Repeat the above, but in step 'a' make the symlink point to something known to be non-existent (so we have a dangling symlink).

      After the policy is run, the symlink, which should have been removed, still seems to be present. The policy (via "body delete tidy" at least) seems to fail to remove dangling symlinks.

      Bug? Might a "stat" in "evaluation" be looking at the link's (non-existent) target rather than at the link itself?

      (Because this involves both shell and CFE policy, I'm not sure how to wrap this up into a one-shot test/demo case for you.)

      See also #6849 for more test cases.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10040 Kristian Amlie
                Reporter:
                davidlee David Lee
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel