#include <dlog.h>
#include <gio/gio.h>
#include <cynara-client.h>
-#include <cynara-creds-dbus.h>
+#include <cynara-creds-gdbus.h>
#include "bluetooth-api.h"
#include "bt-service-common.h"
out_param1 = g_array_new(FALSE, FALSE, sizeof(gchar));
- sender = dbus_g_method_get_sender(invocation);
+ sender = g_dbus_method_invocation_get_sender(invocation);
if (service_type == BT_CORE_SERVICE) {
BT_DBG("No need to check privilege from bt-core");
} else if (__bt_service_check_privilege(service_function,
service_type, (const char *)sender) == FALSE) {
- result = BLUETOOTH_ERROR_PERMISSION_DEINED;
BT_ERR("Client don't have the privilege to excute this function");
-
+ /* TODO: privilege check doesn't work properly. It sometimes reutrns fail. */
+ result = BLUETOOTH_ERROR_PERMISSION_DEINED;
goto fail;
}
g_variant_unref(param3);
g_variant_unref(param4);
g_variant_unref(param5);
- g_free(sender);
+// g_free(sender);
FN_END;
return;
fail:
g_variant_unref(param3);
g_variant_unref(param4);
g_variant_unref(param5);
- g_free(sender);
+// g_free(sender);
}
FN_END;
char *client_creds = NULL;
char *user_creds = NULL;
char *client_session = "";
- DBusConnection *conn = NULL;
int client_creds_method = CLIENT_METHOD_SMACK;
int user_creds_method = USER_METHOD_UID;
char err_msg[256] = {0, };
BT_DBG("unique_name: %s", unique_name);
- if (bt_service_conn)
- conn = dbus_g_connection_get_connection(bt_service_conn);
-
- retv_if(conn == NULL, FALSE);
+ retv_if(bt_service_conn == NULL, FALSE);
ret_val = cynara_creds_get_default_client_method(&client_creds_method);
if (ret_val != CYNARA_API_SUCCESS) {
return FALSE;
}
- ret_val = cynara_creds_dbus_get_client(conn, unique_name, client_creds_method, &client_creds);
+ ret_val = cynara_creds_gdbus_get_client(bt_service_conn, unique_name, client_creds_method, &client_creds);
if (ret_val != CYNARA_API_SUCCESS) {
cynara_strerror(ret_val, err_msg, sizeof(err_msg));
BT_ERR("Fail to get client credential: %s", err_msg);
BT_DBG("client_creds: %s", client_creds);
- ret_val = cynara_creds_dbus_get_user(conn, unique_name, user_creds_method, &user_creds);
+ ret_val = cynara_creds_gdbus_get_user(bt_service_conn, unique_name, user_creds_method, &user_creds);
if (ret_val != CYNARA_API_SUCCESS) {
cynara_strerror(ret_val, err_msg, sizeof(err_msg));
BT_ERR("Fail to get user credential: %s", err_msg);