--nextPart1862103.7L5tf2s8nO Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 17 January 2009 23:53:48 Sebastian Sauer wrote: > Michael Leupold wrote: > > Hi, > > > > I received a bugreport about someone loosing his wallet today. Basically > > a process filled his disk while the wallet was open. On closing it > > something went terribly wrong and he ended up with a kdewallet.kwl with > > size 0. > > > > I'm pretty much stuck because I couldn't reproduce myself but I assumed > > this couldn't happen as kwalletd's backend uses KSaveFile to make sure > > either the whole wallet gets saved or nothing. As KSaveFile seems to be > > currently unmaintained I hope someone of you knows if it's supposed to > > handle full disk and if there's a corner case where this might indeed > > lead to corruption. > > > > The bugreport is: http://bugs.kde.org/show_bug.cgi?id=3D181059 > > > > Thanks and regards, > > Michael > > in the method Backend::sync() in kwalletbackend.cc shouldn't the > returnvalues of the sf.write() be checked? else the sf.write() may fail, = we > ignore it and then finalize the empty file... Thanks, I missed that and that's the reason the wallet went missing. Another catch I discovered: I seem to have to check the return value and use waitForBytesWritten() unle= ss=20 I'm using unbuffered output as QIODevice::write() might (will?) return the= =20 number of bytes I tried to write even if the disk is full. That's at least= =20 what a simple test suggests. Thanks to everyone helping me out on this. Regards, Michael --nextPart1862103.7L5tf2s8nO Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBJcoO7lfpzINIAlVsRAgsKAJ4iQX9yt9EFxKfzlKK0EZi7iP6cPwCeN0B6 5C5LJYatS+AyyE8PpJBcav8= =M4aZ -----END PGP SIGNATURE----- --nextPart1862103.7L5tf2s8nO--