teec: Increase permission level for shared memory 02/140602/4
authorLukasz Kostyra <l.kostyra@samsung.com>
Tue, 25 Jul 2017 13:35:03 +0000 (15:35 +0200)
committerLukasz Kostyra <l.kostyra@samsung.com>
Mon, 11 Sep 2017 14:38:34 +0000 (16:38 +0200)
A temporary workaround to allow non-roots to create and access shared
memory objects. Definitely should be removed in the future.

Change-Id: I175b9ad5e265a9acb11542caa735512cd07b0c1b

TEECLib/src/teec_api.c

index 6b34a40..8505cd2 100644 (file)
@@ -82,7 +82,8 @@ static int32_t initShm(char* path) {
 
        pthread_rwlock_wrlock(&file_create_lock);
        if (stat(path, &attr) == -1) {
-               fd = creat(path, S_IRWXU);
+               // FIXME increased permission level (was S_IRWXU only)
+               fd = creat(path, S_IRWXU | S_IRWXG | S_IRWXO);
                if (-1 == fd) {
                        LOGE(TEEC_LIB, "shm file creation failed");
                        return -1;