[apparmor] [PATCH] 0001-fix-aa-sandbox-race.patch
Seth Arnold
seth.arnold at canonical.com
Fri Feb 15 17:48:37 UTC 2013
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?
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130215/49f2c07b/attachment.pgp>
More information about the AppArmor
mailing list