[Sugar-devel] Read-only access to thumb drive forbidden by Rainbow?

2009-08-28 Thread Jim Simmons
As I have mentioned in this list before, I am trying to make View
Slides able to get pictures that may or may not be in the Journal and
add them to a slide presentation.  Under .82 objects in thumb drives
can be listed using the Data Store API, which was fine.  In .84 you
cannot do that any more, but I was led to believe that if I just
wanted to READ these files that Python IO would work.  So I use this
code:

valid_endings = ('.jpg',  '.jpeg', '.JPEG',  '.JPG', '.gif',
'.GIF', '.tiff', '.TIFF', '.png', '.PNG')
for dirname,  dirnames,  filenames in os.walk('/media'):
for filename in filenames:
if filename.endswith(valid_endings):
iter = self.ls_right.append()
jobject_wrapper = JobjectWrapper()

jobject_wrapper.set_file_path(os.path.join(dirname,  filename))
self.ls_right.set(iter,  COLUMN_IMAGE,  filename)
self.ls_right.set(iter,  COLUMN_PATH,  jobject_wrapper)

Now this code runs just fine on the Sugar test environment of Fedora
11 (.84) and Fedora 10 (.82).  However, if I try running the same code
on my XO, currently running .82, the Activity does not even finish
coming up.  Using the Log Activity does not give me any useful
messages.  I can only suspect that Rainbow is the culprit here,
although I'm not getting any actual messages that say that.  It's just
a guess on my part.

In the code above the jobject_wrapper is a class I created so that my
table column could hold an object that would return a file path,
either by getting it from a wrapped journal object or from a path
supplied by the code above.  Works fine in my test environment, but
bails out on my XO.

Does anyone have any ideas?  Thanks,

James Simmons
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Read-only access to thumb drive forbidden by Rainbow?

2009-08-28 Thread Walter Bender
You can isolate Rainbow by disabling it and seeing if the problem goes away.

sudo rm /etc/olpc-security

will disable Rainbow

sudo touch /etc/olpc-security

will reenable it.

-walter

On Fri, Aug 28, 2009 at 10:19 PM, Jim Simmons wrote:
> As I have mentioned in this list before, I am trying to make View
> Slides able to get pictures that may or may not be in the Journal and
> add them to a slide presentation.  Under .82 objects in thumb drives
> can be listed using the Data Store API, which was fine.  In .84 you
> cannot do that any more, but I was led to believe that if I just
> wanted to READ these files that Python IO would work.  So I use this
> code:
>
>        valid_endings = ('.jpg',  '.jpeg', '.JPEG',  '.JPG', '.gif',
> '.GIF', '.tiff', '.TIFF', '.png', '.PNG')
>        for dirname,  dirnames,  filenames in os.walk('/media'):
>            for filename in filenames:
>                if filename.endswith(valid_endings):
>                    iter = self.ls_right.append()
>                    jobject_wrapper = JobjectWrapper()
>
> jobject_wrapper.set_file_path(os.path.join(dirname,  filename))
>                    self.ls_right.set(iter,  COLUMN_IMAGE,  filename)
>                    self.ls_right.set(iter,  COLUMN_PATH,  jobject_wrapper)
>
> Now this code runs just fine on the Sugar test environment of Fedora
> 11 (.84) and Fedora 10 (.82).  However, if I try running the same code
> on my XO, currently running .82, the Activity does not even finish
> coming up.  Using the Log Activity does not give me any useful
> messages.  I can only suspect that Rainbow is the culprit here,
> although I'm not getting any actual messages that say that.  It's just
> a guess on my part.
>
> In the code above the jobject_wrapper is a class I created so that my
> table column could hold an object that would return a file path,
> either by getting it from a wrapped journal object or from a path
> supplied by the code above.  Works fine in my test environment, but
> bails out on my XO.
>
> Does anyone have any ideas?  Thanks,
>
> James Simmons
> ___
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Read-only access to thumb drive forbidden by Rainbow?

2009-08-29 Thread Jim Simmons
Walter,

I tried deleting /etc/olpc-security but that had no effect,  Even
rebooting after deleting olpc-security had no effect.  I managed to
copy the log messages from my previous efforts to the clipboard and
save them to a thumb drive:

reserved credentials (10002, 10005)

adding group: /usr/sbin/groupadd -o -g 10005 10005

groupadd: group 10005 exists

adding user: /usr/sbin/useradd -m -u 10002 -g 10005 -c
org.laptop.ViewSlidesActivity.10002 -d
/home/olpc/isolation/1/uid_to_home_dir/10002 10002

Creating mailbox file: File exists

dropping privilege to (10002, 10005)

chdir to /home/olpc/Activities/ViewSlides.activity

umask(0)

about to execve

argv: dbus.Array([dbus.UTF8String('sugar-activity'),
dbus.UTF8String('viewslides.ViewSlidesActivity'),
dbus.UTF8String('-b'),
dbus.UTF8String('org.laptop.ViewSlidesActivity'),
dbus.UTF8String('-a'),
dbus.UTF8String('9469a4295fc4c2a1c5bc89a049bc8046978bcd4d')],
signature=dbus.Signature('s'))

env: dbus.Dictionary({dbus.UTF8String('LOGNAME'):
dbus.UTF8String('olpc'), 'USER': '10002', dbus.UTF8String('HOME'):
'/home/olpc/isolation/1/uid_to_home_dir/10002',
dbus.UTF8String('PATH'):
dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/bin:/usr/bin:/bin'),
dbus.UTF8String('DISPLAY'): dbus.UTF8String(':0'),
dbus.UTF8String('LANG'): dbus.UTF8String('en_US.UTF-8'),
dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
dbus.UTF8String('TZ'): dbus.UTF8String('UTC'),
dbus.UTF8String('XDG_SESSION_COOKIE'):
dbus.UTF8String('953edcc5e38ef3d4eb1c4ec349fc8998-1251513204.25857-1875509082'),
dbus.UTF8String('SESSION_MANAGER'):
dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1312,unix/unix:/tmp/.ICE-unix/1312'),
dbus.UTF8String('SHLVL'): dbus.UTF8String('1'),
dbus.UTF8String('ICEAUTHORITY'):
'/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
dbus.UTF8String('SUGAR_BUNDLE_PATH'):
dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity'),
dbus.UTF8String('SUGAR_LOCALEDIR'):
dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/locale'),
dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
'/home/olpc/isolation/1/uid_to_home_dir/10002',
dbus.UTF8String('GTK2_RC_FILES'):
dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc'),
dbus.UTF8String('SUGAR_BUNDLE_ID'):
dbus.UTF8String('org.laptop.ViewSlidesActivity'),
dbus.UTF8String('DBUS_SESSION_BUS_ADDRESS'):
dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=858a48de7c5f74d530c5570c4a989374'),
'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
dbus.UTF8String('XAUTHORITY'):
'/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
dbus.UTF8String('GTK_IM_MODULE'):
dbus.UTF8String('gtk-im-context-simple'),
dbus.UTF8String('XSERVERAUTH'):
dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'),
dbus.UTF8String('PWD'): dbus.UTF8String('/home/olpc')},
signature=dbus.Signature('ss'))

closing all fds but (1, 2)

{dbus.UTF8String('LOGNAME'): dbus.UTF8String('olpc'), 'USER': '10002',
'PATH': 
dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/bin:/usr/bin:/bin'),
dbus.UTF8String('HOME'):
'/home/olpc/isolation/1/uid_to_home_dir/10002', 'DISPLAY':
dbus.UTF8String(':0'), 'LANG': dbus.UTF8String('en_US.UTF-8'), 'TERM':
'linux', dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
dbus.UTF8String('TZ'): dbus.UTF8String('UTC'), 'XAUTHORITY':
'/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
dbus.UTF8String('SESSION_MANAGER'):
dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1312,unix/unix:/tmp/.ICE-unix/1312'),
dbus.UTF8String('SHLVL'): dbus.UTF8String('1'), 'ICEAUTHORITY':
'/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
dbus.UTF8String('SUGAR_BUNDLE_PATH'):
dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity'),
dbus.UTF8String('SUGAR_LOCALEDIR'):
dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/locale'),
dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
'UPSTART_JOB': 'rainbow', 'UPSTART_JOB_ID': '3',
dbus.UTF8String('SUGAR_BUNDLE_ID'):
dbus.UTF8String('org.laptop.ViewSlidesActivity'),
'DBUS_SESSION_BUS_ADDRESS':
dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=858a48de7c5f74d530c5570c4a989374'),
'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
dbus.UTF8String('XDG_SESSION_COOKIE'):
dbus.UTF8String('953edcc5e38ef3d4eb1c4ec349fc8998-1251513204.25857-1875509082'),
dbus.UTF8String('GTK_IM_MODULE'):
dbus.UTF8String('gtk-im-context-simple'),
dbus.UTF8String('XSERVERAUTH'):
dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'),
dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
'/home/olpc/isolation/1/uid_to_home_dir/10002',
dbus.UTF8String('PWD'): dbus.UTF8String('/home/olpc'),
'UPSTART_EVENT': 'started', 'GTK2_RC_FILES':
dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc')}

/usr/lib/python2.5/site-packages/sugar/graphics/combobox.py:93:
PangoWarning: error opening config file '/root/.pangorc': Permission

Re: [Sugar-devel] Read-only access to thumb drive forbidden by Rainbow?

2009-08-30 Thread Tomeu Vizoso
On Sun, Aug 30, 2009 at 01:50, Jim Simmons wrote:
> Walter,
>
> I tried deleting /etc/olpc-security but that had no effect,  Even
> rebooting after deleting olpc-security had no effect.  I managed to
> copy the log messages from my previous efforts to the clipboard and
> save them to a thumb drive:
>
> reserved credentials (10002, 10005)
>
> adding group: /usr/sbin/groupadd -o -g 10005 10005
>
> groupadd: group 10005 exists
>
> adding user: /usr/sbin/useradd -m -u 10002 -g 10005 -c
> org.laptop.ViewSlidesActivity.10002 -d
> /home/olpc/isolation/1/uid_to_home_dir/10002 10002
>
> Creating mailbox file: File exists
>
> dropping privilege to (10002, 10005)
>
> chdir to /home/olpc/Activities/ViewSlides.activity
>
> umask(0)
>
> about to execve
>
> argv: dbus.Array([dbus.UTF8String('sugar-activity'),
> dbus.UTF8String('viewslides.ViewSlidesActivity'),
> dbus.UTF8String('-b'),
> dbus.UTF8String('org.laptop.ViewSlidesActivity'),
> dbus.UTF8String('-a'),
> dbus.UTF8String('9469a4295fc4c2a1c5bc89a049bc8046978bcd4d')],
> signature=dbus.Signature('s'))
>
> env: dbus.Dictionary({dbus.UTF8String('LOGNAME'):
> dbus.UTF8String('olpc'), 'USER': '10002', dbus.UTF8String('HOME'):
> '/home/olpc/isolation/1/uid_to_home_dir/10002',
> dbus.UTF8String('PATH'):
> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/bin:/usr/bin:/bin'),
> dbus.UTF8String('DISPLAY'): dbus.UTF8String(':0'),
> dbus.UTF8String('LANG'): dbus.UTF8String('en_US.UTF-8'),
> dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
> dbus.UTF8String('TZ'): dbus.UTF8String('UTC'),
> dbus.UTF8String('XDG_SESSION_COOKIE'):
> dbus.UTF8String('953edcc5e38ef3d4eb1c4ec349fc8998-1251513204.25857-1875509082'),
> dbus.UTF8String('SESSION_MANAGER'):
> dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1312,unix/unix:/tmp/.ICE-unix/1312'),
> dbus.UTF8String('SHLVL'): dbus.UTF8String('1'),
> dbus.UTF8String('ICEAUTHORITY'):
> '/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
> dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
> dbus.UTF8String('SUGAR_BUNDLE_PATH'):
> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity'),
> dbus.UTF8String('SUGAR_LOCALEDIR'):
> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/locale'),
> dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
> dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
> '/home/olpc/isolation/1/uid_to_home_dir/10002',
> dbus.UTF8String('GTK2_RC_FILES'):
> dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc'),
> dbus.UTF8String('SUGAR_BUNDLE_ID'):
> dbus.UTF8String('org.laptop.ViewSlidesActivity'),
> dbus.UTF8String('DBUS_SESSION_BUS_ADDRESS'):
> dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=858a48de7c5f74d530c5570c4a989374'),
> 'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
> dbus.UTF8String('XAUTHORITY'):
> '/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
> dbus.UTF8String('GTK_IM_MODULE'):
> dbus.UTF8String('gtk-im-context-simple'),
> dbus.UTF8String('XSERVERAUTH'):
> dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'),
> dbus.UTF8String('PWD'): dbus.UTF8String('/home/olpc')},
> signature=dbus.Signature('ss'))
>
> closing all fds but (1, 2)
>
> {dbus.UTF8String('LOGNAME'): dbus.UTF8String('olpc'), 'USER': '10002',
> 'PATH': 
> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/bin:/usr/bin:/bin'),
> dbus.UTF8String('HOME'):
> '/home/olpc/isolation/1/uid_to_home_dir/10002', 'DISPLAY':
> dbus.UTF8String(':0'), 'LANG': dbus.UTF8String('en_US.UTF-8'), 'TERM':
> 'linux', dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
> dbus.UTF8String('TZ'): dbus.UTF8String('UTC'), 'XAUTHORITY':
> '/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
> dbus.UTF8String('SESSION_MANAGER'):
> dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1312,unix/unix:/tmp/.ICE-unix/1312'),
> dbus.UTF8String('SHLVL'): dbus.UTF8String('1'), 'ICEAUTHORITY':
> '/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
> dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
> dbus.UTF8String('SUGAR_BUNDLE_PATH'):
> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity'),
> dbus.UTF8String('SUGAR_LOCALEDIR'):
> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/locale'),
> dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
> 'UPSTART_JOB': 'rainbow', 'UPSTART_JOB_ID': '3',
> dbus.UTF8String('SUGAR_BUNDLE_ID'):
> dbus.UTF8String('org.laptop.ViewSlidesActivity'),
> 'DBUS_SESSION_BUS_ADDRESS':
> dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=858a48de7c5f74d530c5570c4a989374'),
> 'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
> dbus.UTF8String('XDG_SESSION_COOKIE'):
> dbus.UTF8String('953edcc5e38ef3d4eb1c4ec349fc8998-1251513204.25857-1875509082'),
> dbus.UTF8String('GTK_IM_MODULE'):
> dbus.UTF8String('gtk-im-context-simple'),
> dbus.UTF8String('XSERVERAUTH'):
> dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'),
> dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
> '/home/olpc/isolation/1/uid_to_home_dir/10002',
> dbus.UTF8String('PWD'): dbus.UTF

Re: [Sugar-devel] Read-only access to thumb drive forbidden by Rainbow?

2009-08-30 Thread Jim Simmons
Tomeu,

Your suggestion was right on the money.  When I run a simple program
from Terminal that prints out the files it finds it goes through my SD
card (also mounted on /media) and seems to stall in the depths of the
.olpc_store directory.  What I think I need to do is write my own
walk-like function that ignores hidden directories.  I really should
have thought of your suggestion myself but everything ran so well on
my test boxes that I jumped to the conclusion that something on the XO
was the problem.

Thanks again,

James Simmons


On Sun, Aug 30, 2009 at 3:31 AM, Tomeu Vizoso wrote:
> On Sun, Aug 30, 2009 at 01:50, Jim Simmons wrote:
>> Walter,
>>
>> I tried deleting /etc/olpc-security but that had no effect,  Even
>> rebooting after deleting olpc-security had no effect.  I managed to
>> copy the log messages from my previous efforts to the clipboard and
>> save them to a thumb drive:
>>
>> reserved credentials (10002, 10005)
>>
>> adding group: /usr/sbin/groupadd -o -g 10005 10005
>>
>> groupadd: group 10005 exists
>>
>> adding user: /usr/sbin/useradd -m -u 10002 -g 10005 -c
>> org.laptop.ViewSlidesActivity.10002 -d
>> /home/olpc/isolation/1/uid_to_home_dir/10002 10002
>>
>> Creating mailbox file: File exists
>>
>> dropping privilege to (10002, 10005)
>>
>> chdir to /home/olpc/Activities/ViewSlides.activity
>>
>> umask(0)
>>
>> about to execve
>>
>> argv: dbus.Array([dbus.UTF8String('sugar-activity'),
>> dbus.UTF8String('viewslides.ViewSlidesActivity'),
>> dbus.UTF8String('-b'),
>> dbus.UTF8String('org.laptop.ViewSlidesActivity'),
>> dbus.UTF8String('-a'),
>> dbus.UTF8String('9469a4295fc4c2a1c5bc89a049bc8046978bcd4d')],
>> signature=dbus.Signature('s'))
>>
>> env: dbus.Dictionary({dbus.UTF8String('LOGNAME'):
>> dbus.UTF8String('olpc'), 'USER': '10002', dbus.UTF8String('HOME'):
>> '/home/olpc/isolation/1/uid_to_home_dir/10002',
>> dbus.UTF8String('PATH'):
>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/bin:/usr/bin:/bin'),
>> dbus.UTF8String('DISPLAY'): dbus.UTF8String(':0'),
>> dbus.UTF8String('LANG'): dbus.UTF8String('en_US.UTF-8'),
>> dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
>> dbus.UTF8String('TZ'): dbus.UTF8String('UTC'),
>> dbus.UTF8String('XDG_SESSION_COOKIE'):
>> dbus.UTF8String('953edcc5e38ef3d4eb1c4ec349fc8998-1251513204.25857-1875509082'),
>> dbus.UTF8String('SESSION_MANAGER'):
>> dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1312,unix/unix:/tmp/.ICE-unix/1312'),
>> dbus.UTF8String('SHLVL'): dbus.UTF8String('1'),
>> dbus.UTF8String('ICEAUTHORITY'):
>> '/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
>> dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
>> dbus.UTF8String('SUGAR_BUNDLE_PATH'):
>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity'),
>> dbus.UTF8String('SUGAR_LOCALEDIR'):
>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/locale'),
>> dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
>> dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
>> '/home/olpc/isolation/1/uid_to_home_dir/10002',
>> dbus.UTF8String('GTK2_RC_FILES'):
>> dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc'),
>> dbus.UTF8String('SUGAR_BUNDLE_ID'):
>> dbus.UTF8String('org.laptop.ViewSlidesActivity'),
>> dbus.UTF8String('DBUS_SESSION_BUS_ADDRESS'):
>> dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=858a48de7c5f74d530c5570c4a989374'),
>> 'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
>> dbus.UTF8String('XAUTHORITY'):
>> '/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
>> dbus.UTF8String('GTK_IM_MODULE'):
>> dbus.UTF8String('gtk-im-context-simple'),
>> dbus.UTF8String('XSERVERAUTH'):
>> dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'),
>> dbus.UTF8String('PWD'): dbus.UTF8String('/home/olpc')},
>> signature=dbus.Signature('ss'))
>>
>> closing all fds but (1, 2)
>>
>> {dbus.UTF8String('LOGNAME'): dbus.UTF8String('olpc'), 'USER': '10002',
>> 'PATH': 
>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/bin:/usr/bin:/bin'),
>> dbus.UTF8String('HOME'):
>> '/home/olpc/isolation/1/uid_to_home_dir/10002', 'DISPLAY':
>> dbus.UTF8String(':0'), 'LANG': dbus.UTF8String('en_US.UTF-8'), 'TERM':
>> 'linux', dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
>> dbus.UTF8String('TZ'): dbus.UTF8String('UTC'), 'XAUTHORITY':
>> '/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
>> dbus.UTF8String('SESSION_MANAGER'):
>> dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1312,unix/unix:/tmp/.ICE-unix/1312'),
>> dbus.UTF8String('SHLVL'): dbus.UTF8String('1'), 'ICEAUTHORITY':
>> '/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
>> dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
>> dbus.UTF8String('SUGAR_BUNDLE_PATH'):
>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity'),
>> dbus.UTF8String('SUGAR_LOCALEDIR'):
>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/locale'),
>> dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
>> 'UPSTART_JOB': 'rainbow', 'UPSTART_JOB_ID': '3',

Re: [Sugar-devel] Read-only access to thumb drive forbidden by Rainbow?

2009-08-30 Thread Jim Simmons
Tomeu,

It turned out that fixing the problem with .olpc.store was pretty
simple and I now have an Activity that is functional.  The next
problem is, it works differently in .82 and .84.  In .82 every file on
the thumb drive and SD card is treated as a Journal entry and listed
out by the datastore API.  In .84 these files are not listed, so I
have to use os.walk() to get them.  Unfortunately doing this means
duplicate entries when the app is running in .82.  So it would be
useful if I could tell when my os.walk() routine is needed and ONLY
run that code when it is needed.  I'd prefer to do something like try
to do something that the datastore API only allows in .84 and later
and catch an exception, which I then use to determine whether to run
the code or not.  Failing that, if I could detect the version of Sugar
and base my code on that that would be OK.  I'm looking for something
robust and future-proof.

Any ideas?  Thanks again,

James Simmons


On Sun, Aug 30, 2009 at 9:40 AM, Jim Simmons wrote:
> Tomeu,
>
> Your suggestion was right on the money.  When I run a simple program
> from Terminal that prints out the files it finds it goes through my SD
> card (also mounted on /media) and seems to stall in the depths of the
> .olpc_store directory.  What I think I need to do is write my own
> walk-like function that ignores hidden directories.  I really should
> have thought of your suggestion myself but everything ran so well on
> my test boxes that I jumped to the conclusion that something on the XO
> was the problem.
>
> Thanks again,
>
> James Simmons
>
>
> On Sun, Aug 30, 2009 at 3:31 AM, Tomeu Vizoso wrote:
>> On Sun, Aug 30, 2009 at 01:50, Jim Simmons wrote:
>>> Walter,
>>>
>>> I tried deleting /etc/olpc-security but that had no effect,  Even
>>> rebooting after deleting olpc-security had no effect.  I managed to
>>> copy the log messages from my previous efforts to the clipboard and
>>> save them to a thumb drive:
>>>
>>> reserved credentials (10002, 10005)
>>>
>>> adding group: /usr/sbin/groupadd -o -g 10005 10005
>>>
>>> groupadd: group 10005 exists
>>>
>>> adding user: /usr/sbin/useradd -m -u 10002 -g 10005 -c
>>> org.laptop.ViewSlidesActivity.10002 -d
>>> /home/olpc/isolation/1/uid_to_home_dir/10002 10002
>>>
>>> Creating mailbox file: File exists
>>>
>>> dropping privilege to (10002, 10005)
>>>
>>> chdir to /home/olpc/Activities/ViewSlides.activity
>>>
>>> umask(0)
>>>
>>> about to execve
>>>
>>> argv: dbus.Array([dbus.UTF8String('sugar-activity'),
>>> dbus.UTF8String('viewslides.ViewSlidesActivity'),
>>> dbus.UTF8String('-b'),
>>> dbus.UTF8String('org.laptop.ViewSlidesActivity'),
>>> dbus.UTF8String('-a'),
>>> dbus.UTF8String('9469a4295fc4c2a1c5bc89a049bc8046978bcd4d')],
>>> signature=dbus.Signature('s'))
>>>
>>> env: dbus.Dictionary({dbus.UTF8String('LOGNAME'):
>>> dbus.UTF8String('olpc'), 'USER': '10002', dbus.UTF8String('HOME'):
>>> '/home/olpc/isolation/1/uid_to_home_dir/10002',
>>> dbus.UTF8String('PATH'):
>>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/bin:/usr/bin:/bin'),
>>> dbus.UTF8String('DISPLAY'): dbus.UTF8String(':0'),
>>> dbus.UTF8String('LANG'): dbus.UTF8String('en_US.UTF-8'),
>>> dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
>>> dbus.UTF8String('TZ'): dbus.UTF8String('UTC'),
>>> dbus.UTF8String('XDG_SESSION_COOKIE'):
>>> dbus.UTF8String('953edcc5e38ef3d4eb1c4ec349fc8998-1251513204.25857-1875509082'),
>>> dbus.UTF8String('SESSION_MANAGER'):
>>> dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1312,unix/unix:/tmp/.ICE-unix/1312'),
>>> dbus.UTF8String('SHLVL'): dbus.UTF8String('1'),
>>> dbus.UTF8String('ICEAUTHORITY'):
>>> '/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
>>> dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
>>> dbus.UTF8String('SUGAR_BUNDLE_PATH'):
>>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity'),
>>> dbus.UTF8String('SUGAR_LOCALEDIR'):
>>> dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/locale'),
>>> dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
>>> dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
>>> '/home/olpc/isolation/1/uid_to_home_dir/10002',
>>> dbus.UTF8String('GTK2_RC_FILES'):
>>> dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc'),
>>> dbus.UTF8String('SUGAR_BUNDLE_ID'):
>>> dbus.UTF8String('org.laptop.ViewSlidesActivity'),
>>> dbus.UTF8String('DBUS_SESSION_BUS_ADDRESS'):
>>> dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=858a48de7c5f74d530c5570c4a989374'),
>>> 'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
>>> dbus.UTF8String('XAUTHORITY'):
>>> '/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
>>> dbus.UTF8String('GTK_IM_MODULE'):
>>> dbus.UTF8String('gtk-im-context-simple'),
>>> dbus.UTF8String('XSERVERAUTH'):
>>> dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'),
>>> dbus.UTF8String('PWD'): dbus.UTF8String('/home/olpc')},
>>> signature=dbus.Signature('ss'))
>>>
>>> closing all fds but (1, 2)
>>>
>>> {dbus.UTF8String('LOGNAME'): dbus.UTF8String('o

Re: [Sugar-devel] Read-only access to thumb drive forbidden by Rainbow?

2009-08-31 Thread Tomeu Vizoso
On Sun, Aug 30, 2009 at 20:32, Jim Simmons wrote:
> Tomeu,
>
> It turned out that fixing the problem with .olpc.store was pretty
> simple and I now have an Activity that is functional.  The next
> problem is, it works differently in .82 and .84.  In .82 every file on
> the thumb drive and SD card is treated as a Journal entry and listed
> out by the datastore API.  In .84 these files are not listed, so I
> have to use os.walk() to get them.  Unfortunately doing this means
> duplicate entries when the app is running in .82.  So it would be
> useful if I could tell when my os.walk() routine is needed and ONLY
> run that code when it is needed.  I'd prefer to do something like try
> to do something that the datastore API only allows in .84 and later
> and catch an exception, which I then use to determine whether to run
> the code or not.  Failing that, if I could detect the version of Sugar
> and base my code on that that would be OK.  I'm looking for something
> robust and future-proof.
>
> Any ideas?  Thanks again,

What about calling the mounts() method in the DS dbus service and
compare what it returns in 0.84 and what earlier?

In 0.84 and later we have this stub:

http://git.sugarlabs.org/projects/sugar-datastore/repos/mainline/blobs/master/src/carquinyol/datastore.py#line326

Regards,

Tomeu

> James Simmons
>
>
> On Sun, Aug 30, 2009 at 9:40 AM, Jim Simmons wrote:
>> Tomeu,
>>
>> Your suggestion was right on the money.  When I run a simple program
>> from Terminal that prints out the files it finds it goes through my SD
>> card (also mounted on /media) and seems to stall in the depths of the
>> .olpc_store directory.  What I think I need to do is write my own
>> walk-like function that ignores hidden directories.  I really should
>> have thought of your suggestion myself but everything ran so well on
>> my test boxes that I jumped to the conclusion that something on the XO
>> was the problem.
>>
>> Thanks again,
>>
>> James Simmons
>>
>>
>> On Sun, Aug 30, 2009 at 3:31 AM, Tomeu Vizoso wrote:
>>> On Sun, Aug 30, 2009 at 01:50, Jim Simmons wrote:
 Walter,

 I tried deleting /etc/olpc-security but that had no effect,  Even
 rebooting after deleting olpc-security had no effect.  I managed to
 copy the log messages from my previous efforts to the clipboard and
 save them to a thumb drive:

 reserved credentials (10002, 10005)

 adding group: /usr/sbin/groupadd -o -g 10005 10005

 groupadd: group 10005 exists

 adding user: /usr/sbin/useradd -m -u 10002 -g 10005 -c
 org.laptop.ViewSlidesActivity.10002 -d
 /home/olpc/isolation/1/uid_to_home_dir/10002 10002

 Creating mailbox file: File exists

 dropping privilege to (10002, 10005)

 chdir to /home/olpc/Activities/ViewSlides.activity

 umask(0)

 about to execve

 argv: dbus.Array([dbus.UTF8String('sugar-activity'),
 dbus.UTF8String('viewslides.ViewSlidesActivity'),
 dbus.UTF8String('-b'),
 dbus.UTF8String('org.laptop.ViewSlidesActivity'),
 dbus.UTF8String('-a'),
 dbus.UTF8String('9469a4295fc4c2a1c5bc89a049bc8046978bcd4d')],
 signature=dbus.Signature('s'))

 env: dbus.Dictionary({dbus.UTF8String('LOGNAME'):
 dbus.UTF8String('olpc'), 'USER': '10002', dbus.UTF8String('HOME'):
 '/home/olpc/isolation/1/uid_to_home_dir/10002',
 dbus.UTF8String('PATH'):
 dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/bin:/usr/bin:/bin'),
 dbus.UTF8String('DISPLAY'): dbus.UTF8String(':0'),
 dbus.UTF8String('LANG'): dbus.UTF8String('en_US.UTF-8'),
 dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
 dbus.UTF8String('TZ'): dbus.UTF8String('UTC'),
 dbus.UTF8String('XDG_SESSION_COOKIE'):
 dbus.UTF8String('953edcc5e38ef3d4eb1c4ec349fc8998-1251513204.25857-1875509082'),
 dbus.UTF8String('SESSION_MANAGER'):
 dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1312,unix/unix:/tmp/.ICE-unix/1312'),
 dbus.UTF8String('SHLVL'): dbus.UTF8String('1'),
 dbus.UTF8String('ICEAUTHORITY'):
 '/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
 dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
 dbus.UTF8String('SUGAR_BUNDLE_PATH'):
 dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity'),
 dbus.UTF8String('SUGAR_LOCALEDIR'):
 dbus.UTF8String('/home/olpc/Activities/ViewSlides.activity/locale'),
 dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
 dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
 '/home/olpc/isolation/1/uid_to_home_dir/10002',
 dbus.UTF8String('GTK2_RC_FILES'):
 dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc'),
 dbus.UTF8String('SUGAR_BUNDLE_ID'):
 dbus.UTF8String('org.laptop.ViewSlidesActivity'),
 dbus.UTF8String('DBUS_SESSION_BUS_ADDRESS'):
 dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=858a48de7c5f74d530c5570c4a989374'),
 'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',

Re: [Sugar-devel] Read-only access to thumb drive forbidden by Rainbow?

2009-09-01 Thread Jim Simmons
Tomeu,

I tried your suggestion to use datastore.mounts() and it was just what
I needed.  I hope that stub stays in the API until we can get everyone
off .82.

Thanks,

James Simmons

On Mon, Aug 31, 2009 at 3:05 AM, Tomeu Vizoso wrote:
>
> What about calling the mounts() method in the DS dbus service and
> compare what it returns in 0.84 and what earlier?
>
> In 0.84 and later we have this stub:
>
> http://git.sugarlabs.org/projects/sugar-datastore/repos/mainline/blobs/master/src/carquinyol/datastore.py#line326
>
> Regards,
>
> Tomeu
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel