change to use absolute path in shell script - phase2 70/77770/1 accepted/tizen/common/20160704.145233 accepted/tizen/mobile/20160704.090159 submit/tizen/20160704.002536
authorKyoungyong Lee <bluevox@naver.com>
Fri, 1 Jul 2016 05:04:29 +0000 (14:04 +0900)
committerKyoungyong Lee <bluevox@naver.com>
Fri, 1 Jul 2016 05:04:40 +0000 (14:04 +0900)
Change-Id: I590fc795ad707bae68ae69f12d38c50ba1f243ee

client/src/PrivacyGuardClient.cpp
pkgmgr_plugin/privileges.cpp
res/usr/bin/privacy_guard_create_clean_db.sh

index 04d40a6..af8837d 100755 (executable)
@@ -70,7 +70,7 @@ PrivacyGuardClient::PgAddMonitorPolicyOffline(const int userId, const std::strin
        m_sqlHandler = NULL;
        m_stmt = NULL;
        m_bDBOpen = false;
-       
+
        // open db
        if(m_bDBOpen == false) {
                openSqliteDB();
index d6f3780..85f3c0f 100755 (executable)
@@ -56,16 +56,13 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
 {
        if (packageId == NULL) {
                LOGE("Package ID is NULL");
-               printf("Package ID is NULL");
                return -EINVAL;
        }
 
        LOGD("PKGMGR_PARSER_PLUGIN_INSTALL() called with [%s].", packageId);
-       printf("PKGMGR_PARSER_PLUGIN_INSTALL() called with [%s].", packageId);
 
        uid_t user_id = getuid();
        LOGD("user_id is %d.", user_id);
-       printf("user_id is %d.", user_id);
 
        int ret = 0;
 
@@ -73,18 +70,12 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
        xmlNodePtr curPtr = xmlFirstElementChild(xmlDocGetRootElement(docPtr));
        if (curPtr == NULL) {
                LOGE("Failed to get the element. xmlFirstElementChild() returned NULL.");
-               printf("Failed to get the element. xmlFirstElementChild() returned NULL.");
                return -EINVAL;
        }
-       else {
-               LOGD("Succeeded to get the element. xmlFirstElementChild().");
-               printf("Succeeded to get the element. xmlFirstElementChild().");
-       }
 
        curPtr = curPtr->xmlChildrenNode;
        if (curPtr == NULL) {
                LOGE("No privileges");
-               printf("No privileges");
                return -EINVAL;
        }
 
@@ -94,12 +85,10 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
                        xmlChar* pPrivilege = xmlNodeListGetString(docPtr, curPtr->xmlChildrenNode, 1);
                        if (pPrivilege == NULL) {
                                LOGE("Failed to get privilege value.");
-                               printf("Failed to get privilege value.");
                                return -EINVAL;
                        } else {
                                privilegeList.push_back(std::string( reinterpret_cast<char*> (pPrivilege)));
                                LOGD("Succeeded to get privilege value.");
-                               printf("Succeeded to get privilege value.");
                        }
                }
                curPtr = curPtr->next;
@@ -112,14 +101,9 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
                ppPrivilegeList[i] = (char*)calloc(strlen(iter->c_str()) + 1, sizeof(char));
                if (ppPrivilegeList[i] == NULL) {
                        LOGE("Failed allocate memory.");
-                       printf("Failed allocate memory.");
                        destroy_char_list(ppPrivilegeList, privilegeList.size() + 1);
                        return -ENOMEM;
                }
-               else {
-                       LOGD("Succeeded allocate memory.");
-                       printf("Succeeded allocate memory.");
-               }
                memcpy(ppPrivilegeList[i], iter->c_str(), strlen(iter->c_str()));
                ++iter;
        }
@@ -132,7 +116,6 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
 
        while (*ppPrivilegeList[0] != '\0') {
                LOGD("privilege in the List: %s", *ppPrivilegeList);
-               printf("privilege in the List: %s", *ppPrivilegeList);
                privilege_List.push_back(std::string(*ppPrivilegeList++));
        }
 
@@ -140,14 +123,9 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
        ret = pInst->PgAddMonitorPolicy(user_id, std::string(packageId), privilege_List, monitor_policy);
        if (ret != PRIV_GUARD_ERROR_SUCCESS) {
                LOGE("Failed to add monitor policy: [%d]", ret);
-               printf("Failed to add monitor policy: [%d]", ret);
 //             return -EIO;
                return 0;
        }
-       else {
-               LOGD("Succeeded to add monitor policy: [%d]", ret);
-               printf("Succeeded to add monitor policy: [%d]", ret);
-       }
 
        if (temp)
                destroy_char_list(temp, privilegeList.size() + 1);
index 898edbb..3c174b8 100755 (executable)
@@ -13,8 +13,7 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-TZ_SYS_DB=/opt/dbspace
-TZ_SYS_BIN=/usr/bin
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
 source /etc/tizen-platform.conf
 for name in privacy_guard
 do