Unexpected data loss when opening dba file
| Bug #26304 | Unexpected data loss when opening dba file | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2003-11-18 12:09 UTC | Modified: | 2003-12-14 17:17 UTC |
|
||||||||||
| From: | vesely at tana dot it | Assigned: | helly (profile) | |||||||||||
| Status: | Closed | Package: | DBM/DBA related | |||||||||||
| PHP Version: | 4.3.4 | OS: | * | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2003-11-18 12:09 UTC] vesely at tana dot it
Description:
------------
Opening a file in 'c' mode (see example below)
truncates the file!! The docs say '"c" for read/write
access and database creation if it doesn't currently exist.'
I cannot understand that comment at line 658 in
ext/dba/dba.c, as it seems to imply that truncating
the database is necessary for locking it (??).
Reproduce code:
---------------
dba_open("important_data.db", "c", "db4");
Expected result:
----------------
open db (create if doesn't exist)
Actual result:
--------------
truncated db
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-11-18 12:59 UTC] vesely at tana dot it
[2003-11-19 00:32 UTC] vorlon at debian dot org
[2003-11-19 22:14 UTC] vorlon at debian dot org