Revert "Merge plugin improvement commit" 20/96620/2
authorSangjin Kim <sangjin3.kim@samsung.com>
Wed, 9 Nov 2016 12:03:55 +0000 (04:03 -0800)
committerSangjin Kim <sangjin3.kim@samsung.com>
Wed, 9 Nov 2016 12:05:07 +0000 (04:05 -0800)
This reverts commit 97f2d53e382e658536c6e38073f695812b57af38.

Change-Id: I71c2fbae3f8c3f439304ab51224fdb3daecbdb0e

src/default_plugin.h
src/default_plugin_basic.c
src/default_plugin_main.c
src/plugin.c
src/sdb.c
src/sdbd_plugin.h
src/services.c
src/transport_local.c

index 0c8b5b996d2341b4cefb39a4096c9dc5fdc6c318..800e4953359313cc50334cacb8b16c9fe30cc54d 100644 (file)
@@ -26,7 +26,6 @@ int verify_peer_ip ( parameters* in, parameters* out );
 int verify_sdbd_launch ( parameters* in, parameters* out );
 int verify_root_cmd ( parameters* in, parameters* out );
 int get_lock_state ( parameters* in, parameters* out );
-int get_shell_env ( parameters* in, parameters* out );
 
 int auth_support ( parameters* in, parameters* out );
 int auth_get_key_file_paths ( parameters* in, parameters* out );
index 81f313c24b6c40576d2ab7aa4abf8e65fa9674a6..2072824d06490bc586055336587ef58e84fd5c40 100644 (file)
@@ -198,18 +198,3 @@ int verify_root_cmd ( parameters* in, parameters* out )
 
     return PLUGIN_CMD_SUCCESS;
 }
-
-int get_shell_env ( parameters* in, parameters* out )
-{
-    if ( out == NULL ) {
-        D ( "Invalid argument\n" );
-        return PLUGIN_CMD_FAIL;
-    }
-
-    out->number_of_parameter = 1;
-    out->array_of_parameter = ( parameter* ) malloc ( sizeof ( parameter ) );
-
-    make_string_parameter ( & ( out->array_of_parameter[0] ), "%s", "" );
-    return PLUGIN_CMD_SUCCESS;
-}
-
index ea719712d4bd5d178fe3c0b2ec047c9fc03b344a..a118fe77a01781caa8166bc6d21a2bebb178eca8 100644 (file)
@@ -58,8 +58,6 @@ int default_plugin_sync_proc ( int cmd, parameters* in, parameters* out )
         ret = auth_get_key_file_paths ( in, out );
     } else if ( cmd == PLUGIN_SYNC_CMD_GET_LOCK_STATE ) {
         ret = get_lock_state ( in, out );
-    } else if ( cmd == PLUGIN_SYNC_CMD_GET_SHELL_ENV ) {
-        ret = get_shell_env ( in, out );
     } else {
         ret = PLUGIN_CMD_NOT_SUPPORT;
     }
index e8c70b98e0da4834a75dc0dca2e562d91df3f6a8..ff9f19cfee4abf69649fcbfc2e693266b55003d3 100644 (file)
@@ -326,16 +326,11 @@ int request_conversion_to_plugin ( int cmd, const char* in_buf, char* out_buf, u
     int ret;
     parameters in, out;
 
-    if ( in_buf != NULL ) {
-        in.number_of_parameter = 1;
-        in.array_of_parameter = ( parameter* ) malloc ( sizeof ( parameter ) );
-        in.array_of_parameter[0].type = type_string;
-        in.array_of_parameter[0].v_string.length = strlen ( in_buf );
-        in.array_of_parameter[0].v_string.data = strdup ( in_buf );
-    } else {
-        in.number_of_parameter = 0;
-        in.array_of_parameter = NULL;
-    }
+    in.number_of_parameter = 1;
+    in.array_of_parameter = ( parameter* ) malloc ( sizeof ( parameter ) );
+    in.array_of_parameter[0].type = type_string;
+    in.array_of_parameter[0].v_string.length = strlen ( in_buf );
+    in.array_of_parameter[0].v_string.data = strdup ( in_buf );
 
     ret = request_sync_cmd ( cmd, &in, &out );
     if ( ret == PLUGIN_CMD_SUCCESS ) {
@@ -403,4 +398,3 @@ int request_appcmd_to_plugin ( const char* in_buf )
 
     return fd;
 }
-
index 9a0d5cfc37cf6c8948fdeef8dc259cf6f1b7cc1f..e282cedb44bcb88be26b07c4caeccef38e924e05 100644 (file)
--- a/src/sdb.c
+++ b/src/sdb.c
@@ -1755,9 +1755,10 @@ static void init_capabilities(void) {
 
 
     // Target name of the launch possible
-    if(!request_capability_to_plugin(CAPABILITY_CAN_LAUNCH, g_capabilities.can_launch,
+    if(!request_plugin_cmd(SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_CANLAUNCH,
+                            g_capabilities.can_launch,
                             sizeof(g_capabilities.can_launch))) {
-        D("failed to request. (%d:%d) \n", PLUGIN_SYNC_CMD_CAPABILITY, CAPABILITY_CAN_LAUNCH);
+        D("failed to request. (%s:%s) \n", SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_CANLAUNCH);
         snprintf(g_capabilities.can_launch, sizeof(g_capabilities.can_launch),
                     "%s", UNKNOWN);
     }
index 2bfb450af5ec311aae09a8c7d4e3b9bb6fc63cab..5159928efa9ff1035c6821b34cd1ceb3df48fa6d 100644 (file)
@@ -33,7 +33,6 @@
 #define PLUGIN_SYNC_CMD_AUTH_SUPPORT                1006
 #define PLUGIN_SYNC_CMD_AUTH_GET_KEY_FILEPATHS      1007
 #define PLUGIN_SYNC_CMD_GET_LOCK_STATE              1008
-#define PLUGIN_SYNC_CMD_GET_SHELL_ENV               1009
 
 // asynchronous command
 #define PLUGIN_ASYNC_CMD_AUTH_CONFIRM_PUBLIC        2000
index 1c48905d451af1432e0645252cb6dac13d523f1a..5d40ce9baf49e5e6a6223b76e92d3e90a73f06e2 100644 (file)
@@ -54,8 +54,6 @@
 #include "sdbd_plugin.h"
 #include "plugin.h"
 
-#define ENV_BUF_MAX     4096
-
 typedef struct stinfo stinfo;
 
 struct stinfo {
@@ -649,14 +647,13 @@ static int create_subproc_thread(const char *name, int lines, int columns)
 
     /* get environment variables from plugin */
     char *envp_plugin = NULL;
-    envp_plugin = malloc(ENV_BUF_MAX);
+    envp_plugin = malloc(SDBD_PLUGIN_OUTBUF_MAX);
     if (envp_plugin == NULL) {
         D("Cannot allocate the shell commnad buffer.");
         return -1;
     }
-    memset(envp_plugin, 0, ENV_BUF_MAX);
-    if (!request_conversion_to_plugin(PLUGIN_SYNC_CMD_GET_SHELL_ENV, NULL,
-                envp_plugin, ENV_BUF_MAX)) {
+    memset(envp_plugin, 0, SDBD_PLUGIN_OUTBUF_MAX);
+    if (!request_plugin_cmd(SDBD_CMD_SHELL_ENVVAR, "", envp_plugin, SDBD_PLUGIN_OUTBUF_MAX)) {
         D("Failed to convert the shell command. (%s)\n", name);
         free(envp_plugin);
         return -1;
index a6adb0b550ae817b73a6399e362a1906e009753e..849fe05cdd0b07088e5fc3bdf8a5be0f6bf9a370 100644 (file)
@@ -38,7 +38,6 @@
 #if !SDB_HOST
 #include "commandline_sdbd.h"
 #endif
-#include "utils.h"
 #include "sdbd_plugin.h"
 #include "plugin.h"