Two constants define the data directory mode, in two packages that both create it #288
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
internal/datadir/lock.gocreates the data directory at0750via its owndirPermconstant, andinternal/database/database.gohas a separatedataDirPerm = 0750. Two constants, one policy, in two packages that both create the same directory.They agree today. The hazard is that nothing makes them agree tomorrow — a change to one is invisible from the other, and the resulting mismatch would be a permissions bug that only appears depending on which package happened to create the directory first.
Surfaced during #255, which tightened the database FILE modes and deliberately left the directory alone. Kept out of that PR to avoid widening it.
Definition of done:
internal/datadiris the obvious candidate given its name, but check whether the dependency direction allows it before committing to that.Not milestoned: no behaviour is wrong today, and the fix is a consolidation rather than a repair.