tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

cap_mkdb writing wrong files



http://gnats.netbsd.org/32591

I have the impression that while writing the db in a separate file
avoids part of the issue, there is still a problem where the old db can
be read as the source file is parsed.  So I think this means either:

  1) Remove the db before writing, which can result in no db

  2) Add a source-only flag to cgetnext, to ignore the binary databases.

2 involves ABI changes

1 has the downside that if the db creation fails, we can be left with no
binary db.  But presumably cap_mkdb is being run because the source file
is newer, and it seems better to end up with the correct answer more
slowly than to get the wrong answer.

So basically I suggest unlinking the capdb file foo.db as the first
thing, just before opening foo.db.tmp for writing.

Attachment: pgpeWZrJvbIUo.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index