X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fsdktools.c;h=7d2f7398c4d9e56aed188a9015bb8ed34ee4a163;hb=78fb343c98d6b0d54c9800d81b612e795afbc40b;hp=837af3be0df652aab00b5ab4c8765d652c4f8a07;hpb=24fb356772e2b41d2f6d7687b00dc0cd3dad6fd1;p=sdk%2Ftarget%2Fsdbd.git diff --git a/src/sdktools.c b/src/sdktools.c index 837af3b..7d2f739 100644 --- a/src/sdktools.c +++ b/src/sdktools.c @@ -96,22 +96,25 @@ int verify_root_commands(const char *arg1) { break; } case 3: { - if (cnt == 3) { - if (!strcmp(tokens[1], "valgrind")) { - char *appid = NULL; - int rc = smack_lgetlabel(tokens[2], &appid, SMACK_LABEL_ACCESS); - if (rc == 0 && appid != NULL) { - if (apply_sdb_rules(SDBD_LABEL_NAME, appid, "rwax") < 0) { - D("unable to set %s %s rules\n", SDBD_LABEL_NAME, appid); - } - if (apply_sdb_rules(appid, SDBD_LABEL_NAME, "rwax") < 0) { - D("unable to set %s %s rules\n", appid, SDBD_LABEL_NAME); - } - //apply_app_process(); - free(appid); + if (!strcmp(tokens[1], "valgrind")) { + char *appid = NULL; + int rc = smack_lgetlabel(tokens[cnt-1], &appid, SMACK_LABEL_ACCESS); + if (rc == 0 && appid != NULL) { + if (apply_sdb_rules(SDBD_LABEL_NAME, appid, "rwax") < 0) { + D("unable to set %s %s rules\n", SDBD_LABEL_NAME, appid); + } else { + D("apply rule to '%s %s rwax' rules\n", SDBD_LABEL_NAME, appid); } - D("standalone launch for valgrind\n"); + if (apply_sdb_rules(appid, SDBD_LABEL_NAME, "rwax") < 0) { + D("unable to set %s %s rules\n", appid, SDBD_LABEL_NAME); + } else { + D("apply rule to '%s %s rwax' rules\n", appid, SDBD_LABEL_NAME); + } + //apply_app_process(); + + free(appid); } + D("standalone launch for valgrind\n"); } ret = 1; @@ -251,8 +254,15 @@ int exec_app_standalone(const char* path) { char *appid = NULL; int rc = smack_lgetlabel(path, &appid, SMACK_LABEL_ACCESS); if (rc == 0 && appid != NULL) { - if (apply_sdb_rules(SDBD_LABEL_NAME, appid, "rxax") < 0) { - D("unable to set sdbd rules to %s\n", appid); + if (apply_sdb_rules(SDBD_LABEL_NAME, appid, "rwax") < 0) { + D("unable to set sdbd rules to %s %s rwax\n", SDBD_LABEL_NAME, appid); + } else { + D("set sdbd rules to %s %s rwax\n", SDBD_LABEL_NAME, appid); + } + if (apply_sdb_rules(appid, SDBD_LABEL_NAME, "rwax") < 0) { + D("unable to set sdbd rules to %s %s rwax\n", appid, SDBD_LABEL_NAME); + } else { + D("set sdbd rules to %s %s rwax\n", appid, SDBD_LABEL_NAME); } if (smack_set_label_for_self(appid) != -1) { D("set smack lebel [%s] appid to %s\n", appid, SMACK_LEBEL_SUBJECT_PATH);