Summary: | GPG Mime Plugin exports contents to a tmpfile unnecessarily | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Claws Mail (GTK 2) | Reporter: | Kevin Day <thekevinday> | ||||||
Component: | Plugins/Privacy/PGP | Assignee: | users | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | enhancement | ||||||||
Priority: | P3 | ||||||||
Version: | 3.10.1 | ||||||||
Hardware: | PC | ||||||||
OS: | Linux | ||||||||
Attachments: |
|
Thanks! Now applied! Created attachment 1420 [details]
Fixed version where file pointer is correctly closed
I just noticed that the file pointer wasn't properly closed after my changes.
The code that I removed included the closing of fp (which is the original file and not the temporary file). That file was opened at the start of the function.
|
Created attachment 1419 [details] A patch to claws-mail to use gpgme_data_new_from_filepart() instead of gpgme_data_new_from_file(). (I didn't see a Plugins/PGPCore option, hopefully Plugins/Privacy is correct enough.) The code in src/plugins/pgpcore/sgpgme.c creates a tmpfile to populate the gpgme_data_t variable. The function currently being called is: gpgme_data_new_from_file(). The mime data already contains the e-mail file and the relevant mime coordinates, so why not just use the function gpgme_data_new_from_filepart()? Creating a tmpfile seems unneccessary and wastefull. Especially when one runs off a flashdisk that has a limited number of writes! Or perhaps on a read-only filesystem, when one needs to check e-mails but not download any new ones?