removing dbus_getuid
Peter Kümmel
syntheticpp at gmx.net
Sun May 27 05:36:52 PDT 2007
I've tried to remove dbus_getuid calls from the "platform independent"
code. The first step was to introduce _dbus_append_uid, first patch.
Internally I still use the dummy uid, but they could be later on
replaced by a DBusString which holds a sid.
I've found _dbus_getuid() in a call of _dbus_user_database_get_uid
in init_system_db. Is it right that we have to set up a database
which handles DBusStrings?
A other call is in
bus_policy_allow_user (BusPolicy *policy,
unsigned long uid)
{
dbus_bool_t allowed;
unsigned long *group_ids;
int n_group_ids;
Seems this makes only sens on Unix, so I've introduced
"allow_unix_user_function" and "allow_win_user_function",
to avoid the calling of bus_policy_allow_user, see the second patch.
(the patches only demonstrate the changes)
How should we fix the "plain _wrong_" patch of policy.c?
"bus_policy_create_client_policy" also uses dbus_uid_t and
is called by "bus_context_create_client_policy"
which is called by "bus_connection_complete". Should we rename
all these function to *_unix?
But this looks like duplicating the code. Or are all these functions
without sens on windows?.
A other way is to call everywhere the function for unix and win and
make one of the functions a noop when it is called on the wrong system.
But currently the unix function will fail on windows.
Peter
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: no_getuid_1.patch
Url: http://lists.freedesktop.org/archives/dbus/attachments/20070527/a950ffe9/attachment.ksh
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: no_getuid_2.patch
Url: http://lists.freedesktop.org/archives/dbus/attachments/20070527/a950ffe9/attachment.txt
More information about the dbus
mailing list