From hal-commit-bounces@lists.freedesktop.org Mon Apr 11 20:51:54 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx25.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DL40o-00064s-00 for
	danny.kukawka@web.de; Mon, 11 Apr 2005 20:51:54 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 13EA59EB40; Mon, 11 Apr 2005
	11:51:54 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	6CCE49E768; Mon, 11 Apr 2005 11:51:52 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050411185152.6CCE49E768@gabe.freedesktop.org>
Date: Mon, 11 Apr 2005 11:51:52 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal ChangeLog,1.501,1.502 configure.in,1.75,1.76
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState: N
X-KMail-SignatureState: N
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000002-0010
Mime-Version: 1.0

Update of /cvs/hal/hal
In directory gabe:/tmp/cvs-serv29346

Modified Files:
	ChangeLog configure.in 
Log Message:
2005-04-11  David Zeuthen  <davidz@redhat.com>

	* configure.in: Add /var/lib/music to the search path for pci.ids.
	Patch from Murray Cumming <murrayc@murrayc.com>, fdo bug #2547.



Index: ChangeLog
===================================================================
RCS file: /cvs/hal/hal/ChangeLog,v
retrieving revision 1.501
retrieving revision 1.502
diff -u -d -r1.501 -r1.502
--- ChangeLog	8 Apr 2005 18:10:19 -0000	1.501
+++ ChangeLog	11 Apr 2005 18:51:49 -0000	1.502
@@ -1,3 +1,8 @@
+2005-04-11  David Zeuthen  <davidz@redhat.com>
+
+	* configure.in: Add /var/lib/music to the search path for pci.ids.
+	Patch from Murray Cumming <murrayc@murrayc.com>, fdo bug #2547.
+
 2005-04-08  David Zeuthen  <davidz@redhat.com>
 
 	Make all hal helpers use a direct connection to hald rather than

Index: configure.in
===================================================================
RCS file: /cvs/hal/hal/configure.in,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- configure.in	8 Apr 2005 18:10:19 -0000	1.75
+++ configure.in	11 Apr 2005 18:51:50 -0000	1.76
@@ -39,7 +39,7 @@
 if ! test -z "$with_hwdata" ; then
    HWDATA_DIR="$with_hwdata"
 else
-   for dir in /usr/share/hwdata /usr/share/misc /usr/share; do
+   for dir in /usr/share/hwdata /usr/share/misc /usr/share /var/lib/misc; do
       AC_CHECK_FILE($dir/pci.ids,HWDATA_DIR=$dir)
    done
 fi

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Mon Apr 11 20:51:58 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx26.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DL40s-0003Wi-00 for
	danny.kukawka@web.de; Mon, 11 Apr 2005 20:51:58 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 507079EB4C; Mon, 11 Apr 2005
	11:51:54 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	853249EA13; Mon, 11 Apr 2005 11:51:52 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050411185152.853249EA13@gabe.freedesktop.org>
Date: Mon, 11 Apr 2005 11:51:52 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal/hald hald_dbus.c,1.33,1.34
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState: N
X-KMail-SignatureState: N
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000004-0010
Mime-Version: 1.0

Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv29346/hald

Modified Files:
	hald_dbus.c 
Log Message:
2005-04-11  David Zeuthen  <davidz@redhat.com>

	* configure.in: Add /var/lib/music to the search path for pci.ids.
	Patch from Murray Cumming <murrayc@murrayc.com>, fdo bug #2547.



Index: hald_dbus.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald_dbus.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- hald_dbus.c	8 Apr 2005 18:10:19 -0000	1.33
+++ hald_dbus.c	11 Apr 2005 18:51:50 -0000	1.34
@@ -2395,10 +2395,12 @@
 hald_dbus_filter_function (DBusConnection * connection,
 			   DBusMessage * message, void *user_data)
 {
+	/*
 	HAL_INFO (("obj_path=%s interface=%s method=%s", 
 		   dbus_message_get_path(message), 
 		   dbus_message_get_interface(message),
 		   dbus_message_get_member(message)));
+	*/
 
 	if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected") &&
 	    strcmp (dbus_message_get_path (message), DBUS_PATH_LOCAL) == 0) {

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Mon Apr 11 20:52:10 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx33.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DL414-0001TW-00 for
	danny.kukawka@web.de; Mon, 11 Apr 2005 20:52:10 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id A185E9EB40; Mon, 11 Apr 2005
	11:52:09 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	33B2F9E768; Mon, 11 Apr 2005 11:52:08 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050411185208.33B2F9E768@gabe.freedesktop.org>
Date: Mon, 11 Apr 2005 11:52:08 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal ChangeLog, 1.372.2.46, 1.372.2.47 configure.in, 1.57.2.17,
	1.57.2.18
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState: N
X-KMail-SignatureState: N
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000006-0010
Mime-Version: 1.0

Update of /cvs/hal/hal
In directory gabe:/tmp/cvs-serv29422

Modified Files:
      Tag: hal-0_4-stable-branch
	ChangeLog configure.in 
Log Message:
2005-04-11  David Zeuthen  <davidz@redhat.com>

	* configure.in: Revert version from 0.4.7.cvs20050128c to 0.4.7.
	Add /var/lib/misc to the search path for pci.ids. From Murray
	Cumming <murrayc@murrayc.com>, fdo bug #2547



Index: ChangeLog
===================================================================
RCS file: /cvs/hal/hal/ChangeLog,v
retrieving revision 1.372.2.46
retrieving revision 1.372.2.47
diff -u -d -r1.372.2.46 -r1.372.2.47
--- ChangeLog	4 Apr 2005 15:54:21 -0000	1.372.2.46
+++ ChangeLog	11 Apr 2005 18:52:05 -0000	1.372.2.47
@@ -1,3 +1,9 @@
+2005-04-11  David Zeuthen  <davidz@redhat.com>
+
+	* configure.in: Revert version from 0.4.7.cvs20050128c to 0.4.7.
+	Add /var/lib/misc to the search path for pci.ids. From Murray
+	Cumming <murrayc@murrayc.com>, fdo bug #2547
+
 2005-04-04  David Zeuthen  <davidz@redhat.com>
 
 	* po/zh_TW.po: New file from chaoweilun@pcmail.com.tw

Index: configure.in
===================================================================
RCS file: /cvs/hal/hal/configure.in,v
retrieving revision 1.57.2.17
retrieving revision 1.57.2.18
diff -u -d -r1.57.2.17 -r1.57.2.18
--- configure.in	4 Apr 2005 15:54:21 -0000	1.57.2.17
+++ configure.in	11 Apr 2005 18:52:06 -0000	1.57.2.18
@@ -1,8 +1,8 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT(hal, 0.4.7.cvs20050128c, david@fubar.dk)
-AM_INIT_AUTOMAKE(hal, 0.4.7.cvs20050128c)
+AC_INIT(hal, 0.4.7, david@fubar.dk)
+AM_INIT_AUTOMAKE(hal, 0.4.7)
 AM_CONFIG_HEADER(config.h)
 AM_MAINTAINER_MODE
 
@@ -22,7 +22,7 @@
 if ! test -z "$with_hwdata" ; then
    HWDATA_DIR="$with_hwdata"
 else
-   for dir in /usr/share/hwdata /usr/share/misc /usr/share; do
+   for dir in /usr/share/hwdata /usr/share/misc /usr/share /var/lib/misc; do
       AC_CHECK_FILE($dir/pci.ids,HWDATA_DIR=$dir)
    done
 fi

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Thu Apr 14 05:19:04 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx31.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DLusi-00034Y-00 for
	danny.kukawka@web.de; Thu, 14 Apr 2005 05:19:04 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 8D5649EBD3; Wed, 13 Apr 2005
	20:19:03 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	DD8A49EBC2; Wed, 13 Apr 2005 20:19:00 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050414031900.DD8A49EBC2@gabe.freedesktop.org>
Date: Wed, 13 Apr 2005 20:19:00 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal/hald hald.c,1.33,1.34
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000008-0010
Mime-Version: 1.0

Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv8858/hald

Modified Files:
	hald.c 
Log Message:
2005-04-13  David Zeuthen  <davidz@redhat.com>

        Some patches from Martin Pitt <martin@piware.de>.

        * tools/device-manager/Representation.py:
        (Representation.load_and_scale_icon): Use TRUE instead of gtk.TRUE
        since the latter is deprecated

        * hald/hald.c (main): Drop privileges a bit later so we have a
        chance to bind to the netlink socket



Index: hald.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- hald.c	8 Apr 2005 18:10:19 -0000	1.33
+++ hald.c	14 Apr 2005 03:18:58 -0000	1.34
@@ -490,9 +490,6 @@
 	/* will fork into two; only the child will return here if we are successful */
 	/*master_slave_setup ();*/
 
-	if (!retain_privs)
-		drop_privileges();
-
 	loop = g_main_loop_new (NULL, FALSE);
 
 	HAL_INFO ((PACKAGE_STRING));
@@ -593,6 +590,9 @@
 	/* initialize operating system specific parts */
 	osspec_init ();
 
+	if (!retain_privs)
+		drop_privileges();
+
 	hald_is_initialising = TRUE;
 
 	/* detect devices */

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Thu Apr 14 05:19:04 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx29.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DLusi-0004QX-00 for
	danny.kukawka@web.de; Thu, 14 Apr 2005 05:19:04 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id F26459EBE0; Wed, 13 Apr 2005
	20:19:03 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	F2C7F9EBC8; Wed, 13 Apr 2005 20:19:00 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050414031900.F2C7F9EBC8@gabe.freedesktop.org>
Date: Wed, 13 Apr 2005 20:19:00 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal/tools/device-manager Representation.py,1.12,1.13
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 0000000a-0010
Mime-Version: 1.0

Update of /cvs/hal/hal/tools/device-manager
In directory gabe:/tmp/cvs-serv8858/tools/device-manager

Modified Files:
	Representation.py 
Log Message:
2005-04-13  David Zeuthen  <davidz@redhat.com>

        Some patches from Martin Pitt <martin@piware.de>.

        * tools/device-manager/Representation.py:
        (Representation.load_and_scale_icon): Use TRUE instead of gtk.TRUE
        since the latter is deprecated

        * hald/hald.c (main): Drop privileges a bit later so we have a
        chance to bind to the netlink socket



Index: Representation.py
===================================================================
RCS file: /cvs/hal/hal/tools/device-manager/Representation.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Representation.py	19 Jan 2005 22:26:47 -0000	1.12
+++ Representation.py	14 Apr 2005 03:18:58 -0000	1.13
@@ -11,7 +11,7 @@
     def load_and_scale_icon(self, path):
         """Helper function for loading an icon and scaling it to 16x16"""
         orig = gtk.gdk.pixbuf_new_from_file(path)
-        icon = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, gtk.TRUE, 8, 16, 16)
+        icon = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, TRUE, 8, 16, 16)
         orig.scale(icon, 0, 0, 16, 16,
                    0, 0,
                    16.0/orig.get_width(),

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Thu Apr 14 05:19:04 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx33.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DLush-0000zS-00 for
	danny.kukawka@web.de; Thu, 14 Apr 2005 05:19:04 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 1873C9EBC8; Wed, 13 Apr 2005
	20:19:03 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	CEF4C9E808; Wed, 13 Apr 2005 20:19:00 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050414031900.CEF4C9E808@gabe.freedesktop.org>
Date: Wed, 13 Apr 2005 20:19:00 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal ChangeLog,1.502,1.503
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 0000000c-0010
Mime-Version: 1.0

Update of /cvs/hal/hal
In directory gabe:/tmp/cvs-serv8858

Modified Files:
	ChangeLog 
Log Message:
2005-04-13  David Zeuthen  <davidz@redhat.com>

        Some patches from Martin Pitt <martin@piware.de>.

        * tools/device-manager/Representation.py:
        (Representation.load_and_scale_icon): Use TRUE instead of gtk.TRUE
        since the latter is deprecated

        * hald/hald.c (main): Drop privileges a bit later so we have a
        chance to bind to the netlink socket



Index: ChangeLog
===================================================================
RCS file: /cvs/hal/hal/ChangeLog,v
retrieving revision 1.502
retrieving revision 1.503
diff -u -d -r1.502 -r1.503
--- ChangeLog	11 Apr 2005 18:51:49 -0000	1.502
+++ ChangeLog	14 Apr 2005 03:18:58 -0000	1.503
@@ -1,3 +1,14 @@
+2005-04-13  David Zeuthen  <davidz@redhat.com>
+
+	Some patches from Martin Pitt <martin@piware.de>.
+
+	* tools/device-manager/Representation.py:
+	(Representation.load_and_scale_icon): Use TRUE instead of gtk.TRUE
+	since the latter is deprecated
+
+	* hald/hald.c (main): Drop privileges a bit later so we have a
+	chance to bind to the netlink socket
+
 2005-04-11  David Zeuthen  <davidz@redhat.com>
 
 	* configure.in: Add /var/lib/music to the search path for pci.ids.

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Thu Apr 14 06:27:03 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx22.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DLvwV-0005kq-00 for
	danny.kukawka@web.de; Thu, 14 Apr 2005 06:27:03 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 7D5FB9EBD3; Wed, 13 Apr 2005
	21:27:02 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	A8B279E997; Wed, 13 Apr 2005 21:26:58 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050414042658.A8B279E997@gabe.freedesktop.org>
Date: Wed, 13 Apr 2005 21:26:58 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal/hald/linux2 apm.c,1.8,1.9
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 0000000e-0010
Mime-Version: 1.0

Update of /cvs/hal/hal/hald/linux2
In directory gabe:/tmp/cvs-serv12483/hald/linux2

Modified Files:
	apm.c 
Log Message:
2005-04-14  David Zeuthen  <davidz@redhat.com>

        Make hal handle APM nicely.

        * hald/linux2/apm.c (apm_poll): New function
        (battery_refresh): Hmm, APM reports -1 if battery is absent.
        s/system.ac_adapter/ac_adapter/ - Patch from Bill
        Nottingham <notting@redhat.com>
        (apm_synthesize_hotplug_events): Add time for APM polling



Index: apm.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/apm.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- apm.c	17 Mar 2005 17:19:43 -0000	1.8
+++ apm.c	14 Apr 2005 04:26:56 -0000	1.9
@@ -64,6 +64,26 @@
 	int using_minutes;
 } APMInfo;
 
+#define APM_POLL_INTERVAL 2000
+
+static gboolean
+apm_poll (gpointer data)
+{
+	GSList *i;
+	GSList *devices;
+
+	devices = hal_device_store_match_multiple_key_value_string (hald_get_gdl (),
+								    "linux.apm_path",
+								    "/proc/apm");
+	for (i = devices; i != NULL; i = g_slist_next (i)) {
+		HalDevice *d;		
+		d = HAL_DEVICE (i->data);
+		apm_rescan_device (d);
+	}
+
+	return TRUE;
+}
+
 static gboolean 
 read_from_apm (const char *apm_file, APMInfo *i)
 {
@@ -120,7 +140,7 @@
 
 	read_from_apm (path, &i);
 
-	if (i.battery_percentage == 0) {
+	if (i.battery_percentage <= 0) {
 		device_property_atomic_update_begin ();
 		hal_device_property_remove (d, "battery.is_rechargeable");
 		hal_device_property_remove (d, "battery.rechargeable.is_charging");
@@ -129,6 +149,7 @@
 		hal_device_property_remove (d, "battery.charge_level.current");
 		hal_device_property_remove (d, "battery.charge_level.last_full");
 		hal_device_property_remove (d, "battery.charge_level.design");
+		hal_device_property_set_bool (d, "battery.present", FALSE);
 		device_property_atomic_update_end ();		
 	} else {
 		device_property_atomic_update_begin ();
@@ -171,8 +192,8 @@
 		return FALSE;
 
 	hal_device_property_set_string (d, "info.product", "AC Adapter");
-	hal_device_property_set_string (d, "info.category", "system.ac_adapter");
-	hal_device_add_capability (d, "system.ac_adapter");
+	hal_device_property_set_string (d, "info.category", "ac_adapter");
+	hal_device_add_capability (d, "ac_adapter");
 
 	read_from_apm(path, &i);
 
@@ -230,6 +251,10 @@
 	hotplug_event->apm.apm_type = APM_TYPE_AC_ADAPTER;
 	hotplug_event_enqueue (hotplug_event);
 
+	g_timeout_add (APM_POLL_INTERVAL,
+		       apm_poll,
+		       NULL);
+
 out:
 	return ret;
 }

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Thu Apr 14 06:27:03 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx33.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DLvwU-00077m-00 for
	danny.kukawka@web.de; Thu, 14 Apr 2005 06:27:03 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 42C549E9F4; Wed, 13 Apr 2005
	21:27:02 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	8BEE49E808; Wed, 13 Apr 2005 21:26:58 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050414042658.8BEE49E808@gabe.freedesktop.org>
Date: Wed, 13 Apr 2005 21:26:58 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal ChangeLog,1.503,1.504
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState: N
X-KMail-SignatureState: N
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000010-0010
Mime-Version: 1.0

Update of /cvs/hal/hal
In directory gabe:/tmp/cvs-serv12483

Modified Files:
	ChangeLog 
Log Message:
2005-04-14  David Zeuthen  <davidz@redhat.com>

        Make hal handle APM nicely.

        * hald/linux2/apm.c (apm_poll): New function
        (battery_refresh): Hmm, APM reports -1 if battery is absent.
        s/system.ac_adapter/ac_adapter/ - Patch from Bill
        Nottingham <notting@redhat.com>
        (apm_synthesize_hotplug_events): Add time for APM polling



Index: ChangeLog
===================================================================
RCS file: /cvs/hal/hal/ChangeLog,v
retrieving revision 1.503
retrieving revision 1.504
diff -u -d -r1.503 -r1.504
--- ChangeLog	14 Apr 2005 03:18:58 -0000	1.503
+++ ChangeLog	14 Apr 2005 04:26:56 -0000	1.504
@@ -1,3 +1,13 @@
+2005-04-14  David Zeuthen  <davidz@redhat.com>
+
+	Make hal handle APM nicely.
+
+	* hald/linux2/apm.c (apm_poll): New function
+	(battery_refresh): Hmm, APM reports -1 if battery is absent.
+	s/system.ac_adapter/ac_adapter/ - Patch from Bill
+	Nottingham <notting@redhat.com>
+	(apm_synthesize_hotplug_events): Add time for APM polling
+
 2005-04-13  David Zeuthen  <davidz@redhat.com>
 
 	Some patches from Martin Pitt <martin@piware.de>.

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Fri Apr  8 20:10:26 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx33.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DJxw1-0006If-00 for
	danny.kukawka@web.de; Fri, 08 Apr 2005 20:10:26 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 060289EB9D; Fri,  8 Apr 2005
	11:10:25 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	4C0FF9EB9D; Fri,  8 Apr 2005 11:10:22 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050408181022.4C0FF9EB9D@gabe.freedesktop.org>
Date: Fri,  8 Apr 2005 11:10:22 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal/hald hald.c, 1.32, 1.33 hald_dbus.c, 1.32, 1.33 hald_dbus.h,
	1.6, 1.7 util.c, 1.13, 1.14
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState: N
X-KMail-SignatureState: N
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000012-0010
Mime-Version: 1.0

Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv32581/hald

Modified Files:
	hald.c hald_dbus.c hald_dbus.h util.c 
Log Message:
2005-04-08  David Zeuthen  <davidz@redhat.com>

	Make all hal helpers use a direct connection to hald rather than
	going through the bus. This is for both performance and security
	reasons. Also, fix the reconnect issue and don't connect to the
	system message bus before probing is done.

	* configure.in: Require dbus 0.33; that, for now, means D-BUS CVS
	HEAD since it requires the patch in fd.o bug #2889 and D-BUS made
	a post-release version bump. I'll look into doing a D-BUS release
	soon.

	* libhal/libhal.h: Export prototype for libhal_ctx_init_direct()

	* libhal/libhal.c (libhal_ctx_init_direct): New convenience function
	for connecting directly to hald instead of going through the message
	bus (requires the address in the HALD_DIRECT_ADDR environment variable)

	* hald/util.c (hal_util_helper_invoke): Export the local hald dbus
	server address in HALD_DIRECT_ADDR

	* hald/hald_dbus.c (manager_send_signal_device_added): Handle the
	case where we're not connected to the system message bus
	(manager_send_signal_device_removed): -do-
	(manager_send_signal_new_capability): -do-
	(device_property_atomic_update_end): -do-
	(device_send_signal_property_modified): -do-
	(device_send_signal_condition): -do-
	(device_set_property): Always allow local interface
	(device_add_capability): -do-
	(device_remove_property): -do-
	(device_rescan): -do-
	(device_reprobe): -do-
	(device_emit_condition): -do-
	(hald_dbus_filter_handle_methods): New function
	(hald_dbus_filter_function): Move bulk of functionality to the new
	hald_dbus_filter_handle_methods() and pass local_interface==FALSE.
	Handle Disconnect from local libdbus properly and attempt to
	reconnect to the system message bus every so often (every 3 secs)
	(local_server_message_handler): New function
	(local_server_unregister_handler): New function
	(local_server_handle_connection): New function
	(hald_dbus_local_server_addr): New function
	(hald_dbus_local_server_init): New function

	* hald/hald.c (main): Register a local dbus server instead of
	connection to the system bus as startup
	(osspec_probe_done): Only connect to the system bus once probing
	is done

	* tools/fstab-sync.c (main): Use direct connection

	* hald/linux2/probing/probe-volume.c (main): Use direct connection

	* hald/linux2/probing/probe-storage.c (main): Use direct connection

	* hald/linux2/probing/probe-smbios.c (main): Use direct connection

	* hald/linux2/probing/probe-printer.c (main): Use direct connection

	* hald/linux2/probing/probe-hiddev.c (main): Use direct connection

	* hald/linux2/probing/probe-input.c (main): Use direct connection

	* hald/linux2/addons/addon-usb-csr.c (main): Use direct connection

	* hald/linux2/addons/addon-storage.c (main): Use direct connection

	* hald/linux2/addons/addon-hid-ups.c (main): Use direct connection

	* hald/linux2/addons/addon-acpi.c (main): Use direct connection

	* hald/linux2/probing/probe-pc-floppy.c (main): Remove all references
	to hal and dbus since this program just returns the result in the
	exit code



Index: hald.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- hald.c	28 Feb 2005 19:43:29 -0000	1.32
+++ hald.c	8 Apr 2005 18:10:19 -0000	1.33
@@ -586,8 +586,8 @@
 	/* Finally, setup unix signal handler for TERM */
 	signal (SIGTERM, handle_sigterm);
 
-	/* set up the dbus services */
-	if (!hald_dbus_init ())
+	/* set up the local dbus server */
+	if (!hald_dbus_local_server_init ())
 		return 1;
 
 	/* initialize operating system specific parts */
@@ -637,6 +637,11 @@
 
 	HAL_INFO (("Device probing completed"));
 
+	if (!hald_dbus_init ()) {
+		hal_util_kill_all_helpers ();
+		exit (1);
+	}
+
 	/* tell parent to exit */
 	write (startup_daemonize_pipe[1], buf, sizeof (buf));
 	close (startup_daemonize_pipe[0]);

Index: hald_dbus.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald_dbus.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- hald_dbus.c	2 Mar 2005 19:19:12 -0000	1.32
+++ hald_dbus.c	8 Apr 2005 18:10:19 -0000	1.33
@@ -43,7 +43,7 @@
 #include "logger.h"
 #include "osspec.h"
 
-static DBusConnection *dbus_connection;
+static DBusConnection *dbus_connection = NULL;
 
 /**
  * @defgroup DaemonErrors Error conditions
@@ -581,6 +581,9 @@
 	DBusMessage *message;
 	DBusMessageIter iter;
 
+	if (dbus_connection == NULL)
+		goto out;
+
 	HAL_TRACE (("entering, udi=%s", udi));
 
 	message = dbus_message_new_signal ("/org/freedesktop/Hal/Manager",
@@ -594,6 +597,9 @@
 		DIE (("error broadcasting message"));
 
 	dbus_message_unref (message);
+
+out:
+	;
 }
 
 /** Send signal DeviceRemoved(string udi) on the org.freedesktop.Hal.Manager
@@ -608,6 +614,9 @@
 	DBusMessage *message;
 	DBusMessageIter iter;
 
+	if (dbus_connection == NULL)
+		goto out;
+
 	HAL_TRACE (("entering, udi=%s", udi));
 
 	message = dbus_message_new_signal ("/org/freedesktop/Hal/Manager",
@@ -621,6 +630,8 @@
 		DIE (("error broadcasting message"));
 
 	dbus_message_unref (message);
+out:
+	;
 }
 
 /** Send signal NewCapability(string udi, string capability) on the 
@@ -638,6 +649,9 @@
 	DBusMessage *message;
 	DBusMessageIter iter;
 
+	if (dbus_connection == NULL)
+		goto out;
+
 	HAL_TRACE (("entering, udi=%s, cap=%s", udi, capability));
 
 	message = dbus_message_new_signal ("/org/freedesktop/Hal/Manager",
@@ -652,6 +666,8 @@
 		DIE (("error broadcasting message"));
 
 	dbus_message_unref (message);
+out:
+	;
 }
 
 /** @} */
@@ -1153,7 +1169,7 @@
  *  @return                     What to do with the message
  */
 DBusHandlerResult
-device_set_property (DBusConnection * connection, DBusMessage * message)
+device_set_property (DBusConnection * connection, DBusMessage * message, dbus_bool_t local_interface)
 {
 	const char *udi;
 	char *key;
@@ -1175,7 +1191,7 @@
 	}
 	dbus_message_iter_get_basic (&iter, &key);
 
-	if (!sender_has_privileges (connection, message)) {
+	if (!local_interface && !sender_has_privileges (connection, message)) {
 		raise_permission_denied (connection, message, "SetProperty: not privileged");
 		return DBUS_HANDLER_RESULT_HANDLED;
 	}
@@ -1297,7 +1313,7 @@
  *  @return                     What to do with the message
  */
 DBusHandlerResult
-device_add_capability (DBusConnection * connection, DBusMessage * message)
+device_add_capability (DBusConnection * connection, DBusMessage * message, dbus_bool_t local_interface)
 {
 	const char *udi;
 	const char *capability;
@@ -1307,7 +1323,7 @@
 
 	HAL_TRACE (("entering"));
 
-	if (!sender_has_privileges (connection, message)) {
+	if (!local_interface && !sender_has_privileges (connection, message)) {
 		raise_permission_denied (connection, message, "AddCapability: not privileged");
 		return DBUS_HANDLER_RESULT_HANDLED;
 	}
@@ -1417,7 +1433,7 @@
  *  @return                     What to do with the message
  */
 DBusHandlerResult
-device_remove_property (DBusConnection * connection, DBusMessage * message)
+device_remove_property (DBusConnection * connection, DBusMessage * message, dbus_bool_t local_interface)
 {
 	const char *udi;
 	char *key;
@@ -1429,7 +1445,7 @@
 
 	udi = dbus_message_get_path (message);
 
-	if (!sender_has_privileges (connection, message)) {
+	if (!local_interface && !sender_has_privileges (connection, message)) {
 		raise_permission_denied (connection, message, "RemoveProperty: not privileged");
 		return DBUS_HANDLER_RESULT_HANDLED;
 	}
@@ -1905,9 +1921,11 @@
 			g_free (pu_iter->udi);
 			dbus_message_iter_close_container (&iter, &iter_array);
 
-			if (!dbus_connection_send
-			    (dbus_connection, message, NULL))
-				DIE (("error broadcasting message"));
+			if (dbus_connection != NULL) {
+				if (!dbus_connection_send (dbus_connection, message, NULL))
+					DIE (("error broadcasting message"));
+			}
+
 			dbus_message_unref (message);
 
 		already_processed:
@@ -1954,6 +1972,9 @@
 		dbus_int32_t i;
 		DBusMessageIter iter_struct;
 		DBusMessageIter iter_array;
+
+		if (dbus_connection == NULL)
+			goto out;
 		
 		message = dbus_message_new_signal (udi,
 						  "org.freedesktop.Hal.Device",
@@ -1989,6 +2010,8 @@
 
 		dbus_message_unref (message);
 	}
+out:
+	;
 }
 
 /** Emits a condition on a device; the device has to be in the GDL for
@@ -2017,6 +2040,9 @@
 	DBusMessage *message;
 	DBusMessageIter iter;
 
+	if (dbus_connection == NULL)
+		goto out;
+
 	message = dbus_message_new_signal (udi,
 					   "org.freedesktop.Hal.Device",
 					   "Condition");
@@ -2032,6 +2058,8 @@
 		DIE (("error broadcasting message"));
 
 	dbus_message_unref (message);
+out:
+	;
 }
 
 
@@ -2039,6 +2067,7 @@
 static gboolean
 reinit_dbus (gpointer user_data)
 {
+	HAL_INFO (("entering!"));
 	if (hald_dbus_init ())
 		return FALSE;
 	else
@@ -2072,7 +2101,7 @@
 }
 
 static DBusHandlerResult
-device_rescan (DBusConnection * connection, DBusMessage * message)
+device_rescan (DBusConnection * connection, DBusMessage * message, dbus_bool_t local_interface)
 {
 	const char *udi;
 	HalDevice *device;
@@ -2080,11 +2109,11 @@
 	DBusMessageIter iter;
 	gboolean res;	
 
-	HAL_TRACE (("entering"));
+	HAL_INFO (("entering, local_interface=%d", local_interface));
 
 	udi = dbus_message_get_path (message);
 
-	if (!sender_has_privileges (connection, message)) {
+	if (!local_interface && !sender_has_privileges (connection, message)) {
 		raise_permission_denied (connection, message, "Rescan: not privileged");
 		return DBUS_HANDLER_RESULT_HANDLED;
 	}
@@ -2116,7 +2145,7 @@
 }
 
 static DBusHandlerResult
-device_reprobe (DBusConnection * connection, DBusMessage * message)
+device_reprobe (DBusConnection * connection, DBusMessage * message, dbus_bool_t local_interface)
 {
 	const char *udi;
 	HalDevice *device;
@@ -2128,7 +2157,7 @@
 
 	udi = dbus_message_get_path (message);
 
-	if (!sender_has_privileges (connection, message)) {
+	if (!local_interface && !sender_has_privileges (connection, message)) {
 		raise_permission_denied (connection, message, "Reprobe: not privileged");
 		return DBUS_HANDLER_RESULT_HANDLED;
 	}
@@ -2161,7 +2190,7 @@
 
 
 static DBusHandlerResult
-device_emit_condition (DBusConnection * connection, DBusMessage * message)
+device_emit_condition (DBusConnection * connection, DBusMessage * message, dbus_bool_t local_interface)
 {
 	const char *udi;
 	HalDevice *device;
@@ -2176,8 +2205,8 @@
 
 	udi = dbus_message_get_path (message);
 
-	if (!sender_has_privileges (connection, message)) {
-		raise_permission_denied (connection, message, "Reprobe: not privileged");
+	if (!local_interface && !sender_has_privileges (connection, message)) {
+		raise_permission_denied (connection, message, "EmitCondition: not privileged");
 		return DBUS_HANDLER_RESULT_HANDLED;
 	}
 
@@ -2220,39 +2249,11 @@
 }
 
 
-/** Message handler for method invocations. All invocations on any object
- *  or interface is routed through this function.
- *
- *  @param  connection          D-BUS connection
- *  @param  message             Message
- *  @param  user_data           User data
- *  @return                     What to do with the message
- */
-DBusHandlerResult
-hald_dbus_filter_function (DBusConnection * connection,
-			   DBusMessage * message, void *user_data)
+static DBusHandlerResult
+hald_dbus_filter_handle_methods (DBusConnection *connection, DBusMessage *message, 
+				 void *user_data, dbus_bool_t local_interface)
 {
-	/*HAL_INFO (("obj_path=%s interface=%s method=%s", 
-		   dbus_message_get_path(message), 
-		   dbus_message_get_interface(message),
-		   dbus_message_get_member(message)));*/
-
-	if (dbus_message_is_signal (message,
-				    DBUS_INTERFACE_DBUS,
-				    "Disconnected") &&
-	    strcmp (dbus_message_get_path (message),
-		    DBUS_PATH_LOCAL) == 0) {
-
-		dbus_connection_unref (dbus_connection);
-		g_timeout_add (3000, reinit_dbus, NULL);
-
-	} else if (dbus_message_is_signal (message,
-					   DBUS_INTERFACE_DBUS,
-					   "NameOwnerChanged")) {
-
-		if (services_with_locks != NULL)
-			service_deleted (message);
-	} else if (dbus_message_is_method_call (message,
+	if (dbus_message_is_method_call (message,
 					 "org.freedesktop.Hal.Manager",
 					 "GetAllDevices") &&
 		   strcmp (dbus_message_get_path (message),
@@ -2271,12 +2272,11 @@
 			   "/org/freedesktop/Hal/Manager") == 0) {
 		return manager_find_device_string_match (connection,
 							 message);
-	} else
-	    if (dbus_message_is_method_call
-		(message, "org.freedesktop.Hal.Manager",
-		 "FindDeviceByCapability")
-		&& strcmp (dbus_message_get_path (message),
-			   "/org/freedesktop/Hal/Manager") == 0) {
+	} else if (dbus_message_is_method_call
+		   (message, "org.freedesktop.Hal.Manager",
+		    "FindDeviceByCapability")
+		   && strcmp (dbus_message_get_path (message),
+			      "/org/freedesktop/Hal/Manager") == 0) {
 		return manager_find_device_by_capability (connection,
 							  message);
 	}
@@ -2312,27 +2312,27 @@
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"SetProperty")) {
-		return device_set_property (connection, message);
+		return device_set_property (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"SetPropertyString")) {
-		return device_set_property (connection, message);
+		return device_set_property (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"SetPropertyInteger")) {
-		return device_set_property (connection, message);
+		return device_set_property (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"SetPropertyBoolean")) {
-		return device_set_property (connection, message);
+		return device_set_property (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"SetPropertyDouble")) {
-		return device_set_property (connection, message);
+		return device_set_property (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"RemoveProperty")) {
-		return device_remove_property (connection, message);
+		return device_remove_property (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"GetPropertyType")) {
@@ -2344,7 +2344,7 @@
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"AddCapability")) {
-		return device_add_capability (connection, message);
+		return device_add_capability (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"QueryCapability")) {
@@ -2368,26 +2368,169 @@
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"Rescan")) {
-		return device_rescan (connection, message);
+		return device_rescan (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"Reprobe")) {
-		return device_reprobe (connection, message);
+		return device_reprobe (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
 						"EmitCondition")) {
-		return device_emit_condition (connection, message);
+		return device_emit_condition (connection, message, local_interface);
 	} else
 		osspec_filter_function (connection, message, user_data);
 
 	return DBUS_HANDLER_RESULT_HANDLED;
 }
 
+/** Message handler for method invocations. All invocations on any object
+ *  or interface is routed through this function.
+ *
+ *  @param  connection          D-BUS connection
+ *  @param  message             Message
+ *  @param  user_data           User data
+ *  @return                     What to do with the message
+ */
+DBusHandlerResult
+hald_dbus_filter_function (DBusConnection * connection,
+			   DBusMessage * message, void *user_data)
+{
+	HAL_INFO (("obj_path=%s interface=%s method=%s", 
+		   dbus_message_get_path(message), 
+		   dbus_message_get_interface(message),
+		   dbus_message_get_member(message)));
+
+	if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected") &&
+	    strcmp (dbus_message_get_path (message), DBUS_PATH_LOCAL) == 0) {
+
+		/* this is a local message; e.g. from libdbus in this process */
+
+		HAL_INFO (("Got disconnected from the system message bus; "
+			   "retrying to reconnect every 3000 ms"));
+		dbus_connection_unref (dbus_connection);
+		dbus_connection = NULL;
+
+		g_timeout_add (3000, reinit_dbus, NULL);
+
+	} else if (dbus_message_is_signal (message,
+					   DBUS_INTERFACE_DBUS,
+					   "NameOwnerChanged")) {
+
+		if (services_with_locks != NULL)
+			service_deleted (message);
+	} else 
+		return hald_dbus_filter_handle_methods (connection, message, user_data, FALSE);
+
+	return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+
+
+static DBusHandlerResult 
+local_server_message_handler (DBusConnection *connection, 
+			      DBusMessage *message, 
+			      void *user_data)
+{
+	HAL_INFO (("local_server_message_handler: destination=%s obj_path=%s interface=%s method=%s", 
+		   dbus_message_get_destination (message), 
+		   dbus_message_get_path (message), 
+		   dbus_message_get_interface (message),
+		   dbus_message_get_member (message)));
+
+	if (dbus_message_is_method_call (message, "org.freedesktop.DBus", "AddMatch")) {
+		DBusMessage *reply;
+
+                /* cheat, and handle AddMatch since libhal will try to invoke this method */
+		reply = dbus_message_new_method_return (message);
+		if (reply == NULL)
+			DIE (("No memory"));
+		if (!dbus_connection_send (connection, reply, NULL))
+			DIE (("No memory"));
+		dbus_message_unref (reply);
+		return DBUS_HANDLER_RESULT_HANDLED;
+	} else if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected") &&
+		   strcmp (dbus_message_get_path (message), DBUS_PATH_LOCAL) == 0) {
+		
+		HAL_INFO (("Client to local_server was disconnected"));
+		dbus_connection_unref (connection);
+		return DBUS_HANDLER_RESULT_HANDLED;
+	} 
+	else return hald_dbus_filter_handle_methods (connection, message, user_data, TRUE);
+}
+
+static void
+local_server_unregister_handler (DBusConnection *connection, void *user_data)
+{
+	HAL_INFO (("unregistered"));
+}
+
+static void
+local_server_handle_connection (DBusServer *server,
+			  DBusConnection *new_connection,
+			  void *data)
+{
+	DBusObjectPathVTable vtable = { &local_server_unregister_handler, 
+					&local_server_message_handler, 
+					NULL, NULL, NULL, NULL};
+
+	HAL_INFO (("%d: Got a connection", getpid ()));
+	HAL_INFO (("dbus_connection_get_is_connected = %d", dbus_connection_get_is_connected (new_connection)));
+
+	/*dbus_connection_add_filter (new_connection, server_filter_function, NULL, NULL);*/
+
+	dbus_connection_register_fallback (new_connection, 
+					   "/org/freedesktop",
+					   &vtable,
+					   NULL);
+	dbus_connection_ref (new_connection);
+	dbus_connection_setup_with_g_main (new_connection, NULL);
+}
+
+
+static DBusServer *local_server = NULL;
+
+char *
+hald_dbus_local_server_addr (void)
+{
+	if (local_server == NULL)
+		return NULL;
+
+	return dbus_server_get_address (local_server);
+}
+
+gboolean
+hald_dbus_local_server_init (void)
+{
+	gboolean ret;
+	DBusError error;
+
+	ret = FALSE;
+
+	/* setup a server listening on a socket so we can do point to point
+	 * connections for programs spawned by hald
+	 */
+	dbus_error_init (&error);
+	if ((local_server = dbus_server_listen ("unix:tmpdir=/tmp/hald-local", &error)) == NULL) { 
+		HAL_ERROR (("Cannot create D-BUS server"));
+		goto out;
+	}
+	HAL_INFO (("local server is listening at %s", dbus_server_get_address (local_server)));
+	dbus_server_setup_with_g_main (local_server, NULL);
+	dbus_server_set_new_connection_function (local_server, local_server_handle_connection, NULL, NULL);	
+
+	ret = TRUE;
+
+out:
+	return ret;
+}
+
 gboolean
 hald_dbus_init (void)
 {
 	DBusError dbus_error;
 
+	HAL_INFO (("entering"));
+
 	dbus_connection_set_change_sigpipe (TRUE);
 
 	dbus_error_init (&dbus_error);
@@ -2408,8 +2551,7 @@
 		return FALSE;
 	}
 
-	dbus_connection_add_filter (dbus_connection, hald_dbus_filter_function, NULL,
-				    NULL);
+	dbus_connection_add_filter (dbus_connection, hald_dbus_filter_function, NULL, NULL);
 
 	dbus_bus_add_match (dbus_connection,
 			    "type='signal'"

Index: hald_dbus.h
===================================================================
RCS file: /cvs/hal/hal/hald/hald_dbus.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- hald_dbus.h	23 Feb 2005 18:25:43 -0000	1.6
+++ hald_dbus.h	8 Apr 2005 18:10:20 -0000	1.7
@@ -45,13 +45,13 @@
 DBusHandlerResult device_get_property_type          (DBusConnection *conn,
 						     DBusMessage    *msg);
 DBusHandlerResult device_set_property               (DBusConnection *conn,
-						     DBusMessage    *msg);
+						     DBusMessage    *msg, dbus_bool_t local_interface);
 DBusHandlerResult device_add_capability             (DBusConnection *conn,
-						     DBusMessage    *msg);
+						     DBusMessage    *msg, dbus_bool_t local_interface);
 DBusHandlerResult device_remove_capability          (DBusConnection *conn,
-						     DBusMessage    *msg);
+						     DBusMessage    *msg, dbus_bool_t local_interface);
 DBusHandlerResult device_remove_property            (DBusConnection *conn,
-						     DBusMessage    *msg);
+						     DBusMessage    *msg, dbus_bool_t local_interface);
 DBusHandlerResult device_property_exists            (DBusConnection *conn,
 						     DBusMessage    *msg);
 DBusHandlerResult device_query_capability           (DBusConnection *conn,
@@ -89,7 +89,11 @@
 
 gboolean hald_dbus_init (void);
 
+gboolean hald_dbus_local_server_init (void);
+
 DBusHandlerResult hald_dbus_filter_function (DBusConnection * connection, DBusMessage * message, void *user_data);
 
+char *hald_dbus_local_server_addr (void);
+
 
 #endif /* HAL_DBUS_H */

Index: util.c
===================================================================
RCS file: /cvs/hal/hal/hald/util.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- util.c	17 Mar 2005 17:19:43 -0000	1.13
+++ util.c	8 Apr 2005 18:10:20 -0000	1.14
@@ -554,6 +554,7 @@
 	guint i, j;
 	guint num_properties;
 	guint num_extras;
+	char *local_addr;
 
 	ed = g_new0 (HalHelperData, 1);
 	ed->data1 = data1;
@@ -573,6 +574,8 @@
 		num_env_vars++;
 	if (hald_is_initialising)
 		num_env_vars++;
+	if ((local_addr = hald_dbus_local_server_addr ()) != NULL)
+		num_env_vars++;
 
 	envp = g_new (char *, num_env_vars);
 	ienvp = envp;
@@ -583,6 +586,8 @@
 		envp[i++] = g_strdup ("HALD_VERBOSE=1");
 	if (hald_is_initialising)
 		envp[i++] = g_strdup ("HALD_STARTUP=1");
+	if (local_addr != NULL)
+		envp[i++] = g_strdup_printf ("HALD_DIRECT_ADDR=%s", local_addr);
 	for (j = 0; j < num_extras; j++) {
 		envp[i++] = g_strdup (extra_env[j]);
 	}

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Mon Apr 18 20:02:01 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx33.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DNaZN-0000qq-00 for
	danny.kukawka@web.de; Mon, 18 Apr 2005 20:02:01 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 24D399EBC5; Mon, 18 Apr 2005
	11:02:00 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	3995D9EBBA; Mon, 18 Apr 2005 11:01:58 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050418180158.3995D9EBBA@gabe.freedesktop.org>
Date: Mon, 18 Apr 2005 11:01:58 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal ChangeLog,1.504,1.505 configure.in,1.76,1.77
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState: N
X-KMail-SignatureState: N
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000014-0010
Mime-Version: 1.0

Update of /cvs/hal/hal
In directory gabe:/tmp/cvs-serv31690

Modified Files:
	ChangeLog configure.in 
Log Message:
2005-04-18  David Zeuthen  <davidz@redhat.com>

        * configure.in: Bump glib-2.0 requirement to 2.6.0; change dbus-1 and
        dbus-glib-1 to back 0.32 so it works with patched 0.32 tarballs. glib
        observation from Rohan <rohan.pm@gmail.com>.



Index: ChangeLog
===================================================================
RCS file: /cvs/hal/hal/ChangeLog,v
retrieving revision 1.504
retrieving revision 1.505
diff -u -d -r1.504 -r1.505
--- ChangeLog	14 Apr 2005 04:26:56 -0000	1.504
+++ ChangeLog	18 Apr 2005 18:01:55 -0000	1.505
@@ -1,3 +1,9 @@
+2005-04-18  David Zeuthen  <davidz@redhat.com>
+
+	* configure.in: Bump glib-2.0 requirement to 2.6.0; change dbus-1 and
+	dbus-glib-1 to back 0.32 so it works with patched 0.32 tarballs. glib
+	observation from Rohan <rohan.pm@gmail.com>.
+
 2005-04-14  David Zeuthen  <davidz@redhat.com>
 
 	Make hal handle APM nicely.

Index: configure.in
===================================================================
RCS file: /cvs/hal/hal/configure.in,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- configure.in	11 Apr 2005 18:51:50 -0000	1.76
+++ configure.in	18 Apr 2005 18:01:55 -0000	1.77
@@ -188,8 +188,8 @@
   fi
 fi
 
-dbus_module="dbus-1 >= 0.33"
-pkg_modules="glib-2.0 >= 2.2.2, gobject-2.0 >= 2.2.2, dbus-glib-1 >= 0.33, $dbus_module"
+dbus_module="dbus-1 >= 0.32"
+pkg_modules="glib-2.0 >= 2.6.0, gobject-2.0 >= 2.6.0, dbus-glib-1 >= 0.32, $dbus_module"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
 
 EXPAT_LIB=""

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Fri Apr  8 20:10:30 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx26.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DJxw6-0002be-00 for
	danny.kukawka@web.de; Fri, 08 Apr 2005 20:10:30 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 4B6EE9EBDF; Fri,  8 Apr 2005
	11:10:26 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	A899E9E856; Fri,  8 Apr 2005 11:10:22 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050408181022.A899E9E856@gabe.freedesktop.org>
Date: Fri,  8 Apr 2005 11:10:22 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal/libhal libhal.c,1.46,1.47 libhal.h,1.25,1.26
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000016-0010
Mime-Version: 1.0

Update of /cvs/hal/hal/libhal
In directory gabe:/tmp/cvs-serv32581/libhal

Modified Files:
	libhal.c libhal.h 
Log Message:
2005-04-08  David Zeuthen  <davidz@redhat.com>

	Make all hal helpers use a direct connection to hald rather than
	going through the bus. This is for both performance and security
	reasons. Also, fix the reconnect issue and don't connect to the
	system message bus before probing is done.

	* configure.in: Require dbus 0.33; that, for now, means D-BUS CVS
	HEAD since it requires the patch in fd.o bug #2889 and D-BUS made
	a post-release version bump. I'll look into doing a D-BUS release
	soon.

	* libhal/libhal.h: Export prototype for libhal_ctx_init_direct()

	* libhal/libhal.c (libhal_ctx_init_direct): New convenience function
	for connecting directly to hald instead of going through the message
	bus (requires the address in the HALD_DIRECT_ADDR environment variable)

	* hald/util.c (hal_util_helper_invoke): Export the local hald dbus
	server address in HALD_DIRECT_ADDR

	* hald/hald_dbus.c (manager_send_signal_device_added): Handle the
	case where we're not connected to the system message bus
	(manager_send_signal_device_removed): -do-
	(manager_send_signal_new_capability): -do-
	(device_property_atomic_update_end): -do-
	(device_send_signal_property_modified): -do-
	(device_send_signal_condition): -do-
	(device_set_property): Always allow local interface
	(device_add_capability): -do-
	(device_remove_property): -do-
	(device_rescan): -do-
	(device_reprobe): -do-
	(device_emit_condition): -do-
	(hald_dbus_filter_handle_methods): New function
	(hald_dbus_filter_function): Move bulk of functionality to the new
	hald_dbus_filter_handle_methods() and pass local_interface==FALSE.
	Handle Disconnect from local libdbus properly and attempt to
	reconnect to the system message bus every so often (every 3 secs)
	(local_server_message_handler): New function
	(local_server_unregister_handler): New function
	(local_server_handle_connection): New function
	(hald_dbus_local_server_addr): New function
	(hald_dbus_local_server_init): New function

	* hald/hald.c (main): Register a local dbus server instead of
	connection to the system bus as startup
	(osspec_probe_done): Only connect to the system bus once probing
	is done

	* tools/fstab-sync.c (main): Use direct connection

	* hald/linux2/probing/probe-volume.c (main): Use direct connection

	* hald/linux2/probing/probe-storage.c (main): Use direct connection

	* hald/linux2/probing/probe-smbios.c (main): Use direct connection

	* hald/linux2/probing/probe-printer.c (main): Use direct connection

	* hald/linux2/probing/probe-hiddev.c (main): Use direct connection

	* hald/linux2/probing/probe-input.c (main): Use direct connection

	* hald/linux2/addons/addon-usb-csr.c (main): Use direct connection

	* hald/linux2/addons/addon-storage.c (main): Use direct connection

	* hald/linux2/addons/addon-hid-ups.c (main): Use direct connection

	* hald/linux2/addons/addon-acpi.c (main): Use direct connection

	* hald/linux2/probing/probe-pc-floppy.c (main): Remove all references
	to hal and dbus since this program just returns the result in the
	exit code



Index: libhal.c
===================================================================
RCS file: /cvs/hal/hal/libhal/libhal.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- libhal.c	25 Mar 2005 03:24:51 -0000	1.46
+++ libhal.c	8 Apr 2005 18:10:20 -0000	1.47
@@ -191,6 +191,7 @@
 	dbus_bool_t is_initialized;           /**< Are we initialised */
 	dbus_bool_t is_shutdown;              /**< Have we been shutdown */
 	dbus_bool_t cache_enabled;            /**< Is the cache enabled */
+	dbus_bool_t is_direct;                /**< Whether the connection to hald is direct */
 
 	/** Device added */
 	LibHalDeviceAdded device_added;
@@ -2709,6 +2710,7 @@
 	ctx->is_initialized = FALSE;
 	ctx->is_shutdown = FALSE;
 	ctx->connection = NULL;
+	ctx->is_direct = FALSE;
 
 	return ctx;
 }
@@ -2763,30 +2765,69 @@
 		return FALSE;
 	}
 	ctx->is_initialized = TRUE;
+	ctx->is_direct = FALSE;
 
 	return TRUE;
 }
 
+LibHalContext *
+libhal_ctx_init_direct (DBusError *error)
+{
+	char *hald_addr;
+	LibHalContext *ctx;
+	DBusError _error;
+
+	ctx = libhal_ctx_new ();
+	if (ctx == NULL)
+		goto out;
+
+	if (((hald_addr = getenv ("HALD_DIRECT_ADDR"))) == NULL) {
+		libhal_ctx_free (ctx);
+		ctx = NULL;
+		goto out;
+	}
+
+	dbus_error_init (&_error);
+	ctx->connection = dbus_connection_open (hald_addr, &_error);
+	dbus_move_error (&_error, error);
+	if (error != NULL && dbus_error_is_set (error)) {
+		libhal_ctx_free (ctx);
+		ctx = NULL;
+		goto out;
+	}
+
+	ctx->is_initialized = TRUE;
+	ctx->is_direct = TRUE;
+
+out:
+	return ctx;
+}
+
 dbus_bool_t    
 libhal_ctx_shutdown (LibHalContext *ctx, DBusError *error)
 {
 	DBusError myerror;
 
-	dbus_error_init (&myerror);
-	dbus_bus_add_match (ctx->connection, 
-			    "type='signal',"
-			    "interface='org.freedesktop.Hal.Manager',"
-			    "sender='org.freedesktop.Hal',"
-			    "path='/org/freedesktop/Hal/Manager'", &myerror);
-	if (dbus_error_is_set (&myerror)) {
-		fprintf (stderr, "%s %d : Error unsubscribing to signals, error=%s\n", 
-			 __FILE__, __LINE__, error->message);
-		/** @todo  clean up */
-	}
+	if (ctx->is_direct) {
+		/* for some reason dbus_connection_set_exit_on_disconnect doesn't work yet so don't unref */
+		/*dbus_connection_unref (ctx->connection);*/
+	} else {
+		dbus_error_init (&myerror);
+		dbus_bus_remove_match (ctx->connection, 
+				       "type='signal',"
+				       "interface='org.freedesktop.Hal.Manager',"
+				       "sender='org.freedesktop.Hal',"
+				       "path='/org/freedesktop/Hal/Manager'", &myerror);
+		if (dbus_error_is_set (&myerror)) {
+			fprintf (stderr, "%s %d : Error unsubscribing to signals, error=%s\n", 
+				 __FILE__, __LINE__, error->message);
+			/** @todo  clean up */
+		}
 
-	/* TODO: remove other matches */
+		/* TODO: remove other matches */
 
-	dbus_connection_remove_filter (ctx->connection, filter_func, ctx);
+		dbus_connection_remove_filter (ctx->connection, filter_func, ctx);
+	}
 
 	ctx->is_initialized = FALSE;
 

Index: libhal.h
===================================================================
RCS file: /cvs/hal/hal/libhal/libhal.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- libhal.h	2 Mar 2005 19:19:13 -0000	1.25
+++ libhal.h	8 Apr 2005 18:10:20 -0000	1.26
@@ -152,6 +152,8 @@
 dbus_bool_t    libhal_ctx_shutdown                     (LibHalContext *ctx, DBusError *error);
 dbus_bool_t    libhal_ctx_free                         (LibHalContext *ctx);
 
+LibHalContext *libhal_ctx_init_direct                  (DBusError *error);
+
 
 char        **libhal_get_all_devices (LibHalContext *ctx, int *num_devices, DBusError *error);
 dbus_bool_t   libhal_device_exists   (LibHalContext *ctx, const char *udi,  DBusError *error);

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Fri Apr  8 20:10:29 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx26.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DJxw5-0002XV-00 for
	danny.kukawka@web.de; Fri, 08 Apr 2005 20:10:29 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 90FB29EBC3; Fri,  8 Apr 2005
	11:10:25 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	789E89EBA0; Fri,  8 Apr 2005 11:10:22 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050408181022.789E89EBA0@gabe.freedesktop.org>
Date: Fri,  8 Apr 2005 11:10:22 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal/hald/linux2/addons addon-acpi.c, 1.5, 1.6 addon-hid-ups.c,
	1.4, 1.5 addon-storage.c, 1.4, 1.5 addon-usb-csr.c, 1.2, 1.3
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 00000018-0010
Mime-Version: 1.0

Update of /cvs/hal/hal/hald/linux2/addons
In directory gabe:/tmp/cvs-serv32581/hald/linux2/addons

Modified Files:
	addon-acpi.c addon-hid-ups.c addon-storage.c addon-usb-csr.c 
Log Message:
2005-04-08  David Zeuthen  <davidz@redhat.com>

	Make all hal helpers use a direct connection to hald rather than
	going through the bus. This is for both performance and security
	reasons. Also, fix the reconnect issue and don't connect to the
	system message bus before probing is done.

	* configure.in: Require dbus 0.33; that, for now, means D-BUS CVS
	HEAD since it requires the patch in fd.o bug #2889 and D-BUS made
	a post-release version bump. I'll look into doing a D-BUS release
	soon.

	* libhal/libhal.h: Export prototype for libhal_ctx_init_direct()

	* libhal/libhal.c (libhal_ctx_init_direct): New convenience function
	for connecting directly to hald instead of going through the message
	bus (requires the address in the HALD_DIRECT_ADDR environment variable)

	* hald/util.c (hal_util_helper_invoke): Export the local hald dbus
	server address in HALD_DIRECT_ADDR

	* hald/hald_dbus.c (manager_send_signal_device_added): Handle the
	case where we're not connected to the system message bus
	(manager_send_signal_device_removed): -do-
	(manager_send_signal_new_capability): -do-
	(device_property_atomic_update_end): -do-
	(device_send_signal_property_modified): -do-
	(device_send_signal_condition): -do-
	(device_set_property): Always allow local interface
	(device_add_capability): -do-
	(device_remove_property): -do-
	(device_rescan): -do-
	(device_reprobe): -do-
	(device_emit_condition): -do-
	(hald_dbus_filter_handle_methods): New function
	(hald_dbus_filter_function): Move bulk of functionality to the new
	hald_dbus_filter_handle_methods() and pass local_interface==FALSE.
	Handle Disconnect from local libdbus properly and attempt to
	reconnect to the system message bus every so often (every 3 secs)
	(local_server_message_handler): New function
	(local_server_unregister_handler): New function
	(local_server_handle_connection): New function
	(hald_dbus_local_server_addr): New function
	(hald_dbus_local_server_init): New function

	* hald/hald.c (main): Register a local dbus server instead of
	connection to the system bus as startup
	(osspec_probe_done): Only connect to the system bus once probing
	is done

	* tools/fstab-sync.c (main): Use direct connection

	* hald/linux2/probing/probe-volume.c (main): Use direct connection

	* hald/linux2/probing/probe-storage.c (main): Use direct connection

	* hald/linux2/probing/probe-smbios.c (main): Use direct connection

	* hald/linux2/probing/probe-printer.c (main): Use direct connection

	* hald/linux2/probing/probe-hiddev.c (main): Use direct connection

	* hald/linux2/probing/probe-input.c (main): Use direct connection

	* hald/linux2/addons/addon-usb-csr.c (main): Use direct connection

	* hald/linux2/addons/addon-storage.c (main): Use direct connection

	* hald/linux2/addons/addon-hid-ups.c (main): Use direct connection

	* hald/linux2/addons/addon-acpi.c (main): Use direct connection

	* hald/linux2/probing/probe-pc-floppy.c (main): Remove all references
	to hal and dbus since this program just returns the result in the
	exit code



Index: addon-acpi.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-acpi.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- addon-acpi.c	11 Mar 2005 22:42:34 -0000	1.5
+++ addon-acpi.c	8 Apr 2005 18:10:20 -0000	1.6
@@ -106,14 +106,7 @@
 		is_verbose = TRUE;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-	
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	/* TODO: get mountpoint of proc from... /proc/mounts.. :-) */

Index: addon-hid-ups.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-hid-ups.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- addon-hid-ups.c	21 Mar 2005 00:08:01 -0000	1.4
+++ addon-hid-ups.c	8 Apr 2005 18:10:20 -0000	1.5
@@ -256,14 +256,7 @@
 		goto out;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	device_file = getenv ("HAL_PROP_HIDDEV_DEVICE");

Index: addon-storage.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-storage.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- addon-storage.c	2 Mar 2005 19:19:13 -0000	1.4
+++ addon-storage.c	8 Apr 2005 18:10:20 -0000	1.5
@@ -182,14 +182,7 @@
 		support_media_changed = FALSE;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	printf ("**************************************************\n");

Index: addon-usb-csr.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-usb-csr.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- addon-usb-csr.c	4 Apr 2005 16:06:43 -0000	1.2
+++ addon-usb-csr.c	8 Apr 2005 18:10:20 -0000	1.3
@@ -398,7 +398,6 @@
 	the_device_udi = getenv ("UDI");
 
 	dbg ("device:[%s]\n", the_device_udi);
-
 	if (the_device_udi == NULL)
 	{
 		fprintf (stderr, "No device specified\n");
@@ -406,24 +405,8 @@
 	}
 
 	dbus_error_init (&err);
-
-        if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &err)) == NULL)
-	{
-		fprintf (stderr, "Could not obtain dbus connection\n");
-		return -3;
-	}
-	dbg ("DBUS connection: %p\n", conn);
-
-	hal_context = libhal_ctx_new ();
-        if (!libhal_ctx_set_dbus_connection (hal_context, conn))
-	{
-		fprintf (stderr, "Could not bind to DBUS\n");
-		return -4;
-	}
-	dbg ("New context: %p\n", hal_context);
-
-	libhal_ctx_init (hal_context, &err);
-	libhal_ctx_set_device_removed (hal_context, device_removed);
+	if ((ctx = libhal_ctx_init_direct (&err)) == NULL)
+		goto out;
 
 	update_properties ();
 

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

From hal-commit-bounces@lists.freedesktop.org Fri Apr  8 20:10:26 2005
Received: from [131.252.208.82] (helo=gabe.freedesktop.org) by mx28.web.de
	with esmtp (WEB.DE 4.104 #268) id 1DJxw2-0006ze-00 for
	danny.kukawka@web.de; Fri, 08 Apr 2005 20:10:26 +0200
Received: from gabe.freedesktop.org (localhost.localdomain [127.0.0.1]) by
	gabe.freedesktop.org (Postfix) with ESMTP id 067F79EBDD; Fri,  8 Apr 2005
	11:10:26 -0700 (PDT)
X-Original-To: hal-commit@freedesktop.org
Delivered-To: hal-commit@freedesktop.org
Received: by gabe.freedesktop.org (Postfix, from userid 2559) id
	954609EBA7; Fri,  8 Apr 2005 11:10:22 -0700 (PDT)
To: hal-commit@freedesktop.org
Message-Id: <20050408181022.954609EBA7@gabe.freedesktop.org>
Date: Fri,  8 Apr 2005 11:10:22 -0700 (PDT)
From: david@freedesktop.org (David Zeuthen)
Subject: hal/hald/linux2/probing probe-hiddev.c, 1.1, 1.2 probe-input.c,
	1.4, 1.5 probe-pc-floppy.c, 1.1, 1.2 probe-printer.c, 1.1, 1.2
	probe-smbios.c, 1.1, 1.2 probe-storage.c, 1.6, 1.7 probe-volume.c, 1.7, 1.8
X-BeenThere: hal-commit@lists.freedesktop.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: HAL CVS commit notification <hal-commit.lists.freedesktop.org>
List-Unsubscribe:
	<http://lists.freedesktop.org/mailman/listinfo/hal-commit>, 
	<mailto:hal-commit-request@lists.freedesktop.org?subject=unsubscribe>
List-Archive: <http://lists.freedesktop.org/archives/hal-commit>
List-Post: <mailto:hal-commit@lists.freedesktop.org>
List-Help: <mailto:hal-commit-request@lists.freedesktop.org?subject=help>
List-Subscribe: <http://lists.freedesktop.org/mailman/listinfo/hal-commit>,
	<mailto:hal-commit-request@lists.freedesktop.org?subject=subscribe>
Errors-To: hal-commit-bounces@lists.freedesktop.org
Sender: hal-commit-bounces@lists.freedesktop.org
Status: RO
X-Status: ORC
X-KMail-EncryptionState: N
X-KMail-SignatureState: N
X-KMail-MDN-Sent:  
X-UID: 0
Content-Type: application/octet-stream
X-Evolution-Source: imap://dkukawka@imap.suse.de/
X-Evolution: 0000001a-0010
Mime-Version: 1.0

Update of /cvs/hal/hal/hald/linux2/probing
In directory gabe:/tmp/cvs-serv32581/hald/linux2/probing

Modified Files:
	probe-hiddev.c probe-input.c probe-pc-floppy.c probe-printer.c 
	probe-smbios.c probe-storage.c probe-volume.c 
Log Message:
2005-04-08  David Zeuthen  <davidz@redhat.com>

	Make all hal helpers use a direct connection to hald rather than
	going through the bus. This is for both performance and security
	reasons. Also, fix the reconnect issue and don't connect to the
	system message bus before probing is done.

	* configure.in: Require dbus 0.33; that, for now, means D-BUS CVS
	HEAD since it requires the patch in fd.o bug #2889 and D-BUS made
	a post-release version bump. I'll look into doing a D-BUS release
	soon.

	* libhal/libhal.h: Export prototype for libhal_ctx_init_direct()

	* libhal/libhal.c (libhal_ctx_init_direct): New convenience function
	for connecting directly to hald instead of going through the message
	bus (requires the address in the HALD_DIRECT_ADDR environment variable)

	* hald/util.c (hal_util_helper_invoke): Export the local hald dbus
	server address in HALD_DIRECT_ADDR

	* hald/hald_dbus.c (manager_send_signal_device_added): Handle the
	case where we're not connected to the system message bus
	(manager_send_signal_device_removed): -do-
	(manager_send_signal_new_capability): -do-
	(device_property_atomic_update_end): -do-
	(device_send_signal_property_modified): -do-
	(device_send_signal_condition): -do-
	(device_set_property): Always allow local interface
	(device_add_capability): -do-
	(device_remove_property): -do-
	(device_rescan): -do-
	(device_reprobe): -do-
	(device_emit_condition): -do-
	(hald_dbus_filter_handle_methods): New function
	(hald_dbus_filter_function): Move bulk of functionality to the new
	hald_dbus_filter_handle_methods() and pass local_interface==FALSE.
	Handle Disconnect from local libdbus properly and attempt to
	reconnect to the system message bus every so often (every 3 secs)
	(local_server_message_handler): New function
	(local_server_unregister_handler): New function
	(local_server_handle_connection): New function
	(hald_dbus_local_server_addr): New function
	(hald_dbus_local_server_init): New function

	* hald/hald.c (main): Register a local dbus server instead of
	connection to the system bus as startup
	(osspec_probe_done): Only connect to the system bus once probing
	is done

	* tools/fstab-sync.c (main): Use direct connection

	* hald/linux2/probing/probe-volume.c (main): Use direct connection

	* hald/linux2/probing/probe-storage.c (main): Use direct connection

	* hald/linux2/probing/probe-smbios.c (main): Use direct connection

	* hald/linux2/probing/probe-printer.c (main): Use direct connection

	* hald/linux2/probing/probe-hiddev.c (main): Use direct connection

	* hald/linux2/probing/probe-input.c (main): Use direct connection

	* hald/linux2/addons/addon-usb-csr.c (main): Use direct connection

	* hald/linux2/addons/addon-storage.c (main): Use direct connection

	* hald/linux2/addons/addon-hid-ups.c (main): Use direct connection

	* hald/linux2/addons/addon-acpi.c (main): Use direct connection

	* hald/linux2/probing/probe-pc-floppy.c (main): Remove all references
	to hal and dbus since this program just returns the result in the
	exit code



Index: probe-hiddev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-hiddev.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- probe-hiddev.c	4 Feb 2005 05:24:25 -0000	1.1
+++ probe-hiddev.c	8 Apr 2005 18:10:20 -0000	1.2
@@ -65,14 +65,7 @@
 		goto out;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	device_file = getenv ("HAL_PROP_HIDDEV_DEVICE");

Index: probe-input.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-input.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- probe-input.c	2 Feb 2005 21:14:18 -0000	1.4
+++ probe-input.c	8 Apr 2005 18:10:20 -0000	1.5
@@ -142,14 +142,7 @@
 		goto out;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	device_file = getenv ("HAL_PROP_INPUT_DEVICE");

Index: probe-pc-floppy.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-pc-floppy.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- probe-pc-floppy.c	25 Feb 2005 22:01:14 -0000	1.1
+++ probe-pc-floppy.c	8 Apr 2005 18:10:20 -0000	1.2
@@ -53,9 +53,6 @@
 	int ret;
 	char *udi;
 	char *device_file;
-	LibHalContext *ctx = NULL;
-	DBusError error;
-	DBusConnection *conn;
 	char name[256];
 	struct floppy_drive_struct ds;
 
@@ -107,11 +104,5 @@
 	if (fd >= 0)
 		close (fd);
 
-	if (ctx != NULL) {
-		dbus_error_init (&error);
-		libhal_ctx_shutdown (ctx, &error);
-		libhal_ctx_free (ctx);
-	}
-
 	return ret;
 }

Index: probe-printer.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-printer.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- probe-printer.c	22 Feb 2005 20:18:04 -0000	1.1
+++ probe-printer.c	8 Apr 2005 18:10:20 -0000	1.2
@@ -74,14 +74,7 @@
 		goto out;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	if ((getenv ("HALD_VERBOSE")) != NULL)

Index: probe-smbios.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-smbios.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- probe-smbios.c	13 Mar 2005 01:48:24 -0000	1.1
+++ probe-smbios.c	8 Apr 2005 18:10:20 -0000	1.2
@@ -86,14 +86,7 @@
 		is_verbose = TRUE;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	pipe (dmipipe);	

Index: probe-storage.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-storage.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- probe-storage.c	5 Apr 2005 16:31:31 -0000	1.6
+++ probe-storage.c	8 Apr 2005 18:10:20 -0000	1.7
@@ -137,14 +137,7 @@
 		only_check_for_fs = FALSE;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	dbg ("Doing probe-storage for %s (bus %s) (drive_type %s) (udi=%s) (--only-check-for-fs==%d)", 

Index: probe-volume.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-volume.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- probe-volume.c	6 Apr 2005 19:45:09 -0000	1.7
+++ probe-volume.c	8 Apr 2005 18:10:20 -0000	1.8
@@ -169,14 +169,7 @@
 		is_verbose = TRUE;
 
 	dbus_error_init (&error);
-	if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
-		goto out;
-
-	if ((ctx = libhal_ctx_new ()) == NULL)
-		goto out;
-	if (!libhal_ctx_set_dbus_connection (ctx, conn))
-		goto out;
-	if (!libhal_ctx_init (ctx, &error))
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
 		goto out;
 
 	dbg ("Doing probe-volume for %s\n", device_file);

_______________________________________________
hal-commit mailing list
hal-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal-commit

