Bug#299263: marked as done (gksu falsely grabs the xserver)

Debian Bug Tracking System owner@bugs.debian.org
Sun, 13 Mar 2005 09:34:07 -0800


Your message dated Sun, 13 Mar 2005 14:23:20 -0300
with message-id <1110734600.24921.19.camel@alface.horta>
and subject line Bug#299263: gksu falsely grabs the xserver
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 13 Mar 2005 01:43:45 +0000
>From raster@koto.vergenet.net Sat Mar 12 17:43:45 2005
Return-path: <raster@koto.vergenet.net>
Received: from koto.vergenet.net [210.128.90.7] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DAI8t-00034U-00; Sat, 12 Mar 2005 17:43:43 -0800
Received: by koto.vergenet.net (Postfix, from userid 1001)
	id 150E23402C; Sun, 13 Mar 2005 10:21:12 +0900 (JST)
Date: Sat, 12 Mar 2005 12:48:33 +0900
From: Carsten Haitzler (The Rasterman) <raster@rasterman.com>
To: submit@bugs.debian.org
Subject: gksu falsely grabs the xserver
Message-ID: <20050312124833.54ec561f@icky>
Organization: You expect me to be organized?
X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Pants: on
X-Cluestick: Get jiggy with it!
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0 tests=BAYES_00,DATE_IN_PAST_12_24,
	GUARANTEE,HAS_PACKAGE autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: gksu
Version: 1.2.2-1

gksu executes an X server grab - even though it is MANAGED by a window manager.
a window manager is another client. if you grab the xserver you lock the window
manager and every other x client OUT. the wm cannot display the window - ti
cannto move it, resize or do anything (or even give it focus) as gksu grabs x.
it effectively locks up the entire display until u go to a console and kill
gksu. the reason i am reporting this is it is just incorrect behavior entirely.
from a design ploint of view you cannot lock out the wm and expect your window
to display/work. if you want to grab the xserver bypass the wm and use an
override-redirect window for your main window. then this problem wont occur (as
you bypassed the wm entirely). as long as you create a normal managed window you
cannot grab the xserver and just sit and wait - no matter how paranoid about
security you are as it simply doesn't work within x's design (if it has worked
in the past its a race condition that you are LUCKY it works for some people).

(btw this will be the cause of those other kde lockup and gnome-session startup
block bug reports)

anyway - just fyi i'll explain a bit how x works and wm's etc.

an app requests to show its window - this requests gets redirected to another x
client (the wm) which then actually shows the window (adding borders, moving,
resizing etc.). if you grab the xserver display - you lock out ALL clients
except this one - INCLUDING the wm - that means if u try show, hide, move,
resize etc. your window the wm CANNOT do it. x wil still redirect all the show,
resize, move et.c requests -b ut they will just get queued for the wm to deal
with then the grab is over. the thing is its all client-server and asynchronous,
so the wm may still be DOING things after u have asked to be shown or resized.
it may do it in multiple steps by changing desktop,s hiding other windows and
more. the wm is the one that chooses what to do and how to do it - your requests
are merely hints to it. so back to the grab problem. you grab the x display but
the wm may still be in the middle of drawing window borders, or re-arranging
windows to make room for yours etc. when you do this. it may be that your window
is not visible or accessible yet and thus seemingly everything locks up. :)

:)

i suggest the DEFAULT setup for gksu is to NOT grab the xserver, and IF it is
turned on, do NOT use a managed window - bypass the wm and create an unmanaged
override redirect window. otherwise i can GUARANTEE gksu will have bugs on
multiple system in multiple wm's all the time and there is nothing the wm can do
about it. :)

imho this is a grave functionality bug as it is a major design flaw that can
seemingly lock up an entire machine (unless u ssh in or go to a console and
investigate and are smart enough to know to killall gksu as that is the problem)

:)

(NB - i am referring to grabbing the xserver, not grabbing the keyboard and
mouse which imho is just fine and reasonable security measures)
:)

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster@rasterman.com
裸好多                              raster@deephackmode.org
Tokyo, Japan (東京 日本)

---------------------------------------
Received: (at 299263-done) by bugs.debian.org; 13 Mar 2005 17:23:27 +0000
>From kov@debian.org Sun Mar 13 09:23:27 2005
Return-path: <kov@debian.org>
Received: from linares.terra.com.br [200.154.55.228] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DAWoI-0007IY-00; Sun, 13 Mar 2005 09:23:26 -0800
Received: from estero.terra.com.br (estero.terra.com.br [200.154.55.138])
	by linares.terra.com.br (Postfix) with ESMTP
	id 05D65DDC863; Sun, 13 Mar 2005 14:23:25 -0300 (BRT)
X-Terra-Karma: -2%
X-Terra-Hash: 80a4d8efe0c94cf7c66b48454144cda4
Received: from alface.horta (unknown [200.199.246.58])
	(authenticated user bhz52091)
	by estero.terra.com.br (Postfix) with ESMTP
	id AB2B83C023; Sun, 13 Mar 2005 14:23:23 -0300 (BRT)
Received: from localhost ([127.0.0.1] helo=alface.horta)
	by alface.horta with esmtp (Exim 4.50)
	id 1DAWoC-0005r9-Gg; Sun, 13 Mar 2005 14:23:20 -0300
Subject: Re: Bug#299263: gksu falsely grabs the xserver
From: Gustavo Noronha Silva <kov@debian.org>
To: Carsten Haitzler <raster@rasterman.com>,
	299263-done@bugs.debian.org
In-Reply-To: <20050312124833.54ec561f@icky>
References: <20050312124833.54ec561f@icky>
Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-DiH3JpsD4NILZu2dnSVS"
Organization: Debian
Date: Sun, 13 Mar 2005 14:23:20 -0300
Message-Id: <1110734600.24921.19.camel@alface.horta>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.4 
Delivered-To: 299263-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 


--=-DiH3JpsD4NILZu2dnSVS
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Em S=C3=A1b, 2005-03-12 =C3=A0s 12:48 +0900, Carsten Haitzler escreveu:
> gksu executes an X server grab - even though it is MANAGED by a window ma=
nager.
> a window manager is another client. if you grab the xserver you lock the =
window
> manager and every other x client OUT. the wm cannot display the window - =
ti
> cannto move it, resize or do anything (or even give it focus) as gksu gra=
bs x.

Since gksu 1.2.4 X sever is not grabbed anymore, just keyboard and
mouse. Take a look here: http://bugs.debian.org/297972

Would you mind taking a look at that version (which should work, thus my
closing this bug) and reopening the bug if it does not?

> anyway - just fyi i'll explain a bit how x works and wm's etc.

I'll study X and wm's a bit more deeply as soon as I have the time to do
so. In the meanwhile thanks a lot for the info you provided! =3D)

Do you have any specific pointers to the 'unmanaged' window creation,
for now?

Thanks!

--=20
  kov@debian.org: Gustavo Noronha <http://couve.no-ip.org/~kov/>
 Debian: <http://www.debian.org/>  *  <http://www.debian-br.org/>

--=-DiH3JpsD4NILZu2dnSVS
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Esta =?ISO-8859-1?Q?=E9?= uma parte de mensagem
	assinada digitalmente

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQBCNHcHt1anjIgqbEsRAqAIAJwN0eeM4RJIhsvf3Amy2vOWTyclngCeJXv+
bDuNQOGETmV2WEUzQH+rC9U=
=trkM
-----END PGP SIGNATURE-----

--=-DiH3JpsD4NILZu2dnSVS--