Fix app_install function.
authorRafal Krypa <r.krypa@samsung.com>
Wed, 27 Mar 2013 17:39:32 +0000 (18:39 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 16 Apr 2013 12:55:00 +0000 (14:55 +0200)
[Issue#]       N/A
[Bug]          Desn't create the file, but returns ok. error code.
[Cause]        Missing flag to open, mising goto.
[Solution]     Fix the code.
[Verification] N/A

Change-Id: Ibe2064ca055921c5dc060605a90e785531726f60

src/privilege-control.c

index bea239f..1ebf838 100644 (file)
@@ -958,10 +958,11 @@ API int app_install(const char* app_id)
        if (ret != PC_OPERATION_SUCCESS)
                goto out;
 
-       fd = open(smack_path, O_RDWR|O_EXCL, 0644);
+       fd = open(smack_path, O_RDWR|O_EXCL|O_CREAT, 0644);
        if (fd == -1) {
                C_LOGE("file open failed: %s", strerror(errno));
                ret = PC_ERR_FILE_OPERATION;
+               goto out;
        }
 
        ret = PC_OPERATION_SUCCESS;