Opened 7 years ago

Closed 7 years ago

#6405 closed defect (fixed)

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
Blocked By: Blocking:
Deployments affected: Action Needed:
Verified: no

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 (7)

comment:1 Changed 7 years ago by mstone

  • Cc tomeu added
  • Keywords rainbow-integration added

comment:2 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)?

comment:3 Changed 7 years ago by tomeu

  • Keywords review? added

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
 

comment:4 Changed 7 years ago by dgilmore

I would suggest that we set the file 0644

comment:5 Changed 7 years ago by marco

Made it 644.

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

comment:6 Changed 7 years ago by erikos

  • Cc erikos added

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

comment:7 Changed 7 years ago by erikos

  • Resolution set to fixed
  • Status changed from new to closed

Is working fine in Update.1(700)

Note: See TracTickets for help on using tickets.