Bug in app_install() fixed
authorMarcin Niesluchowski <m.niesluchow@samsung.com>
Thu, 2 May 2013 12:18:32 +0000 (14:18 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 7 May 2013 06:38:39 +0000 (08:38 +0200)
[Issue#]        SSDWSSP-223
[Bug/Feature]   Fix bugs that make libprivilege-control test fail
[Cause]         N/A
[Solution]      N/A
[Verification]  N/A

Change-Id: I88712168c64c8d35e7700124ff9da4ffefa32493

src/privilege-control.c

index 92997b4..44dd24a 100644 (file)
@@ -1286,6 +1286,10 @@ API int app_install(const char* app_id)
        if (ret != PC_OPERATION_SUCCESS)
                return ret;
 
+        if (access(smack_path, F_OK) == 0){
+                C_LOGE("file exists");
+                return PC_ERR_FILE_OPERATION;
+        }
        fd = open(smack_path, O_RDWR|O_CREAT, 0644);
        if (fd == -1) {
                C_LOGE("file open failed: %s", strerror(errno));