Skip to content

Seven SQLite openers still hand-build file: URIs (special characters / Windows paths) #1883

Closed

Description

@AbirAbbas

Follow-up from #1868. That PR routes the graph, automation, collection and plan-preview openers through sqliteuri.File, but seven production openers still build SQLite URIs by string concatenation:

Where Construction
internal/plandb/persist.go:222 (writer) "file:" + filepath.ToSlash(path) + txlock/busy pragmas
internal/plandb/persist.go:250 (read handle) "file:" + filepath.ToSlash(path) + busy pragma
internal/session/plandb_tasks.go:608 (planSpendBySeat) "file:" + path + "?mode=ro"
internal/session/plandb_tasks.go:917 (planSpendByTask) same
internal/session/plandb_tasks.go:951 (planUsageByTask) same
bench/bashloop/door.go:345 "file:" + dbPath + "?mode=ro"
bench/bashloop/door.go:469 same

Because nothing is escaped, a plan path containing #, ? or % opens a different file. For example, a store at plan%23.db is written somewhere other than the requested filename. This reproduces on current dev with a small probe against the plandb writer. The internal/session ones also pass raw Windows backslash paths. It predates #1868 and isn't a regression from it.

Suggested fix: switch these to sqliteuri.File(path) and set RawQuery from url.Values, as #1868 does for the others, plus a test that opens a store whose filename contains #&%.

Activity

  1. pav2345 commented on Oct 22, 2026

    @pav2345

    Dear Abir Abbas sir , Can I work on these issue sir ?

  2. santoshkumarradha commented on Oct 23, 2026

    @santoshkumarradha
    Member

    Rechecked on current dev (39fdbea6f73c): still reproducible. A disposable internal/plandb probe called Open with a filename plan%23.db, then closed the store. The requested filename did not exist; plan#.db existed instead. No model or personal data was used. The current writer/read DSNs still concatenate the unescaped path. Keeping open; no active linked fix PR or assignee found in this audit.

  3. pav2345 commented on Oct 23, 2026

    @pav2345

    Dear Santosh Sir,

    Thank you for fixing this issue! I’m always eager to learn and contribute to CodeAF. Please feel free to assign me any similar tasks. I’d be happy to learn from you and the community!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions