X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dbus%2Fdbus-auth.c;h=86e3223dddc194918fc23d2191584ca8dbd23f5e;hb=04c58b9e5fbdf3acc7565f989e5fcd11f0c23c57;hp=d2c37a7a044a8aa608e4de1d143572c88b2becdf;hpb=0d7318ccc72b0b984a3a27e71eb5e9a3919ff3bb;p=platform%2Fupstream%2Fdbus.git diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c index d2c37a7..86e3223 100644 --- a/dbus/dbus-auth.c +++ b/dbus/dbus-auth.c @@ -2,6 +2,7 @@ /* dbus-auth.c Authentication * * Copyright (C) 2002, 2003, 2004 Red Hat Inc. + * Copyright (C) 2013 Samsung Electronics * * Licensed under the Academic Free License version 2.1 * @@ -2238,8 +2239,8 @@ process_command (DBusAuth *auth) /** * Creates a new auth conversation object for the server side. - * See doc/dbus-sasl-profile.txt for full details on what - * this object does. + * See http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol + * for full details on what this object does. * * @returns the new object or #NULL if no memory */ @@ -2284,8 +2285,8 @@ _dbus_auth_server_new (const DBusString *guid) /** * Creates a new auth conversation object for the client side. - * See doc/dbus-sasl-profile.txt for full details on what - * this object does. + * See http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol + * for full details on what this object does. * * @returns the new object or #NULL if no memory */ @@ -2321,6 +2322,49 @@ _dbus_auth_client_new (void) return auth; } +#ifdef ENABLE_KDBUS_TRANSPORT +/** + * Creates a new auth conversation object for the client side of kdbus. + * In fact it only initialize structures and sets authenticated state + * because of different authentication-like mechanism in kdbus - policies + * TODO Probably to be checked and modified when kdbus will be documented + * + * @returns the new object or #NULL if no memory + */ +DBusAuth* +_dbus_auth_client_new_kdbus (void) +{ + DBusAuth *auth; + DBusString guid_str; + + if (!_dbus_string_init (&guid_str)) + return NULL; + + auth = _dbus_auth_new (sizeof (DBusAuthClient)); + if (auth == NULL) + { + _dbus_string_free (&guid_str); + return NULL; + } + + DBUS_AUTH_CLIENT (auth)->guid_from_server = guid_str; + + auth->side = auth_side_client; + auth->state = &common_state_authenticated; + auth->unix_fd_negotiated = TRUE; + + /* Start the auth conversation by sending AUTH for our default + * mechanism */ +/* if (!send_auth (auth, &all_mechanisms[0])) + { + _dbus_auth_unref (auth); + return NULL; + }*/ + + return auth; +} +#endif + /** * Increments the refcount of an auth object. *