Change security_manager_set_process_label_from_appid() API parameter from pkgid to... 33/82333/3
authorJongHeon Choi <j-h.choi@samsung.com>
Wed, 3 Aug 2016 02:56:33 +0000 (11:56 +0900)
committerJongHeon Choi <j-h.choi@samsung.com>
Wed, 31 Aug 2016 01:07:31 +0000 (10:07 +0900)
Change-Id: I1e1085ef83b8a41ad9ce89764355efaf31b9d3aa

src/js/wrt-service.js
src/node/service-util.cpp

index 1411f6f1d8d2b03e3392e4d098209910df48dcc3..142d4fbc59ba81d7a9063d5454afcfe361d7a31e 100644 (file)
 
     //Change App privilege
     var serviceUtil = require('wrt-service/serviceutil.node');
-    serviceUtil.setPrivilege(appid.split('.')[0]);
+    //serviceUtil.setPrivilege(appid);
 
     // change cwd
     process.chdir(packagePath);
index 25200cf98458634b4d4517e1ee614d38ba10318c..a79742755727a49296d84ee17bc4d97c6779ba1b 100644 (file)
@@ -24,7 +24,6 @@
 #include <node.h>
 #include <v8.h>
 #include <memory>
-
 #include <security-manager.h>
 
 #include <boost/filesystem/path.hpp>
@@ -91,9 +90,9 @@ static void InitAce(const std::string & /*appid*/){
     //wrt::common::AccessControl::GetInstance()->InitAppPrivileges(appid);
 }
 
-static void SetPrivilege(const std::string& pkgid){
-    SECURE_LOGD("Set privilege : %s", pkgid.c_str());
-    int ret = security_manager_set_process_label_from_appid(pkgid.c_str());
+static void SetPrivilege(const std::string& appid){
+    SECURE_LOGD("Set privilege : %s", appid.c_str());
+    int ret = security_manager_set_process_label_from_appid(appid.c_str());
     if (ret != SECURITY_MANAGER_SUCCESS) {
         LOGE("error security_manager_set_process_label_from_appid : (%d)", ret);
     }
@@ -126,12 +125,12 @@ static void getStartScript(const FunctionCallbackInfo<Value>& args){
 static void setPrivilege(const FunctionCallbackInfo<Value>& args){
     Isolate* isolate = Isolate::GetCurrent();
     HandleScope scope(isolate);
-    if( args.Length() < 2 ){
+    if( args.Length() < 1 ){
         LOGE("No enough arguments");
         return;
     }
-    std::string pkgid(*String::Utf8Value(args[0]->ToString()));
-    SetPrivilege(pkgid);
+    std::string appid(*String::Utf8Value(args[0]->ToString()));
+    SetPrivilege(appid);
 }
 
 static void init(Handle<Object> target) {