* [sup-talk] sup leaves unencrypted emails in /tmp
@ 2010-12-02 0:18 Hamish D
2010-12-04 7:16 ` Cameron Matheson
0 siblings, 1 reply; 2+ messages in thread
From: Hamish D @ 2010-12-02 0:18 UTC (permalink / raw)
To: sup-talk
I noticed that sup appears to leave the unencrypted contents of emails
in /tmp - at least it did on my system. This is a pretty serious issue
on shared computers. I'm not sure why - my attempts at a quick fix
failed. The files are created using Tempfile.new and close is called,
but after that the files are written to by gpg. I'm not sure if this
means that the tempfile system then doesn't delete them later for some
reason.
The tempfile stuff does seem to work for the files containing the
output from gpg. They do (eventually) get deleted. But the "temporary"
files that gpg puts the plaintext into seem to hang around even after
I've done a clean exit from sup.
If anyone has got good ideas about how to fix this for sup 0.12 I
think that would be a fine thing to do.
Note that this is the mainline version of sup, not the gpgme version
I've been developing - using gpgme means the plaintexts never have to
be written to disk, so if we move to gpgme (once I've got it up to
scratch) then these problems will go away.
Thought people ought to know.
Hamish Downer
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [sup-talk] sup leaves unencrypted emails in /tmp
2010-12-02 0:18 [sup-talk] sup leaves unencrypted emails in /tmp Hamish D
@ 2010-12-04 7:16 ` Cameron Matheson
0 siblings, 0 replies; 2+ messages in thread
From: Cameron Matheson @ 2010-12-04 7:16 UTC (permalink / raw)
To: sup-talk
Excerpts from Hamish D's message of Wed Dec 01 17:18:08 -0700 2010:
> I noticed that sup appears to leave the unencrypted contents of emails
> in /tmp - at least it did on my system. This is a pretty serious issue
> on shared computers. I'm not sure why - my attempts at a quick fix
> failed. The files are created using Tempfile.new and close is called,
> but after that the files are written to by gpg. I'm not sure if this
> means that the tempfile system then doesn't delete them later for some
> reason.
Tempfile is interesting because the file is not deleted until the object
is garbage-collected. From the Tempfile.close rdoc:
If you don't explicitly unlink the temporary file, the removal will
be delayed until the object is finalized.
So if I'm understanding this correctly, the tempfiles may or may not be
cleaned up, depending on when the garbage collector runs (e.g., if the
GC runs before gpg is run, the original tempfile will have already been
deleted, and the new file created by gpg will live on indefinitely).
I was going to write a patch, but I don't do anything use gpg often so
it wasn't convenient to test. I think an easy solution would just be to
add a 'File.unlink whatever.path' call after each call to gpg (this
would need to be done in encrypt/decrypt/sign/etc.).
Cam
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-04 8:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-02 0:18 [sup-talk] sup leaves unencrypted emails in /tmp Hamish D
2010-12-04 7:16 ` Cameron Matheson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox