On Wed, Mar 17, 2010 at 05:08:08PM -0500, James Simmons wrote:

I was looking at the code for Leer Pen Drive and thinking how I could
improve on it, and in the process I ended up looking at
git.sugarlabs.org at the code for Journal.  Apparently that is not the
most recent code,
I guess you were looking at the "journal" project (don't have internet access right now, so cannot check the exact name). That's indeed rather old code; the Journal has been integrated into the sugar package.

That wouldn't be too surprising except that the Journal Activity can write to a USB or thumb drive. I couldn't figure out how or even where it was doing it, [...]
The "journal" project is part of 0.82. Back then the data store handled removable media. In 0.84+, the data store was rewritten from scratch [1] and only handles the on-disk, native Sugar objects. Handling of "traditional" (POSIX) file storage (USB sticks, hard disks, etc.) has been moved into the Journal. The code you're looking for is sugar/src/jarabe/journal/model.py. In there, the classes DatastoreResultSet and InplaceResultSet form an abstraction layer over the data store and mounted (POSIX) file systems.

but it does seem that you could write an Activity that does everything the Journal does, from writing to mounted media to unmounting it.
Almost everything the Journal does can be done in an activity as well. It all boils down to permissions; usually the permissions are based on security considerations.
The following actions are implemented (source references are for 0.88):

- show item in Journal (D-Bus API)
   - sugar/src/jarabe/journal/journalactivity.py
- D-Bus doesn't allow a second process with the same service name, so not overridable

- show object picker (D-Bus API)
   - sugar/src/jarabe/journal/journalactivity.py
   - again, D-Bus prevents activities from providing this

- mounting/unmounting file systems (e.g. USB sticks)
   - show new mount points: sugar/src/jarabe/journal/volumestoolbar.py
   - unmounting: sugar/src/jarabe/view/palettes.py:VolumePalette
- mounting (Frame, not Journal): sugar/extensions/deviceicon/volume.py
   - without Rainbow:
- activities are able to mount and umount file systems using gio (resp. gvfs for older systems)
   - with Rainbow:
- gio/gvfs probably refuses to unmount file systems mounted by the Frame from within activities (because the user ids are different)

- browsing data store / file systems, reading all entries / files
   - sugar/src/jarabe/journal/model.py
   - without Rainbow:
     - unrestricted
   - with Rainbow:
     - currently:
       - data store access unrestricted
       - file system access prevented by gio/gvfs permission settings
     - future:
       - see P_DOCUMENT / P_DOCUMENT_RO Bitfrost [2] protections

- reading a single data store entry / file via Object Picker
   - sugar-toolkit/src/sugar/graphics/objectchooser.py
   - unrestricted

- writing a single data store entry / file (acquired via Object Picker)
   - without Rainbow:
     - unrestricted
   - with Rainbow:
     - currently:
       - data store access unrestricted
       - file system access prevented by gio/gvfs permission settings
     - future
       - unrestricted

- writing random data store entries / files
   - without Rainbow:
     - unrestricted
   - with Rainbow:
     - currently:
       - data store access unrestricted
       - file system access prevented by gio/gvfs permission settings
     - future
       - subject to P_DOCUMENT Bitfrost [2] protection


Bitfrost protections can be disabled, see the Bitfrost specs [2] for details.

Sorry for the long mail; it's not just an answer to your questions but also a Rainbow TODO list. :)


[1] http://wiki.sugarlabs.org/go/Development_Team/Datastore_Rewrite
[2] http://dev.laptop.org/git/security/tree/bitfrost.txt

CU Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to