GNOME Bugzilla – Bug 778269
Erroneous handling of partial writes in write_sync_close.
Last modified: 2017-02-08 11:23:58 UTC
The write_sync_close function from gnome-keyring/pkcs11/gkm/gkm-transaction.c, works incorrectly in presence of partial writes. The main write loop looks as follows: while (n_data > 0) { res = write (fd, data, n_data); if (res < 0) { ... } n_data -= MAX (res, n_data); } Thus after a single iteration n_data will be always zero, even if not everything have been written so far.
A patch would be more than welcome.
Created attachment 345094 [details] [review] [PATCH] Fix write_sync_close in case of partial writes.
Great. Thanks. Merged into master.
Created attachment 345185 [details] [review] Fix write_sync_close in case of partial writes.