win32 dbus_connection_get_unix_user() problem

Peter Kümmel syntheticpp at gmx.net
Sat Mar 10 01:59:26 PST 2007


Havoc Pennington wrote:
> Hi,
> 
> Peter Kümmel wrote:
>> To provide a platform independent API is not our
>> job, especially because the code isn't understandable,
>> when you are not a full time developer working on dbus.
>> It is the job of the lib creator/designer, so back to
>> the drawing board.
> 
> This is just bogus. We're talking about one function, not "the API", and
>  I'm not even asking you to create a cross-platform API; I'm saying, at
> most, add dbus_connection_get_windows_user() that always fails on unix,
> and then copy all the uses of get_unix_user(), doing the analogous thing
> with the windows sid.

Isn't the code full of things like this?

void
bus_connection_disconnected (DBusConnection *connection)
{
....
  dbus_connection_set_unix_user_function (connection,
                                          NULL, NULL, NULL);

...
          if (dbus_connection_get_unix_user (connection, &uid))


Why is there no platform independent function call? All is only
designed for unix (name of the function, type of uid), not in mind
that there could be other systems than unix.

The problem is, that we've implemented the unix interface
which is used all over the place, and now you are saying that you
don't wanna have used this interface on Windows.
And I think this is not our problem, because the using of unix
specific function in the core code is a design mistake.

My idea is to replace all this unix function with platform
independent function calls. This is what I mean with platform
indepenent API, maybe a bit misleading because some functions
are not public.

But your suggestion, when I understand it correctly,
is that we should just add the windows function,
e.g. dbus_connection_get_windows_user():

void
bus_connection_disconnected (DBusConnection *connection)
{
....
  dbus_connection_set_unix_user_function (connection,
                                          NULL, NULL, NULL);

...
          if (dbus_connection_get_unix_user (connection, &uid))
...
          if (dbus_connection_get_windows_user(connection, &uid))


What happens when sometimes there is a new non-unix and non-windows
system? Such a solution I would call a hack, the clean solution is
to have a interface.


Anyway, nobody has the time to fix this, so do I understand you suggestion
correct? Then I will try to go your way.


Peter


More information about the dbus mailing list