Skip to content

Bug: doctor reports an unreadable install state as unowned #437

Closed

Description

@barbatdev

Summary

doctor --target-dir reports ownership=unowned with exit 0 when the target's .cortex/install-state.json exists but cannot be read.

Reproduction

  1. Create a directory target with .cortex/install-state.json set to mode 0000, running as a non-root user.
  2. Run cortex doctor --target-dir <dir>.

Expected

An unreadable ownership record is reported as invalid, not as absent. Only a missing file means unowned.

Actual

exit=0 out="target=<dir> presence=present writability=writable ownership=unowned"

Environment

main at 46f2870, macOS, non-root user. As root the file stays readable, so it does not reproduce.

Evidence

internal/cli/doctor.go:169-172 maps every os.ReadFile error, including permission denied, to unowned. Found while verifying #360, #365 and #366. No test on main covers it. Fix: fs.ErrNotExist gives unowned, any other error gives invalid, with a CLI test using chmod 000.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions