hal/hald hald_dbus.c,1.60,1.61
David Zeuthen
david at kemper.freedesktop.org
Mon Jun 5 16:56:02 PDT 2006
Update of /cvs/hal/hal/hald
In directory kemper:/tmp/cvs-serv27813/hald
Modified Files:
hald_dbus.c
Log Message:
2006-06-05 David Zeuthen <davidz at redhat.com>
* hald/hald_dbus.c:
(hald_exec_method): Export a new environment variable with the
unique name for callers system bus connection called
HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME
* policy/*: Move these to privileges instead
* privileges/*: Moved from policy/txt/*
* Makefile.am: Fix up subdirs
* configure.in: Adjust for new dirs and remove comment about
libhal-policy. Require PolicyKit >= 0.2 (which is polkit CVS).
Don't read weird options from the polkit pc file.
* tools/*: Update to new PolicyKit API and DTRT so things work
using hald/run-hald.sh
Index: hald_dbus.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald_dbus.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- hald_dbus.c 12 May 2006 14:34:28 -0000 1.60
+++ hald_dbus.c 5 Jun 2006 23:56:00 -0000 1.61
@@ -2732,14 +2732,17 @@
int type;
GString *stdin_str;
DBusMessageIter iter;
- char *extra_env[2];
+ char *extra_env[3];
char uid_export[128];
+ char sender_export[128];
MethodInvocation *mi;
/* add calling uid */
extra_env[0] = NULL;
+ extra_env[1] = NULL;
if (local_interface) {
extra_env[0] = "HAL_METHOD_INVOKED_BY_UID=0";
+ extra_env[1] = "HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME=0";
} else {
const char *sender;
@@ -2753,10 +2756,20 @@
if (!dbus_error_is_set (&error)) {
sprintf (uid_export, "HAL_METHOD_INVOKED_BY_UID=%lu", uid);
extra_env[0] = uid_export;
- }
+ }
+ snprintf (sender_export, sizeof (sender_export),
+ "HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME=%s", sender);
+ extra_env[1] = sender_export;
}
}
- extra_env[1] = NULL;
+
+ if (extra_env[0] == NULL)
+ extra_env[0] = "HAL_METHOD_INVOKED_BY_UID=nobody";
+ if (extra_env[1] == NULL)
+ extra_env[1] = "HAL_METHOD_INVOKED_BY_SYSTEMBUS_CONNECTION_NAME=0";
+
+
+ extra_env[2] = NULL;
/* prepare stdin with parameters */
stdin_str = g_string_sized_new (256); /* default size for passing params; can grow */
More information about the hal-commit
mailing list