Skip to content

Cache directory validation rejects symlinks owned by other user #1717

Description

@wangvisual

Version

0.8.1

Platform

Linux (x64)

Install channel

go install

Binary variant

standard

What happened, and what did you expect?

When the home directory's .cache symlink points to a shared filesystem location owned by another user, codebase-memory-mcp fails to verify cache directory permissions during startup. This occurs even though the user has full read/write access to the actual cache directory.

Error:

Failed to connect to MCP server "codebase-memory": codebase-memory-mcp: exact executable identity could not be verified (cache-private) - /path/to/cache: ancestry component validation failed (errno 17)

Reproduction

  1. Setup:

    • User A has home directory /home/userA
    • Shared filesystem at /shared/fs owned by User B
    • User A's ~/.cache is symlinked to /shared/fs/userA/.cache
    • User A has rwx permissions on /shared/fs/userA/.cache and owns it
  2. Command:

    export CBM_CACHE_DIR="$HOME/.cache/codebase-memory-mcp"
    codebase-memory-mcp --version
  3. Expected:
    Should display version and proceed normally.

  4. Actual:
    Error: ancestry component validation failed (errno 17)
    The binary refuses to use the cache directory because parent directories are owned by a different user.

Logs

codebase-memory-mcp: exact executable identity could not be verified (cache-private) - /shared/fs/userA/.cache/codebase-memory-mcp: ancestry component validation failed (errno 17)

Diagnostics trajectory (memory / performance / leak issues)


Project scale (if relevant)

No response

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions