Skip to content

Simulate mode: MakeHardLink() asserts on a relative source and leaks chroot_to on link() failure #67

Open

Description

@djbclark

In simulate mode, VerifyHardLink() builds a relative to as ./x (libpromises/files_links.c:386-388) and passes it to MakeHardLink(), which still calls ToChangesChroot(to) unconditionally (files_links.c:639-643). A relative hard-link source therefore trips assert(IsAbsPath(...)) in ToChangesChroot() on --enable-debug builds. MakeHardLink() also leaks chroot_to on the link() failure path (files_links.c:652-657).

Both are pre-existing on upstream/master (5ac9805); found in the adversary review of the relative-symlink fix (#66), which deliberately leaves the hard-link path alone because a relative hard-link source is relative to the cwd, not to the link. Needs its own test and a decision on what simulate should show for a relative hard-link source.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions