Package: powersaved
Version: 0.15.20-3
Followup-For: Bug #421511

Hi,

using slim, I can reproduce this, there is no display in the commandline, and
it thus fails to recognize the correct user for the X server. Using startx
directly, it fails to get the display but get the correct user.

Attached patch assume the display is :0 if no display is present in
commandline. It wont work for remote display but I don't think it's a common
setup for a power management daemon.

Cheers,
--
Yves-Alexis


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.27-rc5+drm-next (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages powersaved depends on:
ii  adduser                       3.110      add and remove users and groups
ii  dbus                          1.2.1-3    simple interprocess messaging syst
ii  hal                           0.5.11-3   Hardware Abstraction Layer
ii  libc6                         2.7-13     GNU C Library: Shared libraries
ii  libdbus-1-3                   1.2.1-3    simple interprocess messaging syst
ii  libdbus-glib-1-2              0.76-1     simple interprocess messaging syst
ii  libgcc1                       1:4.3.2-1  GCC support library
ii  libglib2.0-0                  2.18.0-1   The GLib library of C routines
ii  liblazy1                      0.2-5      convenience functions for D-Bus, H
ii  libpowersave11                0.15.20-3  power management daemon - shared l
ii  libstdc++6                    4.3.2-1    The GNU Standard C++ Library v3
ii  lsb-base                      3.2-20     Linux Standard Base 3.2 init scrip

Versions of packages powersaved recommends:
ii  acpid                         1.0.6-10   Utilities for using ACPI power man
ii  cpufrequtils                  004-2      utilities to deal with the cpufreq

Versions of packages powersaved suggests:
pn  kpowersave                    <none>     (no description available)
ii  zenity                        2.22.1-2   Display graphical dialog boxes fro

-- no debconf information
--- /usr/lib/powersave/wttyhx.old       2008-07-18 18:52:58.000000000 +0200
+++ /usr/lib/powersave/wttyhx   2008-09-21 17:33:05.000000000 +0200
@@ -111,7 +111,8 @@
        done
        XTTYS[$n]=${FDL#/dev/tty}
        # Get the display number from the commandline
-       DISP=`tr '\0' '\40' < $PID/cmdline | sed 's#^.*:\([0-9]\+\).*$#\1\n#'`
+       DISP=`tr '\0' '\40' < $PID/cmdline | grep : | sed 
's#^.*:\([0-9]\+\).*$#\1\n#'`
+       [ -z $DISP ] && DISP="0"
        DISP_PROC[$n]=$DISP
        # Finally get the user that owns the X server. We need different
        # methods to get the real X user, because it depends on the version of

Reply via email to