[apparmor] [PATCH] 0001-fix-aa-sandbox-race.patch
Jamie Strandboge
jamie at canonical.com
Fri Feb 15 19:56:14 UTC 2013
On 02/15/2013 11:48 AM, Seth Arnold wrote:
> On Fri, Feb 15, 2013 at 11:10:24AM -0600, Jamie Strandboge wrote:
>> + for i in range(self.timeout): # Up to self.timeout seconds to start
>> rc, out = cmd(['xpra', 'list'])
>> +
>> + if 'DEAD session at %s' % self.display in out:
>> + error("xpra session at '%s' died" % self.display, do_exit=False)
>> + break
>> +
>> + search = 'LIVE session at %s' % self.display
>> + if search in out:
>> started = True
>> break
>> time.sleep(1)
>> + debug("Could not find '%s' in:\n" % search)
>> + debug(out)
>
> Could this sleep be changed to .5 seconds without too much overhead? Or,
> how long does it usually take?
>
This could be reduced to 0.5 seconds-- it isn't normally hit.
>> if not started:
>> sys.stdout.flush()
>> @@ -638,6 +662,17 @@
>>
>> self.pids.append(listener_attach)
>>
>> + # Make sure that a client has attached
>> + for i in range(self.timeout): # up to self.timeout seconds to attach
>> + time.sleep(1)
>> + rc, out = cmd (['xpra', 'info', self.display])
>> + search = 'clients=1'
>> + if search in out:
>> + debug("Client successfully attached!")
>> + break
>> + debug("Could not find '%s' in:\n" % search)
>> + debug(out)
>> +
>> msg("TODO: filter '~/.xpra/run-xpra'")
>
> How about this sleep, too? Could the sleep be profitably moved after the
> check, to optimistically assume that it might succeed immediately?
>
> Thanks Jamie
>
In my experience, you need the one second here which is why I put it first.
Also, I want to mention that these patches improve things, but don't
make aa-sandbox with xpra bullet-proof. Xpra is kinda finicky and isn't
easily drivable so there are other bugs in there, but we can fix them as
we find them.
--
Jamie Strandboge http://www.ubuntu.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130215/d1e31ee7/attachment.pgp>
More information about the AppArmor
mailing list