diff options
author | Sung-jae Park <nicesj.park@samsung.com> | 2013-06-14 14:50:57 +0900 |
---|---|---|
committer | Sung-jae Park <nicesj.park@samsung.com> | 2013-06-14 14:50:57 +0900 |
commit | bac3dda9aba68af6edaa6f47fabd3ba780231a69 (patch) | |
tree | 1c37cdcb6d73488a616aab22831e6fc0540bd699 | |
parent | 37da808ee3e7beeebaf274cbc57c310d2d4dd9de (diff) | |
download | data-provider-master-bac3dda9aba68af6edaa6f47fabd3ba780231a69.tar.gz data-provider-master-bac3dda9aba68af6edaa6f47fabd3ba780231a69.tar.bz2 data-provider-master-bac3dda9aba68af6edaa6f47fabd3ba780231a69.zip |
Check the PD owner.
[model] Tizen
[binary_type] AP
[customer] Tizen Developer
[issue#] N/A
[problem] No one can open or close the PD if it is not owned by requestor.
[cause] N/A
[solution] N/A
[team] HomeTF
[request]
[horizontal_expansion]
Change-Id: If4bbe6917507392fed21d3bca8bb791b379c24ef
-rw-r--r-- | include/instance.h | 2 | ||||
-rw-r--r-- | packaging/data-provider-master.spec | 2 | ||||
-rw-r--r-- | src/instance.c | 5 | ||||
-rw-r--r-- | src/server.c | 11 |
4 files changed, 18 insertions, 2 deletions
diff --git a/include/instance.h b/include/instance.h index 54ba80a..42c2bc3 100644 --- a/include/instance.h +++ b/include/instance.h @@ -221,6 +221,8 @@ extern int instance_client_pd_created(struct inst_info *inst, int status); extern int instance_send_access_status(struct inst_info *inst, int status); extern int instance_forward_packet(struct inst_info *inst, struct packet *packet); +extern const struct client_node *instance_pd_owner(struct inst_info *inst); + /*! * Multiple viewer */ diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 66f3f66..4c9b77e 100644 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -1,6 +1,6 @@ Name: data-provider-master Summary: Master service provider for liveboxes. -Version: 0.24.7 +Version: 0.24.8 Release: 1 Group: HomeTF/Livebox License: Flora License diff --git a/src/instance.c b/src/instance.c index 8bf38f9..c87685d 100644 --- a/src/instance.c +++ b/src/instance.c @@ -3121,4 +3121,9 @@ HAPI void *instance_get_data(struct inst_info *inst, const char *tag) return item->data; } +HAPI const struct client_node *instance_pd_owner(struct inst_info *inst) +{ + return inst->pd.owner; +} + /* End of a file */ diff --git a/src/server.c b/src/server.c index 07aad34..e4a2b8e 100644 --- a/src/server.c +++ b/src/server.c @@ -4713,6 +4713,8 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) { ret = LB_STATUS_ERROR_NO_SPACE; + } else if (instance_pd_owner(inst)) { + ret = LB_STATUS_ERROR_ALREADY; } else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) { lazy_pd_destroyed_cb(inst); @@ -4890,7 +4892,9 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack if (ret != LB_STATUS_SUCCESS) goto out; - if (package_pd_type(pkg) == PD_TYPE_BUFFER) { + if (instance_pd_owner(inst) != client) { + ret = instance_pd_owner(inst) == NULL ? LB_STATUS_ERROR_ALREADY : LB_STATUS_ERROR_PERMISSION; + } else if (package_pd_type(pkg) == PD_TYPE_BUFFER) { int resize_aborted = 0; pd_monitor = instance_del_data(inst, "pd,open,monitor"); @@ -4927,6 +4931,11 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack goto out; } + if (instance_get_data(inst, "lazy,pd,close") || instance_get_data(inst, "pd,close,monitor")) { + ret = LB_STATUS_ERROR_ALREADY; + goto out; + } + pd_monitor = instance_del_data(inst, "pd,resize,monitor"); if (pd_monitor) { ErrPrint("PD Resize request is found. clear it [%s]\n", pkgname); |