[Sugar-devel] Journal-like activities (was: Re: [ASLO] Release Read ETexts-19)
Sascha Silbe
sascha-ml-ui-sugar-devel at silbe.org
Thu Mar 18 09:09:41 EDT 2010
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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100318/912b6db8/attachment.pgp
More information about the Sugar-devel
mailing list