merge from tizen 2.4 70/42970/1 accepted/tizen/mobile/20150707.035220 submit/tizen_mobile/20150706.121110
authorjiseob.jang <jiseob.jang@samsung.com>
Mon, 6 Jul 2015 11:30:42 +0000 (20:30 +0900)
committerjiseob.jang <jiseob.jang@samsung.com>
Mon, 6 Jul 2015 11:30:42 +0000 (20:30 +0900)
Change-Id: I8b7adecb6a23d3aa1e358d5b37f3626d5076b41c
Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
17 files changed:
CMakeLists.txt [changed mode: 0755->0644]
INSTALL [deleted file]
LICENSE [changed mode: 0755->0644]
account-svcd.manifest [moved from libaccounts-svc.manifest with 100% similarity, mode: 0644]
packaging/account-manager.spec [changed mode: 0755->0644]
packaging/accounts-service.service
packaging/org.tizen.account.manager.conf [new file with mode: 0644]
packaging/org.tizen.account.manager.service [new file with mode: 0644]
server/CMakeLists.txt [moved from src/accounts/server/CMakeLists.txt with 60% similarity]
server/include/account-server-db.h [moved from src/accounts/server/account-server-db.h with 96% similarity]
server/include/account-server-private.h [new file with mode: 0644]
server/src/account-server-db.c [moved from src/accounts/server/account-server-db.c with 96% similarity]
server/src/account-server-private.c [new file with mode: 0644]
server/src/account-server.c [moved from src/accounts/server/account-server.c with 92% similarity]
src/accounts/CMakeLists.txt [deleted file]
src/accounts/account_mgr.xml [deleted file]
src/accounts/server/account-svcd.sh [deleted file]

old mode 100755 (executable)
new mode 100644 (file)
index 64ce5f5..6d4b164
@@ -8,4 +8,4 @@ SET(INCLUDEDIR "\${prefix}/include ")
 SET(VERSION_MAJOR 0)
 SET(VERSION "${VERSION_MAJOR}.0.1")
 
-ADD_SUBDIRECTORY(src/accounts)
+ADD_SUBDIRECTORY(server)
diff --git a/INSTALL b/INSTALL
deleted file mode 100755 (executable)
index ddf4e78..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,33 +0,0 @@
-1. make the build directory
-
-  ex) 
-
-   $ mkdir build
-
-
-2. change the working directory to the build directory
-
-  ex)
-
-   $ cd build
-
-
-3. run 'cmake'
-
-  $ cmake ${SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=/usr
-
-  ex)
-
-   $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
-
-   or
-
-   $ cmake ..
-
-
-4. make & make install
-
-  ex)
-
-   $ make -j 2 && make install
-
diff --git a/LICENSE b/LICENSE
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from libaccounts-svc.manifest
rename to account-svcd.manifest
old mode 100755 (executable)
new mode 100644 (file)
index 436cab3..e80a097
@@ -7,9 +7,10 @@ Group:      Social & Content/Other
 License:    Apache-2.0
 Source0:    account-manager-%{version}.tar.gz
 Source1:    accounts-service.service
+Source2:    org.tizen.account.manager.service
+Source3:       org.tizen.account.manager.conf
 
 BuildRequires:  cmake
-BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(db-util)
 BuildRequires:  pkgconfig(capi-base-common)
@@ -17,13 +18,12 @@ BuildRequires:  pkgconfig(pkgmgr-info)
 BuildRequires:  pkgconfig(aul)
 BuildRequires: pkgconfig(glib-2.0) >= 2.26
 BuildRequires:  pkgconfig(gio-2.0)
-BuildRequires:  pkgconfig(gio-unix-2.0)
+BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-session)
 BuildRequires:  pkgconfig(cynara-creds-gdbus)
+BuildRequires:  pkgconfig(account-common)
 BuildRequires:  pkgconfig(accounts-svc)
-BuildRequires:  python-xml
-BuildRequires:  python-devel
 
 Requires(post): /sbin/ldconfig
 Requires(post): /usr/bin/sqlite3
@@ -34,6 +34,7 @@ Account Daemon: no
 
 %prep
 %setup -q
+cp %{SOURCE2} .
 
 %build
 #export   CFLAGS+=" -Wextra -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wswitch-default"
@@ -44,8 +45,9 @@ Account Daemon: no
 #export   CFLAGS+=" -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow -fno-common"
 #export CXXFLAGS+=" -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"
 
-export CFLAGS="${CFLAGS} -fPIC -fvisibility=hidden"
-cmake . -DCMAKE_INSTALL_PREFIX=/usr
+export CFLAGS="${CFLAGS} -fvisibility=hidden -fPIE"
+export LDFLAGS="${LDFLAGS} -pie"
+cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir}
 
 make %{?jobs:-j%jobs}
 
@@ -53,12 +55,20 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 %make_install
 
-mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+mkdir -p %{buildroot}%{_unitdir}/default.target.wants
 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/accounts-service.service
-ln -s ../accounts-service.service %{buildroot}%{_unitdir}/multi-user.target.wants/accounts-service.service
+ln -s ../accounts-service.service %{buildroot}%{_unitdir}/default.target.wants/accounts-service.service
+#ln -s ../accounts-service.service %{buildroot}%{_unitdir}/multi-user.target.wants/accounts-service.service
 
 rm -rf %{buildroot}/usr/lib/account-manager
 
+
+mkdir -p %{buildroot}%{_unitdir}/dbus-1/system-services
+install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}/dbus-1/system-services/org.tizen.account.manager.service
+
+mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
+install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/dbus-1/system.d/
+
 %post
 /sbin/ldconfig
 #if [ ! -d /opt/usr/dbspace ]
@@ -72,12 +82,12 @@ then
         CREATE TABLE if not exists account_type (_id INTEGER PRIMARY KEY AUTOINCREMENT, AppId TEXT,
         ServiceProviderId TEXT, IconPath TEXT, SmallIconPath TEXT, MultipleAccountSupport INT);
         CREATE TABLE if not exists account_custom (AccountId INTEGER, AppId TEXT, Key TEXT, Value TEXT);
-        CREATE TABLE if not exists account (id INTEGER PRIMARY KEY AUTOINCREMENT, user_name TEXT, email_address TEXT, display_name TEXT, icon_path TEXT,
+        CREATE TABLE if not exists account (_id INTEGER PRIMARY KEY AUTOINCREMENT, user_name TEXT, email_address TEXT, display_name TEXT, icon_path TEXT,
         source TEXT, package_name TEXT, access_token TEXT, domain_name TEXT, auth_type INTEGER, secret INTEGER, sync_support INTEGER,
         txt_custom0 TEXT, txt_custom1 TEXT, txt_custom2 TEXT, txt_custom3 TEXT, txt_custom4 TEXT,
         int_custom0 INTEGER, int_custom1 INTEGER, int_custom2 INTEGER, int_custom3 INTEGER, int_custom4 INTEGER);
         CREATE TABLE if not exists capability (_id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT, value INTEGER,
-       package_name TEXT, user_name TEXT,  account_id INTEGER, FOREIGN KEY (account_id) REFERENCES account(id));
+       package_name TEXT, user_name TEXT,  account_id INTEGER, FOREIGN KEY (account_id) REFERENCES account(_id));
        CREATE TABLE if not exists provider_feature (app_id TEXT, key TEXT);
 '
 fi
@@ -90,11 +100,11 @@ chmod 600 %{TZ_SYS_DB}/.account.db-journal
 
 #set message key value to NULL
 #vconftool set -t string db/account/msg '' -g 6514
-vconftool set -tf string db/account/msg '' -s libaccounts-svc -u 200 -g 5000
+#vconftool set -tf string db/account/msg '' -s libaccounts-svc -u 200 -g 5000
 
 #smack labeling
-chsmack -a 'System' %{TZ_SYS_DB}/.account.db-journal
-chsmack -a 'System' %{TZ_SYS_DB}/.account.db
+#chsmack -a 'System' %{TZ_SYS_DB}/.account.db-journal
+#chsmack -a 'System' %{TZ_SYS_DB}/.account.db
 
 
 %postun -p /sbin/ldconfig
@@ -102,9 +112,12 @@ chsmack -a 'System' %{TZ_SYS_DB}/.account.db
 
 
 %files
-%manifest libaccounts-svc.manifest
-%defattr(-,root,root,-)
+%manifest account-svcd.manifest
+%defattr(-,system,system,-)
+%config %{_sysconfdir}/dbus-1/system.d/org.tizen.account.manager.conf
 %attr(0755,root,root) %{_bindir}/account-svcd
 %attr(-,root,root) %{_unitdir}/accounts-service.service
-%attr(-,root,root) %{_unitdir}/multi-user.target.wants/accounts-service.service
+#%attr(-,root,root) %{_unitdir}/multi-user.target.wants/accounts-service.service
+%attr(-,root,root) %{_unitdir}/default.target.wants/accounts-service.service
+%attr(-,root,root) %{_unitdir}/dbus-1/system-services/org.tizen.account.manager.service
 
index 0e2fbc8..26ee5e8 100644 (file)
@@ -2,13 +2,13 @@
 Description=Accounts service
 
 [Service]
-User=system
-Group=system
-
+#User=system
+#Group=system
 Type=simple
 ExecStart=/usr/bin/account-svcd
 Restart=always
 RestartSec=1
 
+
 [Install]
-WantedBy=multi-user.target
+WantedBy=default.target
diff --git a/packaging/org.tizen.account.manager.conf b/packaging/org.tizen.account.manager.conf
new file mode 100644 (file)
index 0000000..3fb0ac4
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+       <policy user="root">
+               <allow own="org.tizen.account.manager"/>
+               <allow send_destination="org.tizen.account.manager"/>
+               <allow send_interface="org.tizen.account.manager"/>
+               <allow receive_sender="org.tizen.account.manager"/>
+       </policy>
+       <policy user="system">
+               <allow own="org.tizen.account.manager"/>
+               <allow send_destination="org.tizen.account.manager"/>
+               <allow send_interface="org.tizen.account.manager"/>
+               <allow receive_sender="org.tizen.account.manager"/>
+       </policy>
+       <policy at_console="true">
+               <allow send_destination="org.tizen.account.manager"/>
+               <allow receive_sender="org.tizen.account.manager"/>
+       </policy>
+       <policy context="default">
+               <deny own="org.tizen.account.manager"/>
+               <allow send_destination="org.tizen.account.manager"/>
+               <allow receive_sender="org.tizen.account.manager"/>
+       </policy>
+</busconfig>
diff --git a/packaging/org.tizen.account.manager.service b/packaging/org.tizen.account.manager.service
new file mode 100644 (file)
index 0000000..aedd241
--- /dev/null
@@ -0,0 +1,5 @@
+[D-BUS Service]
+Name=org.tizen.account.manager
+Exec=/usr/bin/account-svcd
+User=system
+Group=system
similarity index 60%
rename from src/accounts/server/CMakeLists.txt
rename to server/CMakeLists.txt
index c4aae52..ff73019 100644 (file)
@@ -8,12 +8,12 @@ pkg_check_modules(pkgs REQUIRED
                capi-base-common
                pkgmgr-info
                aul
-               dbus-1
                gio-2.0
-               gio-unix-2.0
+               vconf
                cynara-client
                cynara-session
                cynara-creds-gdbus
+               account-common
                accounts-svc
 )
 
@@ -22,21 +22,17 @@ FOREACH(flag ${pkgs_CFLAGS})
 ENDFOREACH(flag)
 
 SET(SERVER_SRCS
-       account-server.c
-       account-server-db.c
+       src/account-server-private.c
+       src/account-server.c
+       src/account-server-db.c
 )
 
-ADD_CUSTOM_COMMAND(
-       WORKING_DIRECTORY
-       OUTPUT account-mgr-stub.c
-       COMMAND gdbus-codegen --interface-prefix org.tizen.
-       --generate-c-code account-mgr-stub ../account_mgr.xml
-       COMMENT "Generating Account SVC GDBus .c/.h")
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/server/include)
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
 SET(CMAKE_LDFLAGS "-Wl,-zdefs")
 
-ADD_EXECUTABLE(${DAEMON} ${SERVER_SRCS} account-mgr-stub.c)
+ADD_EXECUTABLE(${DAEMON} ${SERVER_SRCS})
 
 TARGET_LINK_LIBRARIES(${DAEMON} ${pkgs_LDFLAGS})
 
similarity index 96%
rename from src/accounts/server/account-server-db.h
rename to server/include/account-server-db.h
index 41b3e6c..dbfb400 100644 (file)
 
 #ifndef __ACC_SERVER_DB_H__
 
-#include <db-util.h>
-#include "account-private.h"
-
-typedef sqlite3_stmt* account_stmt;
+#include <account-private.h>
 
 //ACCOUNT_TABLE
 #define ACCOUNT_SCHEMA "create table account \n"\
        "(\n"\
-"id INTEGER PRIMARY KEY, "\
+"_id INTEGER PRIMARY KEY, "\
 "user_name TEXT, "\
 "email_address TEXT, "\
 "display_name TEXT, "\
@@ -99,7 +96,7 @@ typedef sqlite3_stmt* account_stmt;
 
 
 int _account_insert_to_db(account_s* account, int pid, int *account_id);
-int _account_db_open(int mode, const char* account_db_path);
+int _account_db_open(int mode, int pid);
 int _account_db_close(void);
 int _account_type_insert_to_db(account_type_s* account_type, int* account_type_id);
 GSList* _account_db_query_all(int pid);
diff --git a/server/include/account-server-private.h b/server/include/account-server-private.h
new file mode 100644 (file)
index 0000000..adef72e
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *  account
+ *
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jiseob Jang <jiseob.jang@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ACCOUNT_SERVER_PRIVATE_H__
+#define __ACCOUNT_SERVER_PRIVATE_H__
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <glib.h>
+#include <account-private.h>
+
+int _account_gslist_free(GSList* list);
+int _account_glist_free(GList* list);
+int _account_free_capability_items(account_capability_s *data);
+int _account_custom_item_free(account_custom_s *data);
+int _account_custom_gslist_free(GSList* list);
+int _account_free_account_items(account_s *data);
+int _account_type_free_label_items(label_s *data);
+int _account_type_free_feature_items(provider_feature_s *data);
+int _account_type_gslist_free(GSList* list);
+int _account_type_item_free(account_type_s *data);
+//int _account_type_glist_free(GList* list);
+int _account_type_free_account_type_items(account_type_s *data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ACCOUNT_SERVER_PRIVATE_H__*/
similarity index 96%
rename from src/accounts/server/account-server-db.c
rename to server/src/account-server-db.c
index 39d4ac1..42678c7 100644 (file)
@@ -20,7 +20,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
-#include <account.h>
 #include <glib.h>
 #include <db-util.h>
 #include <pthread.h>
 #include <aul.h>
 #include <unistd.h>
 
-#include "account-private.h"
+#include <dbg.h>
+#include <account_ipc_marshal.h>
+#include <account-private.h>
+#include <account.h>
+#include <account-error.h>
+#include "account-server-private.h"
 #include "account-server-db.h"
-#include "dbg.h"
-#include "account_ipc_marshal.h"
 
 typedef sqlite3_stmt* account_stmt;
 
@@ -57,9 +59,11 @@ typedef sqlite3_stmt* account_stmt;
 #define ACCOUNT_DB_OPEN_READONLY 0
 #define ACCOUNT_DB_OPEN_READWRITE 1
 
+#define MAX_TEXT 4096
+
 #define _TIZEN_PUBLIC_
 #ifndef _TIZEN_PUBLIC_
-#include <csc-feature.h>
+//#include <csc-feature.h>
 
 #endif
 
@@ -68,8 +72,6 @@ static sqlite3* g_hAccountDB2 = NULL;
 pthread_mutex_t account_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static char *_account_get_text(const char *text_data);
-static int _account_gslist_free(GSList* list);
-static int _account_glist_free(GList* list);
 static const char *_account_query_table_column_text(account_stmt pStmt, int pos);
 static int _account_insert_custom(account_s *account, int account_id);
 static int _account_update_custom(account_s *account, int account_id);
@@ -166,7 +168,7 @@ static char* _account_get_current_appid(int pid)
        ret = aul_app_get_appid_bypid(pid, appid, sizeof(appid));
 
        if(ret < 0){
-               ACCOUNT_ERROR("fail to get current appid\n");
+               ACCOUNT_ERROR("fail to get current appid ret=[%d], appid=%s\n", ret, appid);
        }
 
        _INFO("");
@@ -410,6 +412,7 @@ static int _remove_sensitive_info_from_non_owning_account(int caller_pid, accoun
                        account->access_token = NULL;
 
                }
+               _ACCOUNT_FREE(caller_package_name);
                return ACCOUNT_ERROR_NONE;
        }
        return ACCOUNT_ERROR_INVALID_PARAMETER;
@@ -417,6 +420,8 @@ static int _remove_sensitive_info_from_non_owning_account(int caller_pid, accoun
 
 static int _remove_sensitive_info_from_non_owning_account_list(int caller_pid, GList *account_list)
 {
+       int return_code = ACCOUNT_ERROR_NONE;
+
        if (account_list == NULL)
        {
                _ERR("Null input");
@@ -427,13 +432,17 @@ static int _remove_sensitive_info_from_non_owning_account_list(int caller_pid, G
        for (list_iter = account_list; list_iter != NULL; list_iter = g_list_next(list_iter))
        {
                account_s *account = (account_s *) list_iter->data;
-               return _remove_sensitive_info_from_non_owning_account(caller_pid, account);
+               int ret = _remove_sensitive_info_from_non_owning_account(caller_pid, account);
+               if( ret != ACCOUNT_ERROR_NONE)
+                       return_code = ret;
        }
-       return ACCOUNT_ERROR_INVALID_PARAMETER;
+       return return_code;
 }
 
 static int _remove_sensitive_info_from_non_owning_account_slist(int caller_pid, GSList *account_list)
 {
+       int return_code = ACCOUNT_ERROR_NONE;
+
        if (account_list == NULL)
        {
                _ERR("Null input");
@@ -444,9 +453,11 @@ static int _remove_sensitive_info_from_non_owning_account_slist(int caller_pid,
        for (list_iter = account_list; list_iter != NULL; list_iter = g_slist_next(list_iter))
        {
                account_s *account = (account_s *) list_iter->data;
-               return _remove_sensitive_info_from_non_owning_account(caller_pid, account);
+               int ret = _remove_sensitive_info_from_non_owning_account(caller_pid, account);
+               if( ret != ACCOUNT_ERROR_NONE)
+                       return_code = ret;
        }
-       return ACCOUNT_ERROR_INVALID_PARAMETER;
+       return return_code;
 }
 
 static const char *_account_db_err_msg()
@@ -738,16 +749,19 @@ int _account_db_handle_close(sqlite3* hDB)
        return ret;
 }
 
-int _account_db_open(int mode, const char* account_db_path)
+int _account_db_open(int mode, int pid)
 {
        int  rc = 0;
        int ret = -1;
-       char query[ACCOUNT_SQL_LEN_MAX] = {0, };
+       char account_db_path[256] = {0, };
 
-       ACCOUNT_MEMSET(query, 0x00, sizeof(query));
+       _INFO( "start _account_db_open()");
+
+       ACCOUNT_MEMSET(account_db_path, 0x00, sizeof(account_db_path));
+       ACCOUNT_SNPRINTF(account_db_path, sizeof(account_db_path), "%s", ACCOUNT_DB_PATH);
 
        if( g_hAccountDB ) {
-               ACCOUNT_ERROR( "Account database is using in another app. %x", g_hAccountDB );
+               _ERR( "Account database is using in another app. %x", g_hAccountDB );
                return ACCOUNT_ERROR_DATABASE_BUSY;
        }
 
@@ -779,6 +793,7 @@ int _account_db_open(int mode, const char* account_db_path)
                return ACCOUNT_ERROR_DB_NOT_OPENED;
        }
 
+       _INFO( "end _account_db_open()");
        return ACCOUNT_ERROR_NONE;
 }
 
@@ -802,106 +817,6 @@ int _account_db_close(void)
        return ret;
 }
 
-static int _account_free_capability_items(account_capability_s *data)
-{
-       _ACCOUNT_FREE(data->type);
-       _ACCOUNT_FREE(data->package_name);
-       _ACCOUNT_FREE(data->user_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_custom_item_free(account_custom_s *data)
-{
-       _ACCOUNT_FREE(data->app_id);
-       _ACCOUNT_FREE(data->key);
-       _ACCOUNT_FREE(data->value);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_custom_gslist_free(GSList* list)
-{
-       if(!list){
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       GSList* iter;
-
-       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
-               account_custom_s *custom_data = (account_custom_s*)iter->data;
-               _account_custom_item_free(custom_data);
-               _ACCOUNT_FREE(custom_data);
-       }
-
-       g_slist_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_free_account_items(account_s *data)
-{
-       _ACCOUNT_FREE(data->user_name);
-       _ACCOUNT_FREE(data->email_address);
-       _ACCOUNT_FREE(data->display_name);
-       _ACCOUNT_FREE(data->icon_path);
-       _ACCOUNT_FREE(data->source);
-       _ACCOUNT_FREE(data->package_name);
-       _ACCOUNT_FREE(data->domain_name);
-       _ACCOUNT_FREE(data->access_token);
-
-       int i;
-       for(i=0;i<USER_TXT_CNT;i++)
-               _ACCOUNT_FREE(data->user_data_txt[i]);
-
-       _account_gslist_free(data->capablity_list);
-       _account_glist_free(data->account_list);
-       _account_custom_gslist_free(data->custom_list);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_gslist_free(GSList* list)
-{
-       if(!list){
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       GSList* iter;
-
-       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
-               account_capability_s *cap_data = (account_capability_s*)iter->data;
-               _account_free_capability_items(cap_data);
-               _ACCOUNT_FREE(cap_data);
-       }
-
-       g_slist_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_glist_free(GList* list)
-{
-       if(!list){
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       GList* iter;
-
-       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
-               account_s *account_record = (account_s*)iter->data;
-               _account_free_account_items(account_record);
-               _ACCOUNT_FREE(account_record);
-       }
-
-       g_list_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
 static int _account_check_duplicated(account_s *data, const char* verified_appid)
 {
        char query[ACCOUNT_SQL_LEN_MAX] = {0, };
@@ -1219,7 +1134,7 @@ static int _account_insert_capability(account_s *account, int account_id)
                return ACCOUNT_ERROR_NONE;
        }
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where id=%d", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where _id=%d", ACCOUNT_TABLE, account_id);
 
        _INFO("_account_insert_capability _account_get_record_count [%s]", query);
        rc = _account_get_record_count(query);
@@ -1294,7 +1209,7 @@ static int _account_update_capability(account_s *account, int account_id)
                return ACCOUNT_ERROR_NONE;
        }
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where id=%d", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where _id=%d", ACCOUNT_TABLE, account_id);
 
        rc = _account_get_record_count(query);
 
@@ -1938,13 +1853,13 @@ int _account_insert_to_db(account_s* account, int pid, int *account_id)
        _INFO("");
        char* verified_appid = NULL;
        error_code  = _account_check_account_type_with_appid_group(appid, &verified_appid);//FIX
+       _ACCOUNT_FREE(appid);
        if(error_code != ACCOUNT_ERROR_NONE)
        {
-               _INFO("");
+               _ERR("error_code = %d", error_code);
                ret_transaction = _account_end_transaction(FALSE);
                ACCOUNT_ERROR("App id is not registered in account type DB, transaction ret (%x)!!!!\n", ret_transaction);
                _ACCOUNT_FREE(verified_appid);
-               _ACCOUNT_FREE(appid);
                pthread_mutex_unlock(&account_mutex);
                return error_code;
        }
@@ -2027,7 +1942,7 @@ int _account_insert_to_db(account_s* account, int pid, int *account_id)
        char buf[64]={0,};
        ACCOUNT_SNPRINTF(buf, sizeof(buf), "%s:%d", ACCOUNT_NOTI_NAME_INSERT, *account_id);
        _account_insert_delete_update_notification_send(buf);
-       _INFO("(%s)-(%d) account _notification_send.");
+       _INFO("account _notification_send end.");
 
        return ACCOUNT_ERROR_NONE;
 
@@ -2320,7 +2235,7 @@ static int _account_get_package_name_from_account_id(int account_id, char **pack
 
        ACCOUNT_MEMSET(query, 0x00, ACCOUNT_SQL_LEN_MAX);
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE id = %d", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE _id = %d", ACCOUNT_TABLE, account_id);
        hstmt = _account_prepare_query(query);
 
        rc = _account_query_step(hstmt);
@@ -2409,7 +2324,7 @@ static int _account_update_account(int pid, account_s *account, int account_id)
 
        ACCOUNT_MEMSET(query, 0x00, sizeof(query));
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) FROM %s WHERE id = %d ", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) FROM %s WHERE _id = %d ", ACCOUNT_TABLE, account_id);
 
        count = _account_get_record_count(query);
        if (count <= 0) {
@@ -2429,7 +2344,7 @@ static int _account_update_account(int pid, account_s *account, int account_id)
        ACCOUNT_SNPRINTF(query, sizeof(query), "UPDATE %s SET user_name=?, email_address =?, display_name =?, "
                        "icon_path =?, source =?, package_name =? , access_token =?, domain_name =?, auth_type =?, secret =?, sync_support =?,"
                        "txt_custom0=?, txt_custom1=?, txt_custom2=?, txt_custom3=?, txt_custom4=?, "
-                       "int_custom0=?, int_custom1=?, int_custom2=?, int_custom3=?, int_custom4=? WHERE id=? ", ACCOUNT_TABLE);
+                       "int_custom0=?, int_custom1=?, int_custom2=?, int_custom3=?, int_custom4=? WHERE _id=? ", ACCOUNT_TABLE);
 
        hstmt = _account_prepare_query(query);
 
@@ -2504,7 +2419,7 @@ static int _account_update_account_ex(account_s *account, int account_id)
 
        ACCOUNT_MEMSET(query, 0x00, sizeof(query));
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) FROM %s WHERE id = %d ", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) FROM %s WHERE _id = %d ", ACCOUNT_TABLE, account_id);
 
        count = _account_get_record_count(query);
        if (count <= 0) {
@@ -2524,7 +2439,7 @@ static int _account_update_account_ex(account_s *account, int account_id)
        ACCOUNT_SNPRINTF(query, sizeof(query), "UPDATE %s SET user_name=?, email_address =?, display_name =?, "
                        "icon_path =?, source =?, package_name =? , access_token =?, domain_name =?, auth_type =?, secret =?, sync_support =?,"
                        "txt_custom0=?, txt_custom1=?, txt_custom2=?, txt_custom3=?, txt_custom4=?, "
-                       "int_custom0=?, int_custom1=?, int_custom2=?, int_custom3=?, int_custom4=? WHERE id=? ", ACCOUNT_TABLE);
+                       "int_custom0=?, int_custom1=?, int_custom2=?, int_custom3=?, int_custom4=? WHERE _id=? ", ACCOUNT_TABLE);
 
        hstmt = _account_prepare_query(query);
 
@@ -2746,7 +2661,7 @@ int _account_update_sync_status_by_id(int account_db_id, const int sync_status)
 
        ACCOUNT_MEMSET(query, 0x00, ACCOUNT_SQL_LEN_MAX);
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where id=%d", ACCOUNT_TABLE, account_db_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where _id=%d", ACCOUNT_TABLE, account_db_id);
 
        rc = _account_get_record_count(query);
 
@@ -2764,7 +2679,7 @@ int _account_update_sync_status_by_id(int account_db_id, const int sync_status)
 
        ACCOUNT_MEMSET(query, 0x00, ACCOUNT_SQL_LEN_MAX);
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "UPDATE %s SET sync_support=? WHERE id = %d", ACCOUNT_TABLE, account_db_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "UPDATE %s SET sync_support=? WHERE _id = %d", ACCOUNT_TABLE, account_db_id);
        hstmt = _account_prepare_query(query);
 
        _account_query_bind_int(hstmt, count, sync_status);
@@ -2807,7 +2722,7 @@ CATCH:
 
 int _account_query_account_by_account_id(int pid, int account_db_id, account_s *account_record)
 {
-       ACCOUNT_DEBUG("account_db_id=[%d]", account_db_id);
+       _INFO("_account_query_account_by_account_id() start, account_db_id=[%d]", account_db_id);
 
        int                             error_code = ACCOUNT_ERROR_NONE;
        account_stmt    hstmt = NULL;
@@ -2822,10 +2737,12 @@ int _account_query_account_by_account_id(int pid, int account_db_id, account_s *
 
        ACCOUNT_DEBUG("starting db operations");
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE id = %d", ACCOUNT_TABLE, account_db_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE _id = %d", ACCOUNT_TABLE, account_db_id);
        hstmt = _account_prepare_query(query);
+       rc = _account_db_err_code();
+       _INFO("after _account_prepare_query, rc=[%d]", rc);
 
-       if( _account_db_err_code() == SQLITE_PERM ){
+       if( rc == SQLITE_PERM ){
                ACCOUNT_ERROR( "Access failed(%s)", _account_db_err_msg());
                return ACCOUNT_ERROR_PERMISSION_DENIED;
        }
@@ -2999,7 +2916,9 @@ CATCH:
        if (account_head)
        {
                _remove_sensitive_info_from_non_owning_account_list(pid, account_head->account_list);
-               return account_head->account_list;
+               GList* result = account_head->account_list;
+               _ACCOUNT_FREE(account_head);
+               return result;
        }
        return NULL;
 }
@@ -3024,7 +2943,7 @@ _account_query_account_by_capability(int pid, const char* capability_type, const
 
        ACCOUNT_MEMSET(query, 0x00, ACCOUNT_SQL_LEN_MAX);
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE id IN (SELECT account_id from %s WHERE key=? AND value=?)", ACCOUNT_TABLE, CAPABILITY_TABLE);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE _id IN (SELECT account_id from %s WHERE key=? AND value=?)", ACCOUNT_TABLE, CAPABILITY_TABLE);
 
        hstmt = _account_prepare_query(query);
 
@@ -3098,21 +3017,32 @@ _account_query_account_by_capability(int pid, const char* capability_type, const
        }
 
 
-       error_code = ACCOUNT_ERROR_NONE;
+       *error_code = ACCOUNT_ERROR_NONE;
 
 CATCH:
        if (hstmt != NULL) {
                rc = _account_query_finalize(hstmt);
-               ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {*error_code = rc;}, NULL, ("finalize error"));
+               if ( rc != ACCOUNT_ERROR_NONE ) {
+                       *error_code = rc;
+                       _ERR("finalize error");
+               }
                hstmt = NULL;
        }
 
+       if( *error_code != ACCOUNT_ERROR_NONE && account_head ) {
+               _account_glist_free(account_head->account_list);
+               _ACCOUNT_FREE(account_head);
+               account_head = NULL;
+       }
+
        pthread_mutex_unlock(&account_mutex);
 
        if (account_head)
        {
                _remove_sensitive_info_from_non_owning_account_list(pid, account_head->account_list);
-               return account_head->account_list;
+               GList* result = account_head->account_list;
+               _ACCOUNT_FREE(account_head);
+               return result;
        }
        return NULL;
 }
@@ -3130,7 +3060,7 @@ GList* _account_query_account_by_capability_type(int pid, const char* capability
 
        ACCOUNT_MEMSET(query, 0x00, ACCOUNT_SQL_LEN_MAX);
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE id IN (SELECT account_id from %s WHERE key=?)", ACCOUNT_TABLE, CAPABILITY_TABLE);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE _id IN (SELECT account_id from %s WHERE key=?)", ACCOUNT_TABLE, CAPABILITY_TABLE);
 
        hstmt = _account_prepare_query(query);
 
@@ -3206,16 +3136,27 @@ CATCH:
        if (hstmt != NULL)
        {
                rc = _account_query_finalize(hstmt);
-               ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {*error_code = rc;}, NULL, ("finalize error"));
+               if (rc != ACCOUNT_ERROR_NONE) {
+                       *error_code = rc;
+                       _ERR("finalize error");
+               }
                hstmt = NULL;
        }
 
+       if( (*error_code != ACCOUNT_ERROR_NONE) && account_head ) {
+               _account_glist_free(account_head->account_list);
+               _ACCOUNT_FREE(account_head);
+               account_head = NULL;
+       }
+
        pthread_mutex_unlock(&account_mutex);
 
        if (account_head)
        {
                _remove_sensitive_info_from_non_owning_account_list(pid, account_head->account_list);
-               return account_head->account_list;
+               GList* result = account_head->account_list;
+               _ACCOUNT_FREE(account_head);
+               return result;
        }
        return NULL;
 }
@@ -3309,16 +3250,28 @@ CATCH:
        if (hstmt != NULL)
        {
                rc = _account_query_finalize(hstmt);
-               ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {*error_code = rc;}, NULL, ("finalize error"));
+               if (rc != ACCOUNT_ERROR_NONE) {
+                       *error_code = rc;
+                       _ERR("finalize error");
+               }
                hstmt = NULL;
        }
 
        pthread_mutex_unlock(&account_mutex);
+
+       if( (*error_code != ACCOUNT_ERROR_NONE) && account_head ) {
+               _account_glist_free(account_head->account_list);
+               _ACCOUNT_FREE(account_head);
+               account_head = NULL;
+       }
+
        if ((*error_code == ACCOUNT_ERROR_NONE) && account_head != NULL)
        {
                _INFO("Returning account_list");
                _remove_sensitive_info_from_non_owning_account_list(pid,account_head->account_list);
-               return account_head->account_list;
+               GList* result = account_head->account_list;
+               _ACCOUNT_FREE(account_head);
+               return result;
        }
        return NULL;
 }
@@ -3336,7 +3289,7 @@ int _account_delete(int pid, int account_id)
 
        int count = -1;
        /* Check requested ID to delete */
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) FROM %s WHERE id=%d", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) FROM %s WHERE _id=%d", ACCOUNT_TABLE, account_id);
 
        count = _account_get_record_count(query);
 
@@ -3422,7 +3375,7 @@ int _account_delete(int pid, int account_id)
 
        ACCOUNT_MEMSET(query, 0, sizeof(query));
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "DELETE FROM %s WHERE id = %d", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "DELETE FROM %s WHERE _id = %d", ACCOUNT_TABLE, account_id);
 
        hstmt = _account_prepare_query(query);
        ACCOUNT_CATCH_ERROR(hstmt != NULL, {}, ACCOUNT_ERROR_DB_FAILED,
@@ -3831,9 +3784,11 @@ int _account_delete_from_db_by_package_name(int pid, const char *package_name, g
                _INFO("After iter->data");
                if (account != NULL)
                {
-                       char* id = (char*) calloc(1, sizeof(account->id));
+                       char id[256] = {0, };
+
+                       ACCOUNT_MEMSET(id, 0, 256);
 
-                       sprintf(id, "%d", account->id);
+                       ACCOUNT_SNPRINTF(id, 256, "%d", account->id);
 
                        _INFO("Adding account id [%s]", id);
                        account_id_list = g_slist_append(account_id_list, g_strdup(id));
@@ -4022,79 +3977,6 @@ int _account_get_total_count_from_db(gboolean include_hidden, int *count)
        return ACCOUNT_ERROR_NONE;
 }
 
-static int _account_type_free_label_items(label_s *data)
-{
-       _ACCOUNT_FREE(data->app_id);
-       _ACCOUNT_FREE(data->label);
-       _ACCOUNT_FREE(data->locale);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_free_feature_items(provider_feature_s *data)
-{
-       _ACCOUNT_FREE(data->app_id);
-       _ACCOUNT_FREE(data->key);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_gslist_free(GSList* list)
-{
-       ACCOUNT_RETURN_VAL((list != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("GSlist is NULL"));
-
-       GSList* iter;
-
-       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
-               label_s *label_data = (label_s*)iter->data;
-               _account_type_free_label_items(label_data);
-               _ACCOUNT_FREE(label_data);
-       }
-
-       g_slist_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_item_free(account_type_s *data)
-{
-       _ACCOUNT_FREE(data->app_id);
-       _ACCOUNT_FREE(data->service_provider_id);
-       _ACCOUNT_FREE(data->icon_path);
-       _ACCOUNT_FREE(data->small_icon_path);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_glist_free(GList* list)
-{
-       ACCOUNT_RETURN_VAL((list != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Glist is NULL"));
-
-       GList* iter;
-
-       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
-               account_type_s *account_type_record = (account_type_s*)iter->data;
-               _account_type_item_free(account_type_record);
-               _ACCOUNT_FREE(account_type_record);
-       }
-
-       g_list_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_free_account_type_items(account_type_s *data)
-{
-       _account_type_item_free(data);
-
-       _account_type_gslist_free(data->label_list);
-       _account_type_glist_free(data->account_type_list);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
 int account_type_create(account_type_h *account_type)
 {
        if (!account_type) {
@@ -5853,7 +5735,7 @@ static int _account_insert_custom(account_s *account, int account_id)
                return ACCOUNT_ERROR_NONE;
        }
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where id=%d", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where _id=%d", ACCOUNT_TABLE, account_id);
 
        rc = _account_get_record_count(query);
 
@@ -5929,7 +5811,7 @@ static int _account_update_custom(account_s *account, int account_id)
                return ACCOUNT_ERROR_NONE;
        }
 
-       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where id=%d", ACCOUNT_TABLE, account_id);
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where _id=%d", ACCOUNT_TABLE, account_id);
 
        rc = _account_get_record_count(query);
 
diff --git a/server/src/account-server-private.c b/server/src/account-server-private.c
new file mode 100644 (file)
index 0000000..3611491
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ *
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <account-types.h>
+#include <account-error.h>
+#include <account-private.h>
+#include "account-server-private.h"
+
+int _account_glist_free(GList* list)
+{
+       if(!list){
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       GList* iter;
+
+       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
+               account_s *account_record = (account_s*)iter->data;
+               _account_free_account_items(account_record);
+               _ACCOUNT_FREE(account_record);
+       }
+
+       g_list_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_gslist_free(GSList* list)
+{
+       if(!list){
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               account_capability_s *cap_data = (account_capability_s*)iter->data;
+               _account_free_capability_items(cap_data);
+               _ACCOUNT_FREE(cap_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_custom_gslist_free(GSList* list)
+{
+       if(!list){
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               account_custom_s *custom_data = (account_custom_s*)iter->data;
+               _account_custom_item_free(custom_data);
+               _ACCOUNT_FREE(custom_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_free_capability_items(account_capability_s *data)
+{
+       if(!data)
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+
+       _ACCOUNT_FREE(data->type);
+       _ACCOUNT_FREE(data->package_name);
+       _ACCOUNT_FREE(data->user_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_custom_item_free(account_custom_s *data)
+{
+       if(!data)
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->key);
+       _ACCOUNT_FREE(data->value);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_free_account_items(account_s *data)
+{
+       if(!data)
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+
+       _ACCOUNT_FREE(data->user_name);
+       _ACCOUNT_FREE(data->email_address);
+       _ACCOUNT_FREE(data->display_name);
+       _ACCOUNT_FREE(data->icon_path);
+       _ACCOUNT_FREE(data->source);
+       _ACCOUNT_FREE(data->package_name);
+       _ACCOUNT_FREE(data->domain_name);
+       _ACCOUNT_FREE(data->access_token);
+
+       int i;
+       for(i=0;i<USER_TXT_CNT;i++)
+               _ACCOUNT_FREE(data->user_data_txt[i]);
+
+       _account_gslist_free(data->capablity_list);
+       _account_glist_free(data->account_list);
+       _account_custom_gslist_free(data->custom_list);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_type_free_label_items(label_s *data)
+{
+       if(!data)
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->label);
+       _ACCOUNT_FREE(data->locale);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_type_free_feature_items(provider_feature_s *data)
+{
+       if(!data)
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->key);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_type_gslist_free(GSList* list)
+{
+       ACCOUNT_RETURN_VAL((list != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("GSlist is NULL"));
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               label_s *label_data = (label_s*)iter->data;
+               _account_type_free_label_items(label_data);
+               _ACCOUNT_FREE(label_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_type_item_free(account_type_s *data)
+{
+       if(!data)
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->service_provider_id);
+       _ACCOUNT_FREE(data->icon_path);
+       _ACCOUNT_FREE(data->small_icon_path);
+
+       return ACCOUNT_ERROR_NONE;
+}
+/*
+int _account_type_glist_free(GList* list)
+{
+       ACCOUNT_RETURN_VAL((list != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Glist is NULL"));
+
+       GList* iter;
+
+       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
+               account_type_s *account_type_record = (account_type_s*)iter->data;
+               _account_type_item_free(account_type_record);
+               _ACCOUNT_FREE(account_type_record);
+       }
+
+       g_list_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+*/
+int _account_type_free_account_type_items(account_type_s *data)
+{
+       if(!data)
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+
+       _account_type_item_free(data);
+
+       _account_type_gslist_free(data->label_list);
+//     _account_type_glist_free(data->account_type_list);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
similarity index 92%
rename from src/accounts/server/account-server.c
rename to server/src/account-server.c
index 06b1602..c9793de 100644 (file)
 #include <cynara-session.h>
 #include <cynara-creds-gdbus.h>
 
-#include <gio/gio.h>
+#include <dbg.h>
+#include <account_ipc_marshal.h>
+#include <account-mgr-stub.h>
+#include <account-private.h>
+#include <account-error.h>
 
-#include "dbg.h"
+#include "account-server-private.h"
 #include "account-server-db.h"
-#include "account_ipc_marshal.h"
-#include "account-mgr-stub.h"
-#include "account-private.h"
-#include "account-error.h"
-
 #define _PRIVILEGE_ACCOUNT_READ "http://tizen.org/privilege/account.read"
 #define _PRIVILEGE_ACCOUNT_WRITE "http://tizen.org/privilege/account.write"
 
@@ -244,6 +243,7 @@ gboolean account_manager_account_add(AccountManager *obj, GDBusMethodInvocation
 {
        _INFO("account_manager_account_add start");
        int db_id = -1;
+       account_s* account = NULL;
 
        guint pid = _get_client_pid(invocation);
        _INFO("client Id = [%u]", pid);
@@ -262,7 +262,7 @@ gboolean account_manager_account_add(AccountManager *obj, GDBusMethodInvocation
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
                _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
@@ -270,7 +270,7 @@ gboolean account_manager_account_add(AccountManager *obj, GDBusMethodInvocation
                goto RETURN;
        }
 
-       account_s* account = umarshal_account(account_data);
+       account = umarshal_account(account_data);
        if (account == NULL)
        {
                _ERR("account unmarshalling failed");
@@ -309,6 +309,8 @@ RETURN:
                return_code = ACCOUNT_ERROR_NONE;
        }
 
+       _account_free_account_items(account);
+
        return true;
 }
 
@@ -328,10 +330,10 @@ gboolean account_manager_account_query_all(AccountManager *obj, GDBusMethodInvoc
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -393,10 +395,10 @@ gboolean account_manager_account_type_query_all(AccountManager *obj, GDBusMethod
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -446,6 +448,7 @@ RETURN:
 gboolean account_manager_account_type_add(AccountManager *obj, GDBusMethodInvocation *invocation, gchar *account_db_path, GVariant *account_type_data, gpointer user_data)
 {
        int db_id = -1;
+       account_type_s* account_type = NULL;
 
        _INFO("account_manager_account_type_add start");
 
@@ -465,15 +468,15 @@ gboolean account_manager_account_type_add(AccountManager *obj, GDBusMethodInvoca
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
 
-       account_type_s* account_type = umarshal_account_type(account_type_data);
+       account_type = umarshal_account_type(account_type_data);
        if (account_type == NULL)
        {
                _ERR("account_type unmarshalling failed");
@@ -511,6 +514,7 @@ RETURN:
                return_code = ACCOUNT_ERROR_NONE;
        }
 
+       _account_type_free_account_type_items(account_type);
        return true;
 }
 
@@ -537,10 +541,10 @@ gboolean account_manager_account_delete_from_db_by_id(AccountManager *object,
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -603,10 +607,10 @@ gboolean account_manager_account_delete_from_db_by_user_name(AccountManager *obj
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -668,10 +672,10 @@ gboolean account_manager_account_delete_from_db_by_package_name(AccountManager *
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -717,6 +721,7 @@ gboolean account_manager_account_update_to_db_by_id(AccountManager *object,
                                                                                                                        gint account_id)
 {
        _INFO("account_manager_account_update_to_db_by_id start");
+       account_s* account = NULL;
 
        guint pid = _get_client_pid(invocation);
        _INFO("client Id = [%u]", pid);
@@ -734,15 +739,15 @@ gboolean account_manager_account_update_to_db_by_id(AccountManager *object,
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
 
-       account_s* account = umarshal_account(account_data);
+       account = umarshal_account(account_data);
        if (account == NULL)
        {
                _ERR("Unmarshal failed");
@@ -781,6 +786,8 @@ RETURN:
                return_code = ACCOUNT_ERROR_NONE;
        }
 
+       _account_free_account_items(account);
+
        return true;
 }
 
@@ -792,6 +799,7 @@ gboolean account_manager_handle_account_update_to_db_by_user_name(AccountManager
                                                                                                                        const gchar *package_name)
 {
        _INFO("account_manager_handle_account_update_to_db_by_user_name start");
+       account_s* account = NULL;
 
        guint pid = _get_client_pid(invocation);
        _INFO("client Id = [%u]", pid);
@@ -809,15 +817,15 @@ gboolean account_manager_handle_account_update_to_db_by_user_name(AccountManager
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
 
-       account_s* account = umarshal_account(account_data);
+       account = umarshal_account(account_data);
        if (account == NULL)
        {
                _ERR("Unmarshal failed");
@@ -856,6 +864,8 @@ RETURN:
                return_code = ACCOUNT_ERROR_NONE;
        }
 
+       _account_free_account_items(account);
+
        return true;
 }
 
@@ -878,10 +888,10 @@ account_manager_handle_account_type_query_label_by_locale(AccountManager *object
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -939,10 +949,10 @@ account_manager_handle_account_type_query_by_provider_feature(AccountManager *ob
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1013,10 +1023,10 @@ gboolean account_manager_account_get_total_count_from_db(AccountManager *object,
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1061,6 +1071,7 @@ gboolean account_manager_handle_account_query_account_by_account_id(AccountManag
 {
        _INFO("account_manager_handle_account_query_account_by_account_id start");
        GVariant* account_variant = NULL;
+       account_s* account_data = NULL;
 
        guint pid = _get_client_pid(invocation);
 
@@ -1073,15 +1084,15 @@ gboolean account_manager_handle_account_query_account_by_account_id(AccountManag
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
 
-       account_s* account_data = create_empty_account_instance();
+       account_data = create_empty_account_instance();
        if (account_data == NULL)
        {
                _ERR("out of memory");
@@ -1123,6 +1134,8 @@ RETURN:
                return_code = ACCOUNT_ERROR_NONE;
        }
 
+       _account_free_account_items(account_data);
+
        return true;
 }
 
@@ -1145,10 +1158,10 @@ account_manager_handle_account_query_account_by_user_name(AccountManager *obj,
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1219,10 +1232,10 @@ account_manager_handle_account_query_account_by_package_name(AccountManager *obj
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1296,10 +1309,10 @@ account_manager_handle_account_query_account_by_capability(AccountManager *obj,
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1373,10 +1386,10 @@ account_manager_handle_account_query_account_by_capability_type(AccountManager *
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1450,11 +1463,10 @@ account_manager_handle_account_query_capability_by_account_id(AccountManager *ob
                goto RETURN;
        }
 
-
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1531,10 +1543,10 @@ gboolean account_manager_handle_account_update_sync_status_by_id(AccountManager
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1594,10 +1606,10 @@ gboolean account_manager_handle_account_type_query_provider_feature_by_app_id(Ac
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1665,10 +1677,10 @@ gboolean account_manager_handle_account_type_query_supported_feature(AccountMana
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1713,6 +1725,7 @@ gboolean account_manager_handle_account_type_update_to_db_by_app_id (AccountMana
                                                                                                                        const gchar *app_id)
 {
        _INFO("account_manager_handle_account_type_update_to_db_by_app_id start");
+       account_type_s* account_type = NULL;
 
        guint pid = _get_client_pid(invocation);
 
@@ -1731,15 +1744,15 @@ gboolean account_manager_handle_account_type_update_to_db_by_app_id (AccountMana
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
 
-       account_type_s* account_type = umarshal_account_type(account_type_variant);
+       account_type = umarshal_account_type(account_type_variant);
 
        _INFO("before _account_type_update_to_db_by_app_id");
        return_code = _account_type_update_to_db_by_app_id(account_type, app_id);
@@ -1771,6 +1784,8 @@ RETURN:
                return_code = ACCOUNT_ERROR_NONE;
        }
 
+       _account_type_free_account_type_items(account_type);
+
        return true;
 }
 
@@ -1798,10 +1813,10 @@ gboolean account_manager_handle_account_type_delete_by_app_id (AccountManager *o
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1859,10 +1874,10 @@ gboolean account_manager_handle_account_type_query_label_by_app_id (AccountManag
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1921,10 +1936,10 @@ gboolean account_manager_handle_account_type_query_by_app_id (AccountManager *ob
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -1988,10 +2003,10 @@ gboolean account_manager_handle_account_type_query_app_id_exist (AccountManager
                goto RETURN;
        }
 
-       return_code = _account_db_open(0, (const char*)account_db_path);
+       return_code = _account_db_open(0, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
@@ -2037,6 +2052,7 @@ gboolean account_manager_handle_account_update_to_db_by_id_ex (AccountManager *o
                                                                                                                        gint account_id)
 {
        _INFO("account_manager_handle_account_update_to_db_by_id_ex start");
+       account_s* account = NULL;
        guint pid = _get_client_pid(invocation);
 
        _INFO("client Id = [%u]", pid);
@@ -2054,15 +2070,15 @@ gboolean account_manager_handle_account_update_to_db_by_id_ex (AccountManager *o
                goto RETURN;
        }
 
-       return_code = _account_db_open(1, (const char*)account_db_path);
+       return_code = _account_db_open(1, pid);
        if (return_code != ACCOUNT_ERROR_NONE)
        {
-               _ERR("_account_db_open() error, db_path = %s, ret = %d", (char*)account_db_path, return_code);
+               _ERR("_account_db_open() error, ret = %d", return_code);
 
                goto RETURN;
        }
 
-       account_s* account = umarshal_account(account_data);
+       account = umarshal_account(account_data);
        if (account == NULL)
        {
                _ERR("Unmarshal failed");
@@ -2101,6 +2117,8 @@ RETURN:
                return_code = ACCOUNT_ERROR_NONE;
        }
 
+       _account_free_account_items(account);
+
        return true;
 }
 
@@ -2212,6 +2230,10 @@ on_bus_acquired (GDBusConnection *connection, const gchar *name, gpointer user_d
                _INFO("connecting account signals end");
 
                g_dbus_object_manager_server_set_connection(account_mgr_server_mgr, connection);
+               if( connection == NULL ) {
+                       _INFO("g_dbus_object_manager_server_set_connection failed");
+               }
+               _INFO("on_bus_acquired end [%s]", name);
 }
 
 static void
@@ -2257,8 +2279,6 @@ static bool _initialize_dbus()
        return true;
 }
 
-
-
 static void _initialize()
 {
 #if !GLIB_CHECK_VERSION(2,35,0)
@@ -2288,10 +2308,16 @@ int main()
 
        mainloop = g_main_loop_new(NULL, FALSE);
 
+       _INFO("g_main_loop_new");
+
        _initialize();
 
+       _INFO("_initialize");
+
        g_main_loop_run(mainloop);
 
+       _INFO("g_main_loop_run");
+
        cynara_finish(p_cynara);
 
        _INFO("Ending Accounts SVC");
diff --git a/src/accounts/CMakeLists.txt b/src/accounts/CMakeLists.txt
deleted file mode 100755 (executable)
index 7c2af46..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ADD_SUBDIRECTORY(server)
diff --git a/src/accounts/account_mgr.xml b/src/accounts/account_mgr.xml
deleted file mode 100644 (file)
index a8a95d5..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<node name="/org/tizen/account/manager">
-  <interface name="org.tizen.account.manager">
-    <method name="account_add">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_data" direction="in" />
-      <arg type="i" name="account_db_id" direction="out" />
-    </method>
-    <method name="account_type_add">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_type_data" direction="in" />
-      <arg type="i" name="account_type_db_id" direction="out" />
-    </method>
-    <method name="account_query_all">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="aa{sv}" name="account_data" direction="out" />
-    </method>
-    <method name="account_type_query_all">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="aa{sv}" name="account_type_data" direction="out" />
-    </method>
-    <method name="account_delete_from_db_by_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="i" name="account_db_id" direction="in" />
-    </method>
-    <method name="account_delete_from_db_by_user_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="user_name" direction="in" />
-      <arg type="s" name="package_name" direction="in" />
-    </method>
-    <method name="account_delete_from_db_by_package_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="package_name" direction="in" />
-      <arg type="b" name="permission" direction="in" />
-    </method>
-    <method name="account_update_to_db_by_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_data" direction="in" />
-      <arg type="i" name="account_id" direction="in" />
-    </method>
-    <method name="account_get_total_count_from_db">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="b" name="include_hidden" direction="in" />
-      <arg type="i" name="count" direction="out" />
-    </method>
-    <method name="account_query_account_by_account_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="i" name="account_db_id" direction="in" />
-      <arg type="a{sv}" name="account_data" direction="out" />
-    </method>
-    <method name="account_update_to_db_by_user_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_data" direction="in" />
-      <arg type="s" name="user_name" direction="in" />
-      <arg type="s" name="package_name" direction="in" />
-    </method>
-    <method name="account_type_query_label_by_locale">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="s" name="locale" direction="in" />
-      <arg type="s" name="label_name" direction="out" />
-    </method>
-    <method name="account_type_query_by_provider_feature">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="key" direction="in" />
-      <arg type="aa{sv}" name="account_type_list_data" direction="out" />
-    </method>
-    <method name="account_query_account_by_user_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="user_name" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_query_account_by_package_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="package_name" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_query_account_by_capability">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="capability_type" direction="in" />
-      <arg type="i" name="capability_value" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_query_account_by_capability_type">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="capability_type" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_query_capability_by_account_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="i" name="account_id" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_update_sync_status_by_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="i" name="account_db_id" direction="in" />
-      <arg type="i" name="sync_status" direction="in" />
-    </method>
-    <method name="account_type_query_provider_feature_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="a(ss)" name="feature_list_data" direction="out" />
-    </method>
-    <method name="account_type_query_supported_feature">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="s" name="capability" direction="in" />
-      <arg type="i" name="is_supported" direction="out" />
-    </method>
-    <method name="account_type_update_to_db_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_type_variant" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-    </method>
-    <method name="account_type_delete_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-    </method>
-    <method name="account_type_query_label_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="a(sss)" name="label_list_variant" direction="out" />
-    </method>
-    <method name="account_type_query_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="a{sv}" name="account_type_variant" direction="out" />
-    </method>
-    <method name="account_type_query_app_id_exist">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-    </method>
-    <method name="account_update_to_db_by_id_ex">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_variant" direction="in" />
-      <arg type="i" name="account_id" direction="in" />
-    </method>
-  </interface>
-</node>
diff --git a/src/accounts/server/account-svcd.sh b/src/accounts/server/account-svcd.sh
deleted file mode 100755 (executable)
index a1b3be2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/usr/bin/account-svcd &