Page MenuHomeFreeBSD

db/hash.c: Do not return an error when opening a missing database with O_CREAT
ClosedPublic

Authored by bnovkov on Jul 24 2025, 3:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 24, 7:55 AM
Unknown Object (File)
Oct 13 2025, 12:28 PM
Unknown Object (File)
Oct 13 2025, 12:28 PM
Unknown Object (File)
Oct 12 2025, 11:52 PM
Unknown Object (File)
Oct 12 2025, 12:22 PM
Unknown Object (File)
Oct 8 2025, 8:38 PM
Unknown Object (File)
Oct 2 2025, 6:14 AM
Unknown Object (File)
Sep 26 2025, 5:28 AM
Subscribers

Details

Summary

dbm_open currently returns an error when opening a missing database
with O_CREAT but creates the request database file. This is caused
by a buggy check in __hash_open which attempts to detect a new
(or empty) database file, but fails to take the O_CREAT flag into
account.

Fix this by expanding the check to include O_CREAT.

Fixes: edcdc752ecdd
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable