OLPC and Mono The Sugar Datastore

Slides:



Advertisements
Similar presentations
MIS316 – BUSINESS APPLICATION DEVELOPMENT – Chapter 14 – Files and Streams 1Microsoft Visual C# 2012, Fifth Edition.
Advertisements

@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
Adding New Users User as an entity - username(UID), GID. UID - typically a number for system to identify the user. GID – a number that recognizes a set.
Hour 7 The Application Layer 1. What Is the Application Layer? The Application layer is the top layer in TCP/IP's protocol suite Some of the components.
File Systems (1). Readings r Reading: Disks, disk scheduling (3.7 of textbook; “How Stuff Works”) r Reading: File System Implementation ( of textbook)
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
...looking a bit closer under the hood
ArcGIS for Server Security: Advanced
Lecture 5:Interfaces and Abstract Classes
Introduction to Perl: Practical extraction and report language
Introduction to Kernel
Directory Structure Single Level Directory Two Level Directory
Understanding Android Security
Jim Fawcett CSE681 – SW Modeling & Analysis Fall 2014
...looking a bit closer under the hood
WEB SERVICES.
Data Catalog Project A Browsable, Searchable, Metadata System
Hands On UNIX AfNOG 2010 Kigali, Rwanda
IS444: Modern tools for applications development
Day 27 File System.
WORKSHOP 2 TEMPLATES VERSUS SUBSYSTEMS
Lecture 1 Runtime environments.
IS444: Modern tools for applications development
Hands On UNIX AfNOG X Cairo, Egypt
Introduction to Computers
XAML User Interface Creation in C#
Interfaces and Inheritance
Angularjs Interview Questions and Answers By Hope Tutors.
Lecture 9 Concepts of Programming Languages
WEB API.
Chapter 6 System and Application Software
File service architecture
Chapter 2: The Linux System Part 2
Chapter 2: System Structures
Variables ICS2O.
...looking a bit closer under the hood
Packages and Interfaces
CSCI The UNIX System Shell Startup and Variables
Google App Engine Ying Zou 01/24/2016.
Chapter 40 Remote Method Invocation
Chapter 2: Operating-System Structures
Files Management – The interfacing
Outline Chapter 2 (cont) OS Design OS structure
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
SCONE: Secure Linux Containers Environments with Intel SGX
Understanding Android Security
Defining Classes and Methods
Rootly Powers Chapter 3.
Dynamic Exchange of Capabilities Between Mobile Agents
CORBA Programming B.Ramamurthy Chapter 3 5/2/2019.
Chapter 6 System and Application Software
Chapter 6 System and Application Software
Oriented Design and Abstract Data Type
Chapter 2: Operating-System Structures
Services for Non-Volatile Storage
Web Servers (IIS and Apache)
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/29.
Jim Fawcett CSE681 – SW Modeling & Analysis Fall 2018
Chapter 6 System and Application Software
Software Engineering and Architecture
Web Application Development Using PHP
11.1 The Concept of Abstraction
Lecture 9 Concepts of Programming Languages
SHELLSHOCK ATTACK.
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Message Passing Systems
Presentation transcript:

OLPC and Mono The Sugar Datastore Torello Querci OLPC-Italia torello@olpc-italia.org Paris 15th November 2008

Outline Activity Isolation Rainbow How to access and share files Datastore What to do with it Mono bindings How to search data How to write data

Activity Isolation Rainbow Rainbow implements the isolation shell implicitly described in the Bitfrost security specification. This means that it isolates activities (and eventually system services) that it is asked to run from one another and the rest of the system.

Activity Isolation Rainbow Rainbow implements this isolation by generating a new uid (and perhaps a new gid) for each program it is asked to run. Running each activity as a separate user means that standard Unix access checks can be used as the primary 'gate' to control the visibility of activity-driven side-effects like reading from or writing to files or devices or signaling other processes.

Activity Isolation How to access to files Activity can access to its own files Activity can access to system files world readable Activity cannot access to files owned by other activity When activity is closed all its files (except configuration files) will be destroyed

Activity Isolation How to access to files Since each activity is run as a different user, it gets a different home directory on each invocation. In release 8.2, the home directory for an activity equals the $SUGAR_ACTIVITY_ROOT/instance/ directory. For data such as config files to survive and be accessible by all future activity invocations, they must not be stored in $HOME but rather $SUGAR_ACTIVITY_ROOT/data/ should be used.

Activity Isolation How to share files All writing to the file system is restricted to subdirectories of the path given in the SUGAR_ACTIVITY_ROOT environment variable. $SUGAR_ACTIVITY_ROOT/instance/ is used similar to a /var/tmp directory. It is unique per instance. It is used for transfer to and from the datastore. This directory is deleted when the activity exits

Datastore How does it work? Datastore is a service that use DBus to communicate with the client application

Datastore What to do with it

Datastore The Mono Bindings user activity sugar framework user C# code Datastore Service sugar-sharp low-level API sugar-sharp high-level API NDesk-DBus assembly DBUS

Datastore bindings How can use it? On Sugar-sharp there is two way to use datastore: 1 – using low level API you can invoke directly the Dbus methods and signals 2 – using high level API the datastore is made easy

Datastore bindings Why low level API Need a mapping for DBus methods and signals Since there is low level API everyone can use it

Datastore bindings Why high level API Low level API is not so easy to use Python Activities use high level API to manage the datastore, it is easier to use the same interface

Datastore bindings How to search Dictionary<String,object> query=new Dictionary<String,object>(); query.Add("monkeys_memory","true"); ArrayList result=null; result = Datastore.find(query); if (result!=null && result.Count>0) { System.Console.Out.WriteLine("count="+result.Count); DSObject dsObj; IEnumerator en=result.GetEnumerator(); while (en.MoveNext()) { dsObj=(DSObject) en.Current; System.Console.Out.WriteLine("OBJ_ID="+dsObj.object_id.ToString()); System.Console.Out.WriteLine("FILE_PATH="+dsObj.FilePath); foreach (String key in dsObj.Metadata.Keys()) { System.Console.Out.WriteLine(key+" value="+dsObj.Metadata.get(key,null).ToString()); }

Datastore bindings How to write 1/2 String tmpDir=System.Environment.GetEnvironmentVariable("SUGAR_ACTIVITY_ROOT"); tmpDir += "/instance"; UnixFileInfo t = new UnixFileInfo(tmpDir+"/test.txt"); StreamWriter sw = new StreamWriter(t.FullName); sw.WriteLine("This is only a simple "); sw.WriteLine("textfile that need to be stored on datastore"); sw.Close(); Step 1 – Write something on a file

Datastore bindings How to write 2/2 DSObject dsobject=Datastore.Create(); // Write any metadata (here we specifically set the title of the file and // specify that this is a plain text file). dsobject.Metadata.setItem("title","Monkey's Memory Activity"); dsobject.Metadata.setItem("mime_type","text/plain"); dsobject.Metadata.setItem("monkeys_memory","true"); dsobject.FilePath=t.FullName; Datastore.write(dsobject); Step 2 – Ask datastore to store it

And now .....

Hack, hack, hack ....