tpk/wgt backend will run as system session 64/80764/5 accepted/tizen/common/20160812.140738 accepted/tizen/ivi/20160815.233244 accepted/tizen/mobile/20160815.233114 accepted/tizen/tv/20160815.233202 accepted/tizen/wearable/20160815.233222 submit/tizen/20160811.013634 submit/tizen/20160811.062803 submit/tizen/20160812.053402
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 20 Jul 2016 05:17:43 +0000 (14:17 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 28 Jul 2016 07:53:52 +0000 (00:53 -0700)
Related changes
[pkgmgr-server] https://review.tizen.org/gerrit/#/c/78205/
[app-installers] https://review.tizen.org/gerrit/#/c/78206/
[tpk-backend] https://review.tizen.org/gerrit/#/c/80787/
[wgt-backend] https://review.tizen.org/gerrit/#/c/81099/

Change-Id: Ie19d7b431ef13a035cdd8c4df76b515aa57b4ca3
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
installer/pkgmgr_installer.c
installer/pkgmgr_installer.h
installer/pkgmgr_installer_config.h

index 12273d1..9a13372 100644 (file)
@@ -425,6 +425,10 @@ pkgmgr_installer_receive_request(pkgmgr_installer *pi,
                        pi->pkgmgr_info = strndup(optarg, MAX_STRLEN);
                        break;
 
+               case 'u': /* uid */
+                       pi->target_uid = (uid_t)atoi(optarg);
+                       break;
+
                        /* Otherwise */
                case '?':       /* Not an option */
                        break;
@@ -445,6 +449,12 @@ API int pkgmgr_installer_get_request_type(pkgmgr_installer *pi)
        return pi->request_type;
 }
 
+API uid_t pkgmgr_installer_get_uid(pkgmgr_installer *pi)
+{
+       CHK_PI_RET(PKGMGR_REQ_INVALID);
+       return pi->target_uid;
+}
+
 API const char *pkgmgr_installer_get_request_info(pkgmgr_installer *pi)
 {
        CHK_PI_RET(PKGMGR_REQ_INVALID);
index 4e65d80..3374776 100644 (file)
@@ -250,6 +250,40 @@ CLEANUP_END:
 int pkgmgr_installer_get_request_type(pkgmgr_installer *pi);
 
 /**
+       @brief          Get uid
+       @pre            pkgmgr_installer_receive_request() must be called.
+       @post           None
+       @see            pkgmgr_installer_receive_request
+       @param[in]      pi      pkgmgr_installer object
+       @return         Uid info.
+       @retval         NULL    on function failure
+       @remark         Returned uid must not be modified.
+       @code
+#include <pkgmgr_installer.h>
+int main(int argc, char **argv)
+{
+       pkgmgr_installer *pi;
+       int r = 0;
+       uid_t uid;
+
+       pi = pkgmgr_installer_new();
+       if(!pi) return -1;
+       if(pkgmgr_installer_receive_request(pi, argc, argv)) {
+               r = -1;
+               goto CLEANUP_RET;
+       }
+       uid = pkgmgr_installer_get_uid(pi);
+
+       // Do something...
+
+       pkgmgr_installer_free(pi);
+       return r;
+}
+       @endcode
+ */
+uid_t pkgmgr_installer_get_uid(pkgmgr_installer *pi);
+
+/**
        @brief          Get request info
        @pre            pkgmgr_installer_receive_request() must be called.
        @post           None
index ec243c7..4fffcf2 100644 (file)
@@ -35,7 +35,7 @@ extern "C" {
 #define OPTVAL_FORCE_REMOVAL 1001
 
 /* Supported options */
-const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:b:e:M:y:w:D:A:q";
+const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:b:e:M:y:u:w:D:A:q";
 const struct option long_opts[] = {
        { "session-id", 1, NULL, 'k' },
        { "license-path", 1, NULL, 'l' },