removing dbus_getuid

Ralf Habacker ralf.habacker at freenet.de
Mon May 28 06:28:00 PDT 2007


Peter Kümmel schrieb:
> Havoc, maybe it has not become clear:
> I seriously try to go your route.
>
> I hope I'm not completely wrong.
>
> Peter Kümmel wrote:
>   
>> 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?
>>     
What about to define dbus_uid_t and dbus_gid_t platform independent and 
to use this type in any function.

/** A user ID */
typedef struct {
    unsigned long uid;
    char *_uid;
} dbus_uid_t;

/** A group ID */
typedef struct {
    unsigned long gid;
    char *_gid;
} dbus_gid_t;


Internal the related struct member could be used as needed.  The types 
could later be rename to DBusUser or similar to be in the regular naming 
scheme.

Ralf


More information about the dbus mailing list