win32 dbus_connection_get_unix_user() problem

Havoc Pennington hp at redhat.com
Thu Mar 8 06:49:54 PST 2007


Ralf Habacker wrote:
> In dbus/dbus-connection.c (dbus_connection_get_unix_user) there is a
> hack, which let bus-test fail on win32:
> 
> #ifdef DBUS_WIN
>   /* FIXME this should be done at a lower level, but it's kind of hard,
>    * just want to be sure we don't ship with this API returning
>    * some weird internal fake uid for 1.0
>    */
>   return FALSE;
> #endif
> 
> In http://lists.freedesktop.org/archives/dbus/2006-June/005030.html
> there is a thread refering to a GetConnectionUnixUser dbus function and
> a possible replacement. Does this means the same function ?
> Because dbus_connection_get_unix_user() is usesd several times in the
> dbus code it looks like a problem to replace this function.  How to
> proceed ?
> 

connection_get_unix_user() makes no sense on Windows. So any code that 
calls it either makes no sense on Windows anyway, or will need changing 
to use a Windows alternative. For example you might add 
dbus_connection_get_windows_user() that returns a Windows username (or 
whatever is appropriate for Windows).

IIRC GetConnectionUnixUser is a function on the bus daemon that is 
implemented by calling connection_get_unix_user(). You could add 
GetConnectionWindowsUser implemented by calling 
connection_get_windows_user(), or you could simply not have this feature 
on Windows for now.

Havoc



More information about the dbus mailing list