summaryrefslogtreecommitdiff
path: root/src/sdktools.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdktools.c')
-rw-r--r--src/sdktools.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/sdktools.c b/src/sdktools.c
index 837af3b..71340bb 100644
--- a/src/sdktools.c
+++ b/src/sdktools.c
@@ -13,6 +13,7 @@
#include "sdktools.h"
#define TRACE_TAG TRACE_SERVICES
+#define LEN 200
#include "sdb.h"
#include "sdktools.h"
#include "strutils.h"
@@ -27,15 +28,27 @@ struct sudo_command root_commands[] = {
};
struct arg_permit_rule sdk_arg_permit_rule[] = {
- /* 2 */ {"gcove_env1", "^GCOV_PREFIX=((/opt/apps)|(/opt/usr/apps))/[a-zA-Z0-9]{10}/data$", 1},
- /* 2 */ {"gcove_env2", "GCOV_PREFIX_STRIP=0", 0},
- /* 2 */ {"gcove_env3", "LD_LIBRARY_PATH=/home/developer/sdk_tools/gtest/usr/lib:$LD_LIBRARY_PATH", 0},
- /* 2 */ {"gcove_env4", "TIZEN_LAUNCH_MODE=debug", 0},
- /* 2 */ {"da_env1", "LD_PRELOAD=/usr/lib/da_probe_osp.so", 0},
- /* 2 */ {"gcove_arg1", "^\\-\\-gtest_output=xml:((/opt/apps)|(/opt/usr/apps))/[a-zA-Z0-9]{10}/data/[a-zA-Z0-9_\\-]{1,30}\\.xml$", 1},
+ /* 2 */ {"gcove_env1", "", 1},
+ /* 2 */ {"gcove_env2", "", 0},
+ /* 2 */ {"gcove_env3", "", 0},
+ /* 2 */ {"gcove_env4", "", 0},
+ /* 2 */ {"da_env1", "", 0},
+ /* 2 */ {"gcove_arg1", "", 1},
/* end */ {NULL, NULL, 0}
};
+void init_sdk_arg_permit_rule_pattern(){
+ int i;
+
+ for (i = 0; i <= 5; i++){
+ sdk_arg_permit_rule[i].pattern = malloc(LEN* sizeof(char));
+ }
+
+ sprintf(sdk_arg_permit_rule[0].pattern, "^GCOV_PREFIX=((%s)|(%s))/[a-zA-Z0-9]{10}/data$", APP_INSTALL_PATH_PREFIX1, APP_INSTALL_PATH_PREFIX2);
+ sprintf(sdk_arg_permit_rule[2].pattern, "LD_LIBRARY_PATH=%sgtest/usr/lib:$LD_LIBRARY_PATH", DEV_INSTALL_PATH_PREFIX, APP_INSTALL_PATH_PREFIX2);
+ sprintf(sdk_arg_permit_rule[5].pattern, "^\\-\\-gtest_output=xml:((%s)|(%s))/[a-zA-Z0-9]{10}/data/[a-zA-Z0-9_\\-]{1,30}\\.xml$", APP_INSTALL_PATH_PREFIX1, APP_INSTALL_PATH_PREFIX2);
+}
+
int verify_commands(const char *arg1) {
if (arg1 != NULL) {
if (verify_root_commands(arg1)) {
@@ -166,6 +179,7 @@ int regcmp(const char* pattern, const char* str) {
int env_verify(const char* arg) {
int i;
+ init_sdk_arg_permit_rule_pattern();
for (i=0; sdk_arg_permit_rule[i].name != NULL; i++) {
if (sdk_arg_permit_rule[i].expression == 0) {
if (!strcmp(sdk_arg_permit_rule[i].pattern, arg)) {
@@ -180,6 +194,9 @@ int env_verify(const char* arg) {
}
}
D("failed to set %s\n", arg);
+ for (i = 0; i <= 5; i++){
+ free(sdk_arg_permit_rule[i].pattern);
+ }
return 0;
}