Skip to content

Opening a read-only database makes it writable #520

Description

@kevintseng

What happens

If the database file is read-only (for example chmod 444 on a snapshot), the first memesh process that opens it changes its mode to 600. That process still cannot write (SQLite had already opened it read-only), but every later hook, CLI or MCP process opens it normally and writes into it.

Steps

  1. chmod 444 ~/.memesh/knowledge-graph.db (on a copy).
  2. Run any memesh command. The file mode is now 600.
  3. Run memesh remember "x". The write succeeds.

Expected

memesh never loosens the permissions of a file the user protected; it only tightens permissions that are more open than 600.

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

    needs-triageNot yet judged — the default entry point for a new issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions