Skip to content

Simulate mode as non-root drops a file from the change set when its promise sets an owner #29

Open

Description

@djbclark

Run as non-root with --simulate=manifest (and so --simulate-json), a files promise that creates a file and sets owners => { "root" } logs Cannot set ownership on file ... (chown: Operation not permitted) and Errors encountered when actuating files promise. The file then appears in neither the text manifest nor the JSON change set, and cf-agent exits 0. A root run would create the file.

The same policy without the owner change lists the file, with uid set to the invoking user; neither report says so.

Pre-existing: the JSON writer inherits it from the change records. Reproduced 2026-09-30 on macOS with a build of #27 (4c7d20e1a), using CFENGINE_TEST_OVERRIDE_WORKDIR.

Possible direction: one WARNING at the start of a non-root simulate run, next to the existing "All changes in files will be made in the ... chroot" warning. It would say that owners reflect the invoking user and that ownership changes cannot be simulated.

Activity

  1. djbclark commented on Sep 30, 2026

    @djbclark
    OwnerAuthor

    Decision (operator, 2026-09-30): add one WARNING at the start of a non-root simulate run, saying that owners reflect the invoking user and that ownership changes cannot be simulated. It covers the text report and the JSON alike. It goes in its own small PR together with this bug, not in #27.

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