Ticket #6405 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Can't add photo to write doc

Reported by: kimquirk Owned by: mstone
Priority: blocker Milestone: Update.1
Component: security Version:
Keywords: rainbow-integration, review? Cc: jg, tomeu, jedierikb, erikos
Action Needed: Verified: no
Deployments affected: Blocked By:
Blocking:

Description

Build 691, signed

  • Open Write and start a doc (some text)
  • Open Record and take a picture
  • hover over picture and 'add to clipboard'
  • Go back to Write doc, try to drag the picture from the clipboard to the doc

I have repeated this twice on two different laptops with this build.

I turned off security (rm /etc/olpc-security); and the image shows up in the doc via the drag mechanism.

NOTE: I copied a picture from browse to the clipboard; and it successfully dragged onto Write. Just not from Record.

Change History

Changed 7 years ago by mstone

  • cc tomeu added
  • keywords rainbow-integration added

Changed 7 years ago by tomeu

  • cc jedierikb added

Looks like files put into the clipboard from Record are only readable by the user 'olpc'. This also happens with Paint, and I think this is caused by gtk. Going to look more into what piece of software is setting the permissions.

Anyway, the clipboard service should set the permissions to something sane, as it owns those files.

I'm not sure if for update.1 we should just patch Record and Paint? Or should we fix this in the clipboard service (would require a new sugar rpm)?

Changed 7 years ago by tomeu

  • keywords rainbow-integration, review? added; rainbow-integration removed

Well, activities are not in fault here. The clipboard service was copying the handed file in a way that it had 0600 permissions. Before Rainbow landed, all activities ran in the same user so there was no problem.

This patch will allow activities to read the clippings:

diff --git a/service/clipboardservice.py b/service/clipboardservice.py
index fec546f..32132b8 100644
--- a/service/clipboardservice.py
+++ b/service/clipboardservice.py
@@ -200,6 +200,7 @@ class ClipboardService(dbus.service.Object):
         f, new_file_path = tempfile.mkstemp(ext, root)
         del f
         shutil.copyfile(uri.path, new_file_path)
+        os.chmod(new_file_path, 0604)
 
         return 'file://' + new_file_path
 

Changed 7 years ago by dgilmore

I would suggest that we set the file 0644

Changed 7 years ago by marco

Made it 644.

It will be in next joyride: http://koji.fedoraproject.org/koji/taskinfo?taskID=512593

Changed 7 years ago by erikos

  • cc erikos added

Tested as working with browse, paint and write in 1758.

Changed 7 years ago by erikos

  • status changed from new to closed
  • resolution set to fixed

Is working fine in Update.1(700)

Note: See TracTickets for help on using tickets.