Change queue of cleardata 93/112893/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 3 Feb 2017 07:06:18 +0000 (16:06 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 3 Feb 2017 07:06:18 +0000 (16:06 +0900)
- Cleardata is performed by pkgmgr-server itself so change queue into pkgtool
- reqkey is no longer required when calling cleardata so it was removed

Change-Id: Iee3ece77bc22111c2bc590f5a4d4f1400792c3c8
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/request.c

index 8e3793e..b3f9164 100644 (file)
@@ -971,9 +971,7 @@ static int __handle_request_cleardata(uid_t caller_uid,
                GDBusMethodInvocation *invocation, GVariant *parameters)
 {
        uid_t target_uid = (uid_t)-1;
-       char *pkgtype;
        char *pkgid = NULL;
-       char *reqkey = NULL;
 
        g_variant_get(parameters, "(u&s)", &target_uid, &pkgid);
        if (target_uid == (uid_t)-1 || pkgid == NULL) {
@@ -982,36 +980,16 @@ static int __handle_request_cleardata(uid_t caller_uid,
                return -1;
        }
 
-       pkgtype = _get_pkgtype_from_pkgid(pkgid, target_uid);
-       if (pkgtype == NULL) {
-               g_dbus_method_invocation_return_value(invocation,
-                               g_variant_new("(i)", PKGMGR_R_ENOPKG));
-               return -1;
-       }
-
-       reqkey = __generate_reqkey(pkgid);
-       if (reqkey == NULL) {
-               g_dbus_method_invocation_return_value(invocation,
-                               g_variant_new("(i)", PKGMGR_R_ENOMEM));
-               free(pkgtype);
-               return -1;
-       }
-
-       if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_CLEARDATA,
-                               pkgtype, pkgid, NULL)) {
+       if (_push_queue(target_uid, caller_uid, NULL, REQUEST_TYPE_CLEARDATA,
+                               "pkgtool", pkgid, NULL)) {
                g_dbus_method_invocation_return_value(invocation,
                                g_variant_new("(i)", PKGMGR_R_ESYSTEM));
-               free(reqkey);
-               free(pkgtype);
                return -1;
        }
 
        g_dbus_method_invocation_return_value(invocation,
                        g_variant_new("(i)", PKGMGR_R_OK));
 
-       free(reqkey);
-       free(pkgtype);
-
        return 0;
 }