After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 347238 - broken and inconsistent file permissions, when saving attachments
broken and inconsistent file permissions, when saving attachments
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.8.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-07-11 16:46 UTC by Karsten Bräckelmann
Modified: 2013-09-13 00:49 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
File permissions for saving attachment changed to -rw-r--r-- (2.54 KB, patch)
2006-08-07 05:23 UTC, ushveen kaur
needs-work Details | Review
Corrected patch. (4.02 KB, patch)
2006-08-23 06:10 UTC, ushveen kaur
none Details | Review
Sorry,had missed sumthing in the previous patch. (5.37 KB, patch)
2006-08-23 06:58 UTC, ushveen kaur
committed Details | Review

Description Karsten Bräckelmann 2006-07-11 16:46:39 UTC
Got a mail with one attachment, Content-Type: text/plain.

Depending on the way the user chooses to save the attachment, the resulting file permissions differ, being totally inconsistend and somewhat broken. Below is a list of the possible ways to save and the respective resulting file permissions. The location to save the attachment is the very same in all cases.


* Open the attachment pane in the header (using the small arrow button next
  to the attachment count in the header), then drag-n-drop the file icon to
  Nautilus.
  Resulting permissions: -rw-------

* Click the "Save" button next to the attachment count in the header to save
  all (here one) attachments.
  Resulting permissions: -rw-r--r--

* Use the attachment drop-down button (where the attachment actually is in
  the MIME structure), Save As.
  Resulting permissions: -rw-r--r--

* Drag-n-drop the attachment button itself (the inline-display toggle button
  where the attachment actually is in the MIME structure) to Nautilus.
  Resulting permissions: -r--r--r--


This behavior is totally inconsistent -- 4 ways, 3 different results. Note, that the user does not even have write permissions in the last case above.
Comment 1 Karsten Bräckelmann 2006-07-11 16:56:12 UTC
For reference:

$ touch test
$ ls -l test
-rw-r--r--  1 guenther users 0 Jul 11 18:50 test
Comment 2 ushveen kaur 2006-08-07 05:23:42 UTC
Created attachment 70354 [details] [review]
File permissions for saving attachment changed to -rw-r--r--
Comment 3 Srinivasa Ragavan 2006-08-22 16:41:52 UTC
ushveen the patch needs some more work. It will interfere the place, where the attachments are opened read-only.
Comment 4 ushveen kaur 2006-08-23 06:10:29 UTC
Created attachment 71433 [details] [review]
Corrected patch.
Comment 5 ushveen kaur 2006-08-23 06:58:48 UTC
Created attachment 71436 [details] [review]
Sorry,had missed sumthing in the previous patch.
Comment 6 Srinivasa Ragavan 2006-08-23 07:59:34 UTC
Fixed to HEAD (with slight modifications). Should this go for stable? 
Comment 7 André Klapper 2006-08-23 12:46:25 UTC
changing the signedness by

-em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part)
+em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part, gboolean mode)

breaks other places where this is called, namely

./plugins/import-ics-attachments/icsimporter.c: path = em_utils_temp_save_part (NULL, part);
./plugins/import-ics-attachments/icsimporter.c: path = em_utils_temp_save_part (NULL, part);
./plugins/itip-formatter/itip-formatter.c:                                      new_uri = em_utils_temp_save_part (NULL, part);
./plugins/itip-formatter/itip-formatter.c:                                      new_uri = em_utils_temp_save_part (NULL, part);



also, DO update the documentation!!!!!!:
/**
 * em_utils_temp_save_part:
 * @parent: 
 * @part: 
 *
where is "@mode" here?
folks, you really discourage potential external contributors if you do not take care of stuff like that. at least i would be pretty pissed.
Comment 8 André Klapper 2006-08-23 13:04:08 UTC
but except of that, it builds fine. no other patches that have broken the build so far. :-)
Comment 9 Srinivasa Ragavan 2006-08-23 14:05:38 UTC
My fault. Committed the right fix. 
Comment 10 Karsten Bräckelmann 2006-09-01 00:23:20 UTC
(In reply to comment #6)
> Fixed to HEAD (with slight modifications). Should this go for stable? 

No need to at this point, we are past the last 2.6.x release.

(Note that Severity has been raised from normal to blocker by Andre. I assume to force getting a corrected patch in. The bug itself isn't that important...)