Bug 3238 - GPG Mime Plugin exports contents to a tmpfile unnecessarily
Summary: GPG Mime Plugin exports contents to a tmpfile unnecessarily
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/Privacy/PGP (show other bugs)
Version: 3.10.1
Hardware: PC Linux
: P3 enhancement
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2014-07-31 16:47 UTC by Kevin Day
Modified: 2014-08-01 16:52 UTC (History)
0 users

See Also:


Attachments
A patch to claws-mail to use gpgme_data_new_from_filepart() instead of gpgme_data_new_from_file(). (1.16 KB, patch)
2014-07-31 16:47 UTC, Kevin Day
no flags Details | Diff
Fixed version where file pointer is correctly closed (1.16 KB, patch)
2014-08-01 16:52 UTC, Kevin Day
no flags Details | Diff

Description Kevin Day 2014-07-31 16:47:06 UTC
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?
Comment 1 Paul 2014-08-01 07:52:56 UTC
Thanks! Now applied!
Comment 2 Kevin Day 2014-08-01 16:52:02 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.