Re: fyi: exmh 2.7.2 has problem saving attached files..

[email protected]
Newsgroups gmane.mail.exmh.user
Message-ID <[email protected]>
On Thu, 21 Sep 2006 08:28:31 PDT, [email protected] said:
> I regularly email  myself files, eg to update my web page ;)  (since I don't
> run AFS on my lapstation when I'm off-campus (which is all the time these
> days)), and on exmh 2.5 I would simply save the file, eg index.html, and
> overwrite the existing file, and voila all done.
>
> now exmh complains only that there is an error in copying the attached file
> from /tmp to the target location. if the existing file is first removed, then
> it saves it fine. I checked permissions and all and don't think that is an
> issue.

OK, I'll take the blame for this one, as I intentionally coded it that way, and
got it wrong.  I fixed it post-2.7.2:

cvs repository 4/21/2005 [email protected]
  lib/mime.tcl: Add call to FileExistsDialog to prompt before saving a
    MIME part into an already existing file.

The original change was part of a large clean-up of the file saving code
to close up a *lot* of security issues - the specific change causing your
user the trouble was intended to keep somebody from sending you an attachment
with a suggested filename that would (either accidentally or intentionally)
overlay an existing file.

I've attached the 4/21/2005 patch, which should apply to a clean 2.7.2
tree (with possible offset messages).  Let me know if this solves your
user's problem.

_______________________________________________
Exmh-users mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/exmh-users
mime.tcl.patch (application/x-patch, 683 B)
--- mime.tcl	2005/04/05 01:41:21	1.55
+++ mime.tcl	2005/04/21 16:40:10	1.56
@@ -2380,10 +2380,19 @@
     Exmh_Status "Saving $type $fileName"
     set name [FSBox "Save $type to:" $default write]
     if {$name != {}} {
+	set forceit ""
+	if [file exists $name ] {
+	    if {! [FileExistsDialog $name]} {
+		Exmh_Status "Save canceled"
+		return 0
+	    }
+	    set forceit "-force"
+	}
 	if [catch {
-	    file copy -- $fileName $name
+	    eval file copy $forceit -- $fileName $name
             # Leading zero to ensure octal interpretation
 	    file attributes $name -permissions 0$mhProfile(msg-protect)
+	    Exmh_Status "Saved to $name"
 	} err] {
 	    Exmh_Status $err
 	}
signature.asc (application/pgp-signature, 226 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Exmh version 2.5 07/13/2001

iD8DBQFFEr22cC3lWbTT17ARAhY+AJ4uMsBaRh0yaIf/lHsfuPxPVJJsYwCgprae
s/3e6ZGPztH+qr0PlNsg3Ms=
=6U9F
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.