+++ This bug was initially created as a clone of Bug #912465 +++ (A follow-up on Bug 239455) In various places of Mozilla Code (specifically Thunderbird), files are opened in write-mode, e.g using MsgNewBufferedFileOutputStream. In Linux systems for example, not not necessarily exclusively, the file is truncated to zero size by opening. If the disk is full or very close to full, writing will fail, leaving the file in a corrupt state, with loss of information. This problem can be solved by first writing to a temporary file, and then applying the move-file operation, which is atomic in some operating systems (e.g. Linux). MsgNewSafeBufferedFileOutputStream from Bug 239455 implements this functionality, and should be used in place of other methods, e.g. when there is raw text written out. Where sql databases are written, the case might be different. This bug should identify and fix code not safe against a full disk. ------------------------------------------ In this bug we focus on the remaining problem in the file nsMsgMailNewsUrl.cpp
Bug 1169252 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
+++ This bug was initially created as a clone of Bug #912465 +++ (A follow-up on Bug 239455) In various places of Mozilla Code (specifically Thunderbird), files are opened in write-mode, e.g using MsgNewBufferedFileOutputStream. In Linux systems for example, not not necessarily exclusively, the file is truncated to zero size by opening. If the disk is full or very close to full, writing will fail, leaving the file in a corrupt state, with loss of information. This problem can be solved by first writing to a temporary file, and then applying the move-file operation, which is atomic in some operating systems (e.g. Linux). MsgNewSafeBufferedFileOutputStream from Bug 239455 implements this functionality, and should be used in place of other methods, e.g. when there is raw text written out. Where sqlite or mork (msf) databases are written, the case might be different. This bug should identify and fix code not safe against a full disk. ------------------------------------------ In this bug we focus on the remaining problem in the file nsMsgMailNewsUrl.cpp
+++ This bug was initially created as a clone of Bug #912465 +++ (A follow-up on Bug 239455) In various places of Mozilla Code (specifically Thunderbird), files are opened in write-mode, e.g using MsgNewBufferedFileOutputStream. In Linux systems for example, but not necessarily exclusively, the file is truncated to zero size by opening. If the disk is full or very close to full, writing will fail, leaving the file in a corrupt state, with loss of information. This problem can be solved by first writing to a temporary file, and then applying the move-file operation, which is atomic in some operating systems (e.g. Linux). MsgNewSafeBufferedFileOutputStream from Bug 239455 implements this functionality, and should be used in place of other methods, e.g. when there is raw text written out. Where sqlite or mork (msf) databases are written, the case might be different. This bug should identify and fix code not safe against a full disk. ------------------------------------------ In this bug we focus on the remaining problem in the file nsMsgMailNewsUrl.cpp