fix(state): let sqlite raise the canonical error for a directory db_path
The owner-only pre-create helper ran before sqlite3.connect() and turned a directory-as-state.db misconfiguration into IsADirectoryError instead of the sqlite OperationalError the open path (and its lock-patience classifier) expects. A directory leaks no row data, so skip it and let sqlite fail canonically. Also map the salvage carry-commit author email for the attribution gate.
This commit is contained in:
1
contributors/emails/hermes-fleet-fix@localhost
Normal file
1
contributors/emails/hermes-fleet-fix@localhost
Normal file
@@ -0,0 +1 @@
|
||||
rohitsabu
|
||||
@@ -248,6 +248,10 @@ def _secure_state_db_files(db_path: Path, *, create_main: bool = False) -> None:
|
||||
fd = os.open(path, flags, 0o600)
|
||||
except FileNotFoundError:
|
||||
continue
|
||||
except IsADirectoryError:
|
||||
# Not a database file at all; sqlite3.connect() raises the
|
||||
# canonical error for this, and a directory leaks no row data.
|
||||
continue
|
||||
try:
|
||||
os.fchmod(fd, 0o600)
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user