Skip to content

fix: tighten the sqlite config dir mode, anchor the profile regex, and close all thread connections - #714

Merged
ffumero2003 merged 2 commits into
masterfrom
fix-python-low-audit-sqlite-account-info
Nov 21, 2026
Merged

ffumero2003 merged 2 commits into
masterfrom
fix-python-low-audit-sqlite-account-info

Conversation

@ffumero2003

Copy link
Copy Markdown
Contributor

Context

Account-info profile validation accepts trailing path characters, newly created configuration directories are group/world accessible, and closing account info leaves other threads' cached SQLite connections open.

Changes

  • Require profile names to match the entire allowed pattern and create new B2 configuration directories with owner-only permissions.
  • Track per-thread SQLite connections and close them together; threads reopen a connection if they subsequently use the account info. Callers must finish using connections before calling close().
  • Add regression tests and a changelog fragment. Profile validation overlaps fix: anchor account info profile name validation #643 and should be reconciled before merging.

Verification

  • Reproduced each finding on master before the fix; the focused regressions now pass.
  • Full v3 unit suite: 1,257 passed, 77 skipped, 18 expected failures.
  • Account-info unit suites passed across v0–v3.
  • Ruff and towncrier checks passed.

Refs #711

@ffumero2003 ffumero2003 self-assigned this Nov 21, 2026
@ffumero2003
ffumero2003 requested a review from goanpeca November 21, 2026 22:49
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

SqliteAccountInfo now validates profile names with a full match, creates new XDG b2 directories with mode 0o700, and tracks SQLite connections across threads. Its close method closes all tracked connections, and a thread can obtain a replacement connection after closure. Tests cover path handling, connection replacement, and repeated closure. The changelog records these changes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@ffumero2003
ffumero2003 merged commit f6a2725 into master Nov 21, 2026
28 of 29 checks passed
@ffumero2003
ffumero2003 deleted the fix-python-low-audit-sqlite-account-info branch November 21, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant