Package: libgksu2-0
Version: 2.0.5-2
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

gksu_sudo_full() sets its end of the pipe from sudo's stderr to be
non-blocking.  Once it has found a password prompt and sent the
password, it makes it blocking again.  Then it reads from the pipe
and prints what it reads, until that fails.  Then it cleans up and
returns.

If sudo does not prompt for a password, the function never sets the
pipe to be non-blocking, so the attempt to read from the pipe fails
immediately with error EAGAIN.  It returns, closing its end of the
pipe.  The child process will then receive SIGPIPE (or error EPIPE) if
it tries to write to stderr.

To demonstrate this, run:
    sudo -v && gksudo "sh -c 'sleep 5; ls >&2'"

This patch fixes the bug:

- --- libgksu-2.0.5.orig/libgksu/libgksu.c
+++ libgksu-2.0.5/libgksu/libgksu.c
@@ -2637,6 +2637,9 @@
          if (context->debug)
            fprintf (stderr, "No password prompt found; we'll assume we don't 
need a password.\n");
 
+         /* turn NONBLOCK off */
+         fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & 
~O_NONBLOCK);
+
          should_display = gconf_client_get_bool (context->gconf_client,
                                                  BASE_PATH 
"display-no-pass-info", NULL);
 
- --- END ---

- -- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (100, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-3-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libgksu2-0 depends on:
ii  gconf2                 2.20.1-2+b1       GNOME configuration database syste
ii  libatk1.0-0            1.20.0-1          The ATK accessibility toolkit
ii  libc6                  2.7-6             GNU C Library: Shared libraries
ii  libcairo2              1.4.14-1          The Cairo 2D vector graphics libra
ii  libfontconfig1         2.5.0-2           generic font configuration library
ii  libfreetype6           2.3.5-1+b1        FreeType 2 font engine, shared lib
ii  libgconf2-4            2.20.1-2+b1       GNOME configuration database syste
ii  libglade2-0            1:2.6.2-1         library to load .glade files at ru
ii  libglib2.0-0           2.14.5-2          The GLib library of C routines
ii  libgnome-keyring0      2.20.3-1          GNOME keyring services library
ii  libgtk2.0-0            2.12.5-2          The GTK+ graphical user interface 
ii  libgtop2-7             2.20.1-1          gtop system monitoring library
ii  liborbit2              1:2.14.10-0.1     libraries for ORBit2 - a CORBA ORB
ii  libpango1.0-0          1.18.4-1          Layout and rendering of internatio
ii  libpng12-0             1.2.15~beta5-3    PNG library - runtime
ii  libstartup-notificatio 0.9-1             library for program launch feedbac
ii  libx11-6               2:1.0.3-7         X11 client-side library
ii  libxml2                2.6.31.dfsg-1     GNOME XML library
ii  libxrender1            1:0.9.4-1         X Rendering Extension client libra
ii  xauth                  1:1.0.2-2         X authentication utility
ii  xbase-clients          1:7.3+10          miscellaneous X clients - metapack
ii  zlib1g                 1:1.2.3.3.dfsg-11 compression library - runtime

Versions of packages libgksu2-0 recommends:
ii  sudo                       1.6.9p11-1+b1 Provide limited super user privile

- -- no debconf information

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

iD8DBQFHpI3F79ZNCRIGYgcRAs7KAKCOxx+FYLkGWNSwGoQDzLpLgkFDeACgzCx/
5M2J/HVJdeJAF6q1qWKPJ3c=
=ulqn
-----END PGP SIGNATURE-----



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to