Fix labelling of files of widgets 63/24963/1 icefish 9.0.3 9.0.4 icefish/9.0.3 icefish/9.0.4 icefish_9.0.3 icefish_9.0.4
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 10 Jul 2020 11:18:47 +0000 (13:18 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 10 Jul 2020 11:34:01 +0000 (13:34 +0200)
Before that change any application could browse
content of other application.

This change fixes that unintended behaviour by setting
the installed files as private to the application.

This affects the Smack labels of the files that after
the change become the label of the application.

Bug-AGL: SPEC-3489

Change-Id: I933446a8c155a03d9b66767f1dda63aeaeb21eb1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/secmgr-wrap.c
src/secmgr-wrap.h
src/wgtpkg-install.c

index 63704ef..83a2660 100644 (file)
@@ -117,7 +117,7 @@ static int addpath(const char *pathname, enum app_install_path_type type)
 
 int secmgr_path_public_read_only(const char *pathname)
 {
-       return addpath(pathname, SECURITY_MANAGER_PATH_RO);
+       return addpath(pathname, SECURITY_MANAGER_PATH_PUBLIC_RO);
 }
 
 int secmgr_path_read_only(const char *pathname)
@@ -130,6 +130,11 @@ int secmgr_path_read_write(const char *pathname)
        return addpath(pathname, SECURITY_MANAGER_PATH_RW);
 }
 
+int secmgr_path_private(const char *pathname)
+{
+       return addpath(pathname, SECURITY_MANAGER_PATH_PRIVATE);
+}
+
 int secmgr_prepare_exec(const char *appid)
 {
        return retcode(security_manager_prepare_app(appid));
index 2d16a8d..608ed8d 100644 (file)
@@ -24,5 +24,6 @@ extern int secmgr_permit(const char *permission);
 extern int secmgr_path_public_read_only(const char *pathname);
 extern int secmgr_path_read_only(const char *pathname);
 extern int secmgr_path_read_write(const char *pathname);
+extern int secmgr_path_private(const char *pathname);
 
 extern int secmgr_prepare_exec(const char *appid);
index 57c17b8..14d3b85 100644 (file)
@@ -524,7 +524,7 @@ static int install_security(const struct wgt_desc *desc)
                if (lf <= lic && icon && !memcmp(f->name, icon, lf) && (!f->name[lf] || f->name[lf] == '/'))
                        rc = secmgr_path_public_read_only(path);
                else
-                       rc = secmgr_path_read_only(path);
+                       rc = secmgr_path_private(path);
                if (rc)
                        goto error2;
        }