X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dbus%2Fdbus-auth.c;h=6a3f8839807c5e09ec3a6a1a79398de57811fcbd;hb=757b80b9711d9733798c927495d74c7323e95400;hp=0c1248307c3b2a8491c6758927e5bff5d2f7a3d6;hpb=7a4cd46284dd634c165b5c4eb23606b7c0ff4ade;p=platform%2Fupstream%2Fdbus.git diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c index 0c12483..6a3f883 100644 --- a/dbus/dbus-auth.c +++ b/dbus/dbus-auth.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ + +#include #include "dbus-auth.h" #include "dbus-string.h" #include "dbus-list.h" @@ -1200,18 +1202,6 @@ handle_server_data_anonymous_mech (DBusAuth *auth, { _dbus_verbose ("%s: Received invalid UTF-8 trace data from ANONYMOUS client\n", DBUS_AUTH_NAME (auth)); - - { - DBusString plaintext; - DBusString encoded; - _dbus_string_init_const (&plaintext, "D-Bus " DBUS_VERSION_STRING); - _dbus_string_init (&encoded); - _dbus_string_hex_encode (&plaintext, 0, - &encoded, - 0); - _dbus_verbose ("%s: try '%s'\n", - DBUS_AUTH_NAME (auth), _dbus_string_get_const_data (&encoded)); - } return send_rejected (auth); } @@ -2077,7 +2067,7 @@ handle_client_state_waiting_for_agree_unix_fd(DBusAuth *auth, case DBUS_AUTH_COMMAND_AGREE_UNIX_FD: _dbus_assert(auth->unix_fd_possible); auth->unix_fd_negotiated = TRUE; - _dbus_verbose("Sucessfully negotiated UNIX FD passing\n"); + _dbus_verbose("Successfully negotiated UNIX FD passing\n"); return send_begin (auth); case DBUS_AUTH_COMMAND_ERROR: @@ -2332,6 +2322,47 @@ _dbus_auth_client_new (void) } /** + * 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; +} + +/** * Increments the refcount of an auth object. * * @param auth the auth conversation @@ -2804,7 +2835,7 @@ _dbus_auth_set_unix_fd_possible(DBusAuth *auth, dbus_bool_t b) } /** - * Queries whether unix fd passing was sucessfully negotiated. + * Queries whether unix fd passing was successfully negotiated. * * @param auth the auth conversion * @returns #TRUE when unix fd passing was negotiated.