win32 dbus_connection_get_unix_user() problem

Havoc Pennington hp at redhat.com
Tue Mar 13 15:10:37 PDT 2007


Peter Kümmel wrote:
> I would handle all problems the same way,
> no unix/win functions in the independent code:
> 
> parse_policy() {
>   parse_attribute()
>   return policy;
> }
> 
> -unix.c file:
> parse_attribute() {
>   parse_unix_user_attribute()
>   parse_unix_group_attribute()
>   parse_name_owned_attribute()
>   return ...
> }
> 
> -win.c file:
> parse_attribute() {
>   parse_windows_sid_attribute()
>   return ...
> }

You could do this, by introducing a parse_platform_specific_attributes() 
function. _dbus_transport_open_platform_specific() is the same idea.

I think you can leave more code in the compiles-on-all-platforms file 
though (which is desirable) if you only use the platform-specific file 
to interpret the attribute value - that is, parse_sid(), parse_user() - 
and try to leave everything else cross-platform.

Anyway, if you want to try a patch we can see how it works out.

Havoc



More information about the dbus mailing list