[Pkg-utopia-maintainers] Bug#422349: dbus: Please add support for integrating with libpam-foreground

Petter Reinholdtsen pere at hungry.com
Sat May 5 10:35:10 UTC 2007


Package: dbus
Version: 1.0.2-1
Tags: patch

For local hotplug devices to work in a large installation, with
thousand of machines and tens of thousand of users, like here at the
University of Oslo where I work, it is not possible to add users
globally to the plugdev group.

The supported solution from dbus and hal seem to be to use the
pam_console module available from the pam-redhat package, and let it
create /var/run/console/<username> when the user log in, and remove it
when it logs out again.  The pam-redhat package is not in Debian.

An alternative solution is to use the libpam-foreground PAM module to
pass information about locally logged in users as
/var/run/console/<username>:<console#>, and patch dbus to recognize
these files as well.  This is the approach used by Debian at the
moment, and they use this patch.  Please apply it to the Debian
version of dbus, to make it possible to enable hotplug devices in a
large scale installation.

diff -Nur dbus-1.0.2/dbus/dbus-sysdeps-util-unix.c dbus-1.0.2.new/dbus/dbus-sysdeps-util-unix.c
--- dbus-1.0.2/dbus/dbus-sysdeps-util-unix.c	2006-12-11 20:21:10.000000000 +0100
+++ dbus-1.0.2.new/dbus/dbus-sysdeps-util-unix.c	2006-12-13 14:07:50.000000000 +0100
@@ -43,6 +43,7 @@
 #include <sys/socket.h>
 #include <dirent.h>
 #include <sys/un.h>
+#include <glob.h>
 
 #ifdef HAVE_SYS_SYSLIMITS_H
 #include <sys/syslimits.h>
@@ -359,6 +360,7 @@
 
   DBusString f;
   dbus_bool_t result;
+  glob_t gl;
 
   result = FALSE;
   if (!_dbus_string_init (&f))
@@ -380,7 +382,18 @@
       goto out;
     }
 
-  result = _dbus_file_exists (_dbus_string_get_const_data (&f));
+  /* check whether the user is at  any console */
+  if (!_dbus_string_append (&f, ":*"))
+    {
+      _DBUS_SET_OOM (error);
+      goto out;
+    }
+
+  if (glob (_dbus_string_get_const_data (&f), 0, NULL, &gl))
+      goto out;
+
+  result = gl.gl_pathc > 0;
+  globfree (&gl);
 
  out:
   _dbus_string_free (&f);




More information about the Pkg-utopia-maintainers mailing list