Skip to content

v0.4.2 - scope-mode bugfixes

Choose a tag to compare

@magnattic magnattic released this 30 Apr 11:44
· 1 commit to main since this release

Bugfix release over v0.4.1 — five critical scope-mode bugs surfaced by an internal review, plus robustness hardening.

Critical fixes

  • kpxc get exited 1 on success. Missing exit 0 in dispatch.
  • fzf picker emitted bare entry titles instead of full paths. Children of nested groups lost their parent context. Switched keepassxc-cli ls -R to -Rf.
  • Scope spec parser word-split paths with spaces (Email/My Personal was split into two args). Rewritten as a stdin-based parser.
  • : was treated as path/field separator inside scope-file lines, but KeePass entry titles can legitimately contain :. Breaking: in-line separator is now a literal TAB. See migration below.
  • Scope-mode positive tests silently masked failures. They used "$(kpxc get …)" which only captures stdout; non-zero exit codes and stderr warnings vanished. New check_clean helper asserts exit 0, empty stderr, and matching stdout.

Robustness

  • kpxc lock refuses to remove the cache directory if it contains files other than master/scoped (defends against collisions on a shared /dev/shm).
  • Refuse early if $KPXC_CACHE is a symlink or non-directory.
  • Detect mixed picker selection (the "all entries" sentinel marked alongside real entries).
  • Explicit conflict detection for incompatible flag combos (--master + --interactive, --master + scope args, --interactive + scope args).

Other

  • -i shortcut for --interactive.
  • Migration warning: _load_scope_file detects likely legacy :-separator lines and prints a one-time hint to stderr.
  • README documents the TAB-separated scope-file syntax + adds an "Upgrading from v0.4.1" section.

Migration from v0.4.1

The scope file's in-line separator changed from : to TAB. Default-field entries (Email/personal with no field suffix) carry over unchanged. Entries with explicit fields need updating:

# v0.4.1
Email/personal:Username

# v0.4.2
Email/personal	Username    # literal TAB before "Username"

Easiest: kpxc unlock --interactive regenerates the scope file in the new format. Or hand-edit ~/.config/kpxc/scope.

kpxc will print a one-time warning if it detects likely legacy lines.

Test suite

62 integration tests, all green. Test fixtures cover entries with spaces, entries with : in the title, multi-field TAB-separated scope lines, comment stripping, the legacy-format migration warning (positive + false-positive checks), and the lock-with-stray-files refusal.