From 0006ff8a3f73db336c7cd53d764ecfa0e721b1b1 Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Fri, 19 Aug 2016 18:38:56 +0900 Subject: [PATCH 01/16] Add managing author package and put their infomation in manifest Signed-off-by: Sungbae Yoo Change-Id: Ie0b3891958ad256258faf861a9d414564ee1117b --- server/manager.cpp | 28 +++++++++++++++++++++++++--- server/server.cpp | 12 ++++++++++++ server/server.h | 2 ++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/server/manager.cpp b/server/manager.cpp index 5d6bc03..0bf09d0 100644 --- a/server/manager.cpp +++ b/server/manager.cpp @@ -514,7 +514,9 @@ Manager::~Manager() int Manager::createKrate(const std::string& name, const std::string& manifest) { - auto provisioningWorker = [name, manifest, this]() { + const std::string& pkgId = context.getPeerPackageId(); + + auto provisioningWorker = [name, manifest, pkgId, this]() { std::unique_ptr manifestFile; try { @@ -537,10 +539,13 @@ int Manager::createKrate(const std::string& name, const std::string& manifest) maskUserServices(user); manifestFile.reset(xml::Parser::parseString(manifest)); + //write container author info + if (!pkgId.empty()) { + std::cout << manifestFile->getRootNode().getName() << std::endl; + manifestFile->getRootNode().addNewChild("author").setContent(pkgId); + } manifestFile->write(CONF_PATH "/" + name + ".xml", "UTF-8", true); - //TODO: write container owner info - //unlock the user setKrateState(user.getUid(), 1); @@ -564,6 +569,23 @@ int Manager::createKrate(const std::string& name, const std::string& manifest) int Manager::removeKrate(const std::string& name) { + const std::string& pkgId = context.getPeerPackageId(); + std::unique_ptr manifestFile; + bool canRemove = false; + + manifestFile.reset(xml::Parser::parseFile(CONF_PATH "/" + name + ".xml")); + xml::Node::NodeList authors = manifestFile->evaluate("/manifest/author"); + for (const xml::Node& author : authors) { + if (author.getContent() == pkgId) { + canRemove = true; + break; + } + } + + if (!canRemove) { + return -1; + } + if (lockKrate(name) != 0) { return -1; } diff --git a/server/server.cpp b/server/server.cpp index 4db963d..227429f 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include @@ -65,6 +66,17 @@ void Server::terminate() service->stop(); } +const std::string Server::getPeerPackageId() const +{ + char pkgid[PATH_MAX]; + + if (aul_app_get_pkgid_bypid_for_uid(getPeerPid(), pkgid, sizeof(pkgid), getPeerUid()) != AUL_R_OK) { + return ""; + } + + return pkgid; +} + runtime::FileDescriptor Server::registerNotificationSubscriber(const std::string& name) { return runtime::FileDescriptor(service->subscribeNotification(name), true); diff --git a/server/server.h b/server/server.h index 6d07bbe..a8a1850 100644 --- a/server/server.h +++ b/server/server.h @@ -60,6 +60,8 @@ public: return service->getPeerPid(); } + const std::string getPeerPackageId() const; + void createNotification(const std::string& name) { service->createNotification(name); -- 2.7.4 From 33bd97c33e0bd4f943c81834e51c1fa93cd929de Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Mon, 29 Aug 2016 16:41:31 +0900 Subject: [PATCH 02/16] Add an indicator icon that shows foreground app is in krate Signed-off-by: Sungbae Yoo Change-Id: I0fefb395ecaf8f40f34b2c2f7456c378135ef24b --- server/manager.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/server/manager.cpp b/server/manager.cpp index 0bf09d0..ec6f58a 100644 --- a/server/manager.cpp +++ b/server/manager.cpp @@ -226,7 +226,7 @@ void krateProcessCallback(GDBusConnection *connection, static runtime::User owner(KRATE_DEFAULT_OWNER); int pid, status; -// notification_h noti = reinterpret_cast(userData); + notification_h noti = reinterpret_cast(userData); g_variant_get(params, "(ii)", &status, &pid); @@ -240,20 +240,18 @@ void krateProcessCallback(GDBusConnection *connection, return; } - // this will have been commented until notification_delete_for_uid can work - /* - if (owner.getUid() != st.st_uid) { + if (st.st_uid == owner.getUid() || st.st_uid == 0) { + if (isKrateForeground) { + notification_delete_for_uid(noti, owner.getUid()); + isKrateForeground = false; + } + } else { if (!isKrateForeground) { notification_set_text(noti, NT_CONTENT, NT_APPINFO, NULL, NT_NONE); notification_post_for_uid(noti, owner.getUid()); isKrateForeground = true; } - } else { - if (isKrateForeground) { - notification_delete_for_uid(noti, owner.getUid()); - isKrateForeground = false; - } - }*/ + } } notification_h createNotification() -- 2.7.4 From 0f6bae77ecfaefb2c5628e2c402eb6192b207c34 Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Mon, 29 Aug 2016 16:51:41 +0900 Subject: [PATCH 03/16] Remove unnecessary notification privilege in kaskit Signed-off-by: Sungbae Yoo Change-Id: I4ead8a241a0f1fa8d8af33fac66250fc21d3c361 --- tools/apps/kaskit/org.tizen.kaskit.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/apps/kaskit/org.tizen.kaskit.xml b/tools/apps/kaskit/org.tizen.kaskit.xml index e51ac98..846be83 100644 --- a/tools/apps/kaskit/org.tizen.kaskit.xml +++ b/tools/apps/kaskit/org.tizen.kaskit.xml @@ -5,7 +5,6 @@ http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/packagemanager.info http://tizen.org/privilege/packagemanager.admin - http://tizen.org/privilege/notification -- 2.7.4 From ead59944dc03a80684034430c949e3ac95ba26ea Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Mon, 5 Sep 2016 17:10:43 +0900 Subject: [PATCH 04/16] Add functions to support lazymount Signed-off-by: Sungbae Yoo Change-Id: Ide13f73d52c5340d26b5382d7dabc9ef10050b0a --- module/krate-builder.cpp | 6 ++++- module/krate-builder.h | 3 ++- module/krate.cpp | 64 +++++++++++++++++++++++++++++++++++------------- packaging/krate.spec | 2 +- 4 files changed, 55 insertions(+), 20 deletions(-) diff --git a/module/krate-builder.cpp b/module/krate-builder.cpp index bbb8797..9a568b7 100644 --- a/module/krate-builder.cpp +++ b/module/krate-builder.cpp @@ -48,7 +48,7 @@ void KrateBuilder::bindFilesystemNode(const std::string& source, const std::stri runtime::Mount::mountEntry(source, target, type, options); } -void KrateBuilder::containerize(bool create) +void KrateBuilder::unshareNamespace() { int nsFlags = CLONE_NEWIPC | CLONE_NEWNS; @@ -59,6 +59,10 @@ void KrateBuilder::containerize(bool create) if (::mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL) == -1) { throw runtime::Exception("Failed to mount root filesystem"); } +} + +void KrateBuilder::mountOwnFilesystem() { + manifest.reset(xml::Parser::parseFile("/opt/etc/krate/owner.xml")); xml::Node::NodeList entries = manifest->evaluate("/manifest/filesystem/entry"); for (const xml::Node& entry : entries) { diff --git a/module/krate-builder.h b/module/krate-builder.h index 1e03ef8..5bb05d5 100644 --- a/module/krate-builder.h +++ b/module/krate-builder.h @@ -29,7 +29,8 @@ public: KrateBuilder(const runtime::User& user, const std::string& manifestPath); virtual ~KrateBuilder(); - void containerize(bool create = true); + void unshareNamespace(); + void mountOwnFilesystem(); protected: void bindFilesystemNode(const std::string& source, const std::string& target, diff --git a/module/krate.cpp b/module/krate.cpp index 84496cf..ff21670 100644 --- a/module/krate.cpp +++ b/module/krate.cpp @@ -20,6 +20,7 @@ #include #include +#include #include "session.h" #include "krate-guard.h" @@ -30,6 +31,8 @@ #include #include +#define LAZYMOUNT_EXTERN extern + std::string buildKrateManifestPath(const std::string& name) { return CONF_PATH "/" + name + ".xml"; @@ -46,31 +49,58 @@ std::string getKrateName(pam_handle_t* handle) return static_cast(retItem); } -void openKrateSession(const std::string& name) -{ - auto sessionBuilder = [](const runtime::User& user) { - KrateBuilder builder(user, buildKrateManifestPath(user.getName())); - builder.containerize(); - }; +extern "C" { +LAZYMOUNT_EXTERN __attribute__((visibility("default"))) +int container_preprocess(char* id) { + std::cout << "kraterize (UID " << id << ")..." << std::endl << std::flush; + try { + runtime::User user(std::stoi(std::string(id))); + KrateGuard krateGuard(user.getName()); + krateGuard.wait(); - createSession(runtime::User(name), sessionBuilder); + auto sessionBuilder = [](const runtime::User& user) { + KrateBuilder builder(user, buildKrateManifestPath(user.getName())); + builder.unshareNamespace(); + }; + createSession(user, sessionBuilder); + } catch (runtime::Exception& e) { + std::cerr << "krate error : " << e.what() < Date: Wed, 7 Sep 2016 17:06:37 +0900 Subject: [PATCH 05/16] Add a shortcut icon for krate Signed-off-by: Sungbae Yoo Change-Id: I6ff54bbb3c862641c18b74739db9a9be3ed64f2d --- data/shortcut_icon.png | Bin 0 -> 9846 bytes packaging/krate.spec | 1 + server/CMakeLists.txt | 1 + tools/apps/keyguard/CMakeLists.txt | 4 ++++ tools/apps/keyguard/src/main.c | 2 +- 5 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 data/shortcut_icon.png diff --git a/data/shortcut_icon.png b/data/shortcut_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..69d95149a8d4420fe40e223d6bc664cf4ee1b6fe GIT binary patch literal 9846 zcmV-+CW+aJP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd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GtvY5CV@%etRra@Q7`7y+!?8)&N^WLidw%Yll+durPNNZAiDr?9q>IU0uN(!n( zx$MqC{Qymc6#h*Ht-J5@qgN?>!RtL_;F*vu4KC{NOKx?ZWyO8*oSZ5_!Oe% z7$Omdhz_Kt39k;U!hJ7Xiz#~rc&sCY#kD)U5RiYCjPVce+51$%ZoT6VQ)ubDLZ8>9 zeJ^Xs8|$~(b7A)=$Qr_DFM9zWKK)hnjW^?)FJ6k5`_6}!SnRNvX`U#reinOeay-hP zoSe08$}{=60quZ&Ikh+If0r@Dy{4rg8Su9mFHW z@_+`hI4|LJjgXA-uaD1I|9yJw=QU3~U)R&$CI%i?6Tn}uIQ`~rjO4?nEt`c@b+Vg^ zrCXFQ%^^TzV5|+gmOx4_24WFtJXV-;(>Hx_oh$~NM?gh1HWk&`9leKs`b53-X~^S2 zdUk*JiI~pbn~3nOI;(H`1#j6xzAn%C$3Vovv^Xfz2GWus(wz76^?RPbsb_pS!Wj|~ zzBQuJd;5Cp2f1ND1Hi%E-`yXNvh$nb{DG*>BxjANy&(S_ro;+*mHtPd8TDI$ad2l?Ry=zII6Sl zoYALxdw=>G8oboSXda&z+WPx8zc!t**Ct~8FB367644k~!=8~+^}LrA0d_;_;be^8 zKAo}G_V;aWILHk(9l>QL^_=YQ-TY88#+En5`KJ>x)*sawIHN{Bm!>AU=9&m3VywR@ z&Oe=uu@!y2o4+%YdhQ*2YT7&U^tZ63x#Pd-ZB6>kwon@^A>Si}f{ Date: Wed, 21 Sep 2016 09:17:23 +0900 Subject: [PATCH 06/16] Remove default manifest Change-Id: I64f56020d7efbd77551094dc4ea0e1d3d84c2da7 Signed-off-by: Jaemin Ryu --- module/krate-builder.cpp | 20 ++++++++++++-------- packaging/krate.spec | 5 +---- server/CMakeLists.txt | 4 ---- tools/gumd-scripts/20_krate-add.post | 4 ---- tools/gumd-scripts/20_krate-remove.post | 4 ---- 5 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 tools/gumd-scripts/20_krate-add.post delete mode 100644 tools/gumd-scripts/20_krate-remove.post diff --git a/module/krate-builder.cpp b/module/krate-builder.cpp index 9a568b7..b50e3b6 100644 --- a/module/krate-builder.cpp +++ b/module/krate-builder.cpp @@ -27,7 +27,10 @@ KrateBuilder::KrateBuilder(const runtime::User& user, const std::string& manifestPath) : name(user.getName()), uid(user.getUid()), gid(user.getGid()) { - manifest.reset(xml::Parser::parseFile(manifestPath)); + runtime::File data(manifestPath); + if (data.exists()) { + manifest.reset(xml::Parser::parseFile(manifestPath)); + } } KrateBuilder::~KrateBuilder() @@ -61,13 +64,14 @@ void KrateBuilder::unshareNamespace() } } -void KrateBuilder::mountOwnFilesystem() { - manifest.reset(xml::Parser::parseFile("/opt/etc/krate/owner.xml")); - - xml::Node::NodeList entries = manifest->evaluate("/manifest/filesystem/entry"); - for (const xml::Node& entry : entries) { - bindFilesystemNode(entry.getProp("source"), entry.getProp("target"), - entry.getProp("type"), entry.getProp("options")); +void KrateBuilder::mountOwnFilesystem() +{ + if (manifest.get()) { + xml::Node::NodeList entries = manifest->evaluate("/manifest/filesystem/entry"); + for (const xml::Node& entry : entries) { + bindFilesystemNode(entry.getProp("source"), entry.getProp("target"), + entry.getProp("type"), entry.getProp("options")); + } } bindFilesystemNode("/home/" + name, diff --git a/packaging/krate.spec b/packaging/krate.spec index ab57878..62c6508 100644 --- a/packaging/krate.spec +++ b/packaging/krate.spec @@ -38,13 +38,10 @@ krates. %attr(700,root,root) %{_sbindir}/krate-volume-manager %{_unitdir}/krate.service %{_unitdir}/multi-user.target.wants/krate.service -%attr(700,root,root) /etc/gumd/useradd.d/20_krate-add.post -%attr(700,root,root) /etc/gumd/userdel.d/20_krate-remove.post %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/shortcut_icon.png %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/indicator_icon.png %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/notification_sub_icon.png -%attr(700,root,root) %dir %{TZ_SYS_ETC}/krate -%attr(600,root,root) %config %{TZ_SYS_ETC}/krate/owner.xml +#%attr(700,root,root) %dir %{TZ_SYS_ETC}/krate %attr(755,root,root) %{_libdir}/security/pam_krate.so %attr(700,root,root) %{_sbindir}/krate-admin-cli %config /etc/pam.d/* diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index c8aba95..c973a82 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -65,10 +65,6 @@ CONFIGURE_FILE(systemd/krate.service.in systemd/krate.service) INSTALL(TARGETS ${SERVER_NAME} DESTINATION ${BIN_DIR}) INSTALL(FILES systemd/krate.service DESTINATION ${SYSTEMD_UNIT_DIR}) -INSTALL(FILES ${KRATE_TOOLS}/gumd-scripts/20_krate-add.post DESTINATION /etc/gumd/useradd.d) -INSTALL(FILES ${KRATE_TOOLS}/gumd-scripts/20_krate-remove.post DESTINATION /etc/gumd/userdel.d) - -INSTALL(FILES ${KRATE_DATA}/DefaultManifest.xml DESTINATION ${CONF_DIR} RENAME owner.xml) INSTALL(FILES ${KRATE_DATA}/indicator_icon.png DESTINATION ${ICON_DIR}) INSTALL(FILES ${KRATE_DATA}/notification_sub_icon.png DESTINATION ${ICON_DIR}) INSTALL(FILES ${KRATE_DATA}/shortcut_icon.png DESTINATION ${ICON_DIR}) diff --git a/tools/gumd-scripts/20_krate-add.post b/tools/gumd-scripts/20_krate-add.post deleted file mode 100644 index fcaf715..0000000 --- a/tools/gumd-scripts/20_krate-add.post +++ /dev/null @@ -1,4 +0,0 @@ -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -export `tzplatform-get TZ_SYS_ETC` -cp ${TZ_SYS_ETC}/krate/owner.xml ${TZ_SYS_ETC}/krate/${1}.xml diff --git a/tools/gumd-scripts/20_krate-remove.post b/tools/gumd-scripts/20_krate-remove.post deleted file mode 100644 index 73112eb..0000000 --- a/tools/gumd-scripts/20_krate-remove.post +++ /dev/null @@ -1,4 +0,0 @@ -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -export `tzplatform-get TZ_SYS_ETC` -rm ${TZ_SYS_ETC}/krate/${1}.xml -- 2.7.4 From 24d339f4b82adbd02cb0f9023c078e5041e137b4 Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Thu, 22 Sep 2016 11:49:34 +0900 Subject: [PATCH 07/16] Add to wait for lazymount when user is krate Signed-off-by: Sungbae Yoo Change-Id: If8427749f902ad78088644772cc3c26e5ff8a444 --- module/krate.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/module/krate.cpp b/module/krate.cpp index ff21670..b81a901 100644 --- a/module/krate.cpp +++ b/module/krate.cpp @@ -14,6 +14,7 @@ * limitations under the License */ +#include #include #include #include @@ -31,7 +32,11 @@ #include #include +#define KRATE_UID_MIN 60001 +#define KRATE_UID_MAX 60100 + #define LAZYMOUNT_EXTERN extern +#define LAZYMOUNT_LIB "/usr/lib/liblazymount.so.0" std::string buildKrateManifestPath(const std::string& name) { @@ -49,6 +54,45 @@ std::string getKrateName(pam_handle_t* handle) return static_cast(retItem); } +static int wait_condition(void) +{ + int r; + void *h; + + int (*wait_mount_user)(void); + + r = access(LAZYMOUNT_LIB,F_OK); + if (r < 0){ + fprintf(stderr, "cannot find lazymount module - No support lazymount\n"); + return 0; + } + + h = dlopen(LAZYMOUNT_LIB, RTLD_LAZY); + if (!h) { + fprintf(stderr, "lazymount module dlopen error\n"); + return -1; + } + + do{ + wait_mount_user = (int (*)())dlsym(h,"wait_mount_user"); + if (!wait_mount_user) { + fprintf(stderr, "dlsym wait_mount_user error\n"); + dlclose(h); + return -1; + } + } while (0); + + r = wait_mount_user(); + if (r < 0) { + fprintf(stderr, "wait_mout_user failed\n"); + dlclose(h); + return r; + } + + dlclose(h); + return 0; +} + extern "C" { LAZYMOUNT_EXTERN __attribute__((visibility("default"))) int container_preprocess(char* id) { @@ -63,6 +107,10 @@ int container_preprocess(char* id) { builder.unshareNamespace(); }; createSession(user, sessionBuilder); + + if (user.getUid() >= KRATE_UID_MIN && user.getUid() <= KRATE_UID_MAX ) { + wait_condition(); + } } catch (runtime::Exception& e) { std::cerr << "krate error : " << e.what() < Date: Mon, 26 Sep 2016 17:42:58 +0900 Subject: [PATCH 08/16] Change manifest file path into each home directories Signed-off-by: Sungbae Yoo Change-Id: Ife496f7bf33b129120cf5eb6c34818e713d82e6d --- CMakeLists.txt | 4 ---- module/CMakeLists.txt | 4 ---- module/krate.cpp | 2 +- packaging/krate.spec | 2 -- server/CMakeLists.txt | 1 - server/manager.cpp | 55 ++++++++++++++++++++++++++++++++++++++++----------- 6 files changed, 45 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7e3422..bb54602 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,10 +80,6 @@ IF(NOT DEFINED SYSTEMD_UNIT_DIR) SET(SYSTEMD_UNIT_DIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system") ENDIF(NOT DEFINED SYSTEMD_UNIT_DIR) -IF(NOT DEFINED CONF_DIR) - SET(CONF_INSTALL_DIR "${SYSCONF_INSTALL_DIR}/krate") -ENDIF(NOT DEFINED CONF_DIR) - ADD_DEFINITIONS(-DUG_WAYLAND) ADD_SUBDIRECTORY(${KRATE_LIB}) diff --git a/module/CMakeLists.txt b/module/CMakeLists.txt index ab4f5e3..9a7295f 100644 --- a/module/CMakeLists.txt +++ b/module/CMakeLists.txt @@ -44,10 +44,6 @@ PKG_CHECK_MODULES(PAM_DEPS REQUIRED INCLUDE_DIRECTORIES(${PAM_INCLUDE_DIR} ${PAM_DEPS_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES(${PAM_NAME} ${PAM_LIBRARY} ${PAM_DEPS_LIBRARIES} pthread) -TARGET_COMPILE_DEFINITIONS(${PAM_NAME} PRIVATE - CONF_PATH="${CONF_DIR}" -) - CONFIGURE_FILE(pam.d/systemd-user.in pam.d/systemd-user-${PROJECT_NAME}) INSTALL(TARGETS ${PAM_NAME} DESTINATION ${LIB_INSTALL_DIR}/security) diff --git a/module/krate.cpp b/module/krate.cpp index b81a901..409b12e 100644 --- a/module/krate.cpp +++ b/module/krate.cpp @@ -40,7 +40,7 @@ std::string buildKrateManifestPath(const std::string& name) { - return CONF_PATH "/" + name + ".xml"; + return "/home/" + name + "/.config/krate/krate.xml"; } std::string getKrateName(pam_handle_t* handle) diff --git a/packaging/krate.spec b/packaging/krate.spec index 62c6508..9454f00 100644 --- a/packaging/krate.spec +++ b/packaging/krate.spec @@ -41,7 +41,6 @@ krates. %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/shortcut_icon.png %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/indicator_icon.png %attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/notification_sub_icon.png -#%attr(700,root,root) %dir %{TZ_SYS_ETC}/krate %attr(755,root,root) %{_libdir}/security/pam_krate.so %attr(700,root,root) %{_sbindir}/krate-admin-cli %config /etc/pam.d/* @@ -67,7 +66,6 @@ krates. -DHOME_DIR=%{TZ_SYS_HOME} \ -DSYSTEMD_UNIT_DIR=%{_unitdir} \ -DPAMD_DIR=/etc/pam.d \ - -DCONF_DIR=%{TZ_SYS_ETC}/krate \ -DICON_DIR="%{TZ_SYS_RO_ICONS}/krate" \ -DAPP_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \ -DAPP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index c973a82..91bc477 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -55,7 +55,6 @@ SET_TARGET_PROPERTIES(${SERVER_NAME} PROPERTIES COMPILE_FLAGS "-fPIE") SET_TARGET_PROPERTIES(${SERVER_NAME} PROPERTIES LINK_FLAGS "-pie") TARGET_COMPILE_DEFINITIONS(${SERVER_NAME} PRIVATE - CONF_PATH="${CONF_DIR}" RUN_PATH="${RUN_DIR}" ICON_PATH="${ICON_DIR}" ) diff --git a/server/manager.cpp b/server/manager.cpp index ec6f58a..ad7fb6a 100644 --- a/server/manager.cpp +++ b/server/manager.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -191,17 +192,35 @@ int packageEventHandler(uid_t target_uid, int req_id, return 0; } -void initializeCreatedKrateList() { - try { - runtime::DirectoryIterator iter(CONF_PATH "/"), end; +void initializeCreatedKrateList() +{ + const gchar *type[] = {"security", NULL}; + gchar *username; + GumUserService *service; + GumUserList *users; + GumUser *user; + + service = gum_user_service_create_sync(FALSE); + if (!service) { + return; + } + + users = gum_user_service_get_user_list_sync(service, type); + if (!users) { + return; + } - while (iter != end) { - const std::string& file = iter->getName(); - const std::string& name(file.substr(0, file.rfind(".xml"))); - createdKrateList.push_back(name); - ++iter; + for (GumUserList *src_list = users; src_list != NULL; src_list = g_list_next(src_list)) { + user = (GumUser*) src_list->data; + if (user) { + g_object_get(G_OBJECT(user), "username", &username, NULL); + createdKrateList.push_back(username); + g_free(username); } - } catch (runtime::Exception& e) {} + } + + gum_user_service_list_free(users); + g_object_unref(service); } #define NT_TITLE NOTIFICATION_TEXT_TYPE_TITLE @@ -536,13 +555,21 @@ int Manager::createKrate(const std::string& name, const std::string& manifest) maskUserServices(user); + ::tzplatform_set_user(user.getUid()); + runtime::File confDir(std::string(::tzplatform_getenv(TZ_USER_HOME)) + "/.config/krate"); + ::tzplatform_reset_user(); + if (!confDir.exists()) { + confDir.makeDirectory(true); + confDir.chmod(700); + } + manifestFile.reset(xml::Parser::parseString(manifest)); //write container author info if (!pkgId.empty()) { std::cout << manifestFile->getRootNode().getName() << std::endl; manifestFile->getRootNode().addNewChild("author").setContent(pkgId); } - manifestFile->write(CONF_PATH "/" + name + ".xml", "UTF-8", true); + manifestFile->write(confDir.getPath() + "/" + name + ".xml", "UTF-8", true); //unlock the user setKrateState(user.getUid(), 1); @@ -571,7 +598,13 @@ int Manager::removeKrate(const std::string& name) std::unique_ptr manifestFile; bool canRemove = false; - manifestFile.reset(xml::Parser::parseFile(CONF_PATH "/" + name + ".xml")); + runtime::User user(name); + ::tzplatform_set_user(user.getUid()); + std::string confPath(::tzplatform_getenv(TZ_USER_HOME)); + confPath += "/.config/krate"; + ::tzplatform_reset_user(); + + manifestFile.reset(xml::Parser::parseFile(confPath + "/" + name + ".xml")); xml::Node::NodeList authors = manifestFile->evaluate("/manifest/author"); for (const xml::Node& author : authors) { if (author.getContent() == pkgId) { -- 2.7.4 From fbee0fd6119ab083792e670e09e88fc5ae849de2 Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Mon, 17 Oct 2016 13:40:05 +0900 Subject: [PATCH 09/16] Add NULL checking after get an value of entry Signed-off-by: Sungbae Yoo Change-Id: I330045d29440b9c1652dabfdc9e7ed977861e542 --- tools/apps/setup-wizard/src/security.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/apps/setup-wizard/src/security.c b/tools/apps/setup-wizard/src/security.c index c80dc54..6a75fa5 100644 --- a/tools/apps/setup-wizard/src/security.c +++ b/tools/apps/setup-wizard/src/security.c @@ -210,6 +210,9 @@ static void security_password_entry_changed_cb(void *data, Evas_Object *obj, voi Evas_Object *button; const char *entry_data = elm_entry_entry_get(obj); + if (entry_data == NULL) + return; + if (security_passphrase_mode < PASSPHRASE_STATE_VERIFY) button = (Evas_Object *)evas_object_data_get(ud.nf, "setup_button"); else -- 2.7.4 From 2f9751c858f40faa97100caa84436da0c39cd21f Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Mon, 17 Oct 2016 13:44:19 +0900 Subject: [PATCH 10/16] Fix to apply whitespace coding rules Signed-off-by: Sungbae Yoo Change-Id: Ia2992812c94045a19b5133deccab9f250c690270 --- module/krate.cpp | 4 ++-- rmi/app-proxy.h | 10 +++------- rmi/package-proxy.h | 6 ++---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/module/krate.cpp b/module/krate.cpp index 409b12e..f057748 100644 --- a/module/krate.cpp +++ b/module/krate.cpp @@ -61,7 +61,7 @@ static int wait_condition(void) int (*wait_mount_user)(void); - r = access(LAZYMOUNT_LIB,F_OK); + r = access(LAZYMOUNT_LIB, F_OK); if (r < 0){ fprintf(stderr, "cannot find lazymount module - No support lazymount\n"); return 0; @@ -74,7 +74,7 @@ static int wait_condition(void) } do{ - wait_mount_user = (int (*)())dlsym(h,"wait_mount_user"); + wait_mount_user = (int (*)())dlsym(h, "wait_mount_user"); if (!wait_mount_user) { fprintf(stderr, "dlsym wait_mount_user error\n"); dlclose(h); diff --git a/rmi/app-proxy.h b/rmi/app-proxy.h index 61c0f64..2790f28 100644 --- a/rmi/app-proxy.h +++ b/rmi/app-proxy.h @@ -44,10 +44,8 @@ public: bool isTaskManaged; REFLECTABLE - ( - krate, id, locale, package, type, icon, label, - componentType, isNoDisplayed, isTaskManaged - ); + (krate, id, locale, package, type, icon, label, + componentType, isNoDisplayed, isTaskManaged); }; AppInfo getAppInfo(const std::string& name, const std::string& appid); @@ -72,9 +70,7 @@ public: std::vector extraData; REFLECTABLE - ( - operation, uri, mime, category, appId, extraData - ); + (operation, uri, mime, category, appId, extraData); }; int launch(const std::string& name, const Bundle& bundle); diff --git a/rmi/package-proxy.h b/rmi/package-proxy.h index 271d838..c4671ef 100644 --- a/rmi/package-proxy.h +++ b/rmi/package-proxy.h @@ -53,10 +53,8 @@ public: bool isPreload; REFLECTABLE - ( - krate, id, locale, type, icon, label, description, author, - version, apiVersion, mainAppId, isSystem, isRemovable, isPreload - ); + (krate, id, locale, type, icon, label, description, author, + version, apiVersion, mainAppId, isSystem, isRemovable, isPreload); }; PackageInfo getPackageInfo(const std::string& name, const std::string& pkgid); -- 2.7.4 From 230616d8f1f4a46ff2b5c961a0d7c718e3db734f Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Fri, 4 Nov 2016 11:07:23 +0900 Subject: [PATCH 11/16] Change to apply pkgmgrinfo API changes pkgmgrinfo_client_set_status_type, pkgmgrinfo_handler are renamed Signed-off-by: Sungbae Yoo Change-Id: I169b800c16ea75b8bc36a48060128852be00c43a --- lib/krate/package-proxy.cpp | 2 +- server/packman.cpp | 2 +- server/packman.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/krate/package-proxy.cpp b/lib/krate/package-proxy.cpp index a78db06..e4afea6 100644 --- a/lib/krate/package-proxy.cpp +++ b/lib/krate/package-proxy.cpp @@ -271,7 +271,7 @@ int krate_package_proxy_set_event_status(krate_package_proxy_h handle, int statu auto instance = getInstance(handle); int ret; - ret = pkgmgrinfo_client_set_status_type(instance->pNativeHandle, status_type); + ret = pkgmgr_client_set_status_type(instance->pNativeHandle, status_type); if (ret != PACKAGE_MANAGER_ERROR_NONE) return KRATE_ERROR_INVALID_PARAMETER; diff --git a/server/packman.cpp b/server/packman.cpp index 1a80e12..9425374 100644 --- a/server/packman.cpp +++ b/server/packman.cpp @@ -337,7 +337,7 @@ PackageManager& PackageManager::instance() return __instance__; } -void PackageManager::setEventCallback(pkgmgrinfo_handler callback, void* user_data) +void PackageManager::setEventCallback(pkgmgr_handler callback, void* user_data) { int ret; ret = ::pkgmgr_client_listen_status(nativeListenHandle, callback, user_data); diff --git a/server/packman.h b/server/packman.h index ab54341..b8b2860 100644 --- a/server/packman.h +++ b/server/packman.h @@ -91,7 +91,7 @@ public: std::vector getPackageList(const uid_t user); std::vector getAppList(const uid_t user); - void setEventCallback(pkgmgrinfo_handler callback, void* user_data); + void setEventCallback(pkgmgr_handler callback, void* user_data); void unsetEventCallback(); void setModeRestriction(int mode, uid_t user); -- 2.7.4 From 61e1e98af64c0fb6b645b044936f7e7c60794015 Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Mon, 7 Nov 2016 14:36:01 +0900 Subject: [PATCH 12/16] Add privilege(notification) to kaskit for supporting badge Change-Id: I8fd4f4bcf4b6afb2d1e8cb790d4ec4e91586e4a2 Signed-off-by: Sungbae Yoo --- tools/apps/kaskit/org.tizen.kaskit.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/apps/kaskit/org.tizen.kaskit.xml b/tools/apps/kaskit/org.tizen.kaskit.xml index 846be83..e51ac98 100644 --- a/tools/apps/kaskit/org.tizen.kaskit.xml +++ b/tools/apps/kaskit/org.tizen.kaskit.xml @@ -5,6 +5,7 @@ http://tizen.org/privilege/appmanager.launch http://tizen.org/privilege/packagemanager.info http://tizen.org/privilege/packagemanager.admin + http://tizen.org/privilege/notification -- 2.7.4 From faf413561a6d0bfde3b50190bbfcdb2fe1af2c7b Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Mon, 7 Nov 2016 14:37:19 +0900 Subject: [PATCH 13/16] Fix offesets not to be cut for badge images Change-Id: I4ffd776e82cda1027835514ec0d5aafcd4da3c56 Signed-off-by: Sungbae Yoo --- tools/apps/kaskit/res/edje/app_icon.edc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/apps/kaskit/res/edje/app_icon.edc b/tools/apps/kaskit/res/edje/app_icon.edc index 3af232f..98e5b8e 100644 --- a/tools/apps/kaskit/res/edje/app_icon.edc +++ b/tools/apps/kaskit/res/edje/app_icon.edc @@ -124,8 +124,8 @@ group { name: "icon"; scale: 0; description { state: "default" 0.0; - rel1{relative: 0.0 0.0; offset: -10 -1; to: "badge_text";} - rel2{relative: 1.0 1.0; offset: 13 1; to: "badge_text";} + rel1{relative: 0.0 0.0; offset: -10 1; to: "badge_text";} + rel2{relative: 1.0 1.0; offset: 13 3; to: "badge_text";} visible: 0; image { @@ -147,8 +147,8 @@ group { name: "icon"; visible: 0; fixed: 1 1; color: 255 255 255 255; - rel1{relative: 0.95 -0.05; to: "icon_content";} - rel2{relative: 0.95 -0.05; to: "icon_content";} + rel1{relative: 0.95 -0.05; offset: 0 2; to: "icon_content";} + rel2{relative: 0.95 -0.05; offset: 0 2; to: "icon_content";} align: 1.0 0.0; text { font: "arial"; -- 2.7.4 From f76f433350fe6d73186d82d1937f78bddfa04d6e Mon Sep 17 00:00:00 2001 From: "seolheui,kim" Date: Mon, 7 Nov 2016 14:59:40 +0900 Subject: [PATCH 14/16] Modify security page of setup-wizard Change-Id: I8c45c67860be3f0c444cc7afeba0ca6052f575c6 Signed-off-by: seolheui,kim --- tools/apps/setup-wizard/src/security.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/apps/setup-wizard/src/security.c b/tools/apps/setup-wizard/src/security.c index 6a75fa5..60ba4cd 100644 --- a/tools/apps/setup-wizard/src/security.c +++ b/tools/apps/setup-wizard/src/security.c @@ -24,6 +24,9 @@ #define PASSPHRASE_STATE_SETUP 1 #define PASSPHRASE_STATE_VERIFY 2 +#define ARRAY_SIZE(_array_) \ + (sizeof(_array_) / sizeof(_array_[0])) + extern uidata_s ud; struct security_lock_type { @@ -31,14 +34,12 @@ struct security_lock_type { int index; }; -struct security_lock_type security_lock_types[2] = { +struct security_lock_type security_lock_types[] = { { "Password", 0 }, - { "PIN", 1 } }; -char* security_group_text[2] = { +char* security_group_text[] = { "Unlock method", - "Security options" }; static char* security_password_setup_data = NULL; @@ -73,6 +74,7 @@ static char *security_group_text_get(void *data, Evas_Object *obj, const char *p return NULL; } +#if 0 static char *security_double_label_text_get(void *data, Evas_Object *obj, const char *part) { char text[PATH_MAX] = "\0"; @@ -85,6 +87,7 @@ static char *security_double_label_text_get(void *data, Evas_Object *obj, const return strdup(text); } +#endif static char *security_lock_type_text_get(void *data, Evas_Object *obj, const char *part) { @@ -311,7 +314,7 @@ void _create_security_view(appdata_s *ad) _append_genlist_item(genlist, itc, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY, security_group_text[0]); itc = _create_genlist_item_class("one_icon", security_lock_type_text_get, security_lock_type_content_get); - for (index = 0; index < 2; index++) { + for (index = 0; index < ARRAY_SIZE(security_lock_types); index++) { item = elm_genlist_item_append(genlist, itc, &security_lock_types[index], @@ -323,7 +326,7 @@ void _create_security_view(appdata_s *ad) elm_object_item_disabled_set(item, EINA_TRUE); } } - +#if 0 /* Timeout list group*/ itc = _create_genlist_item_class("group_index", security_group_text_get, NULL); _append_genlist_item(genlist, itc, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY, security_group_text[1]); @@ -331,7 +334,7 @@ void _create_security_view(appdata_s *ad) itc = _create_genlist_item_class("double_label", security_double_label_text_get, NULL); item = _append_genlist_item(genlist, itc, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY, NULL); elm_object_item_disabled_set(item, EINA_TRUE); /* [TBD] enable timeout options */ - +#endif left_button = _create_button(layout, PREV_BUTTON, security_previous_view_cb, NULL); right_button = _create_button(layout, NEXT_BUTTON, security_password_setup_cb, ad); _create_two_button_layout(layout, left_button, right_button); -- 2.7.4 From a76de2a530fa7eb054fb4488c35b1e1ee63468d8 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Fri, 4 Nov 2016 17:28:34 +0900 Subject: [PATCH 15/16] Remove Profile Build Dependencies 1. This is for Tizen 4.0 The cdefine "TIZEN_PROFILE_NAME" has been completely useless. So, let's remove it. $ grep -r "TIZEN_PROFILE_NAME" * packaging/krate.spec: -DTIZEN_PROFILE_NAME=%{profile} \ $ Change-Id: I7f1d6d22e9199ef665d0983daf461cd52f286358 Signed-off-by: MyungJoo Ham --- packaging/krate.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/packaging/krate.spec b/packaging/krate.spec index 9454f00..da84733 100644 --- a/packaging/krate.spec +++ b/packaging/krate.spec @@ -56,11 +56,8 @@ krates. CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE" %endif -%{!?profile:%define profile "mobile"} - %cmake . -DVERSION=%{version} \ -DCMAKE_BUILD_TYPE=%{build_type} \ - -DTIZEN_PROFILE_NAME=%{profile} \ -DRUN_DIR=%{TZ_SYS_RUN} \ -DBIN_DIR=%{TZ_SYS_BIN} \ -DHOME_DIR=%{TZ_SYS_HOME} \ -- 2.7.4 From d148d7fac4ea933d0819fbc1c80be92c42a9a218 Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Thu, 20 Oct 2016 11:45:31 +0900 Subject: [PATCH 16/16] Add to remove the shortcut when container is removed Signed-off-by: Sungbae Yoo Change-Id: I04fc0f358ec32a9873839ba1af16084144f01a7d --- tools/apps/keyguard/src/main.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/apps/keyguard/src/main.c b/tools/apps/keyguard/src/main.c index f04bc21..8ddae52 100644 --- a/tools/apps/keyguard/src/main.c +++ b/tools/apps/keyguard/src/main.c @@ -51,7 +51,7 @@ unsigned int _get_left_attempts() { unsigned int attempt = 0, max_attempt = 0, expire_sec; - auth_passwd_check_passwd_state(AUTH_PWD_NORMAL, &attempt, &max_attempt, &expire_sec); + auth_passwd_check_passwd_state(AUTH_PWD_NORMAL, &attempt, &max_attempt, &expire_sec); if (max_attempt == 0) { return 0xffffffff; @@ -80,6 +80,11 @@ static void __add_shortcut(const char* krate_name) shortcut_add_to_home(krate_name, LAUNCH_BY_URI, uri, ICON_PATH "/shortcut_icon.png", 0, NULL, NULL); } +static void __remove_shortcut(const char* krate_name) +{ + shortcut_remove_from_home(krate_name, NULL, NULL); +} + static bool __app_create(void *data) { return true; @@ -128,6 +133,13 @@ static void __app_control(app_control_h app_control, void *data) __add_shortcut(krate_name); ui_app_exit(); return; + } else if (strncmp(tmp, "cleanup/", sizeof("cleanup/") - 1) == 0) { + char *krate_name; + + krate_name = tmp + sizeof("cleanup/") - 1; + __remove_shortcut(krate_name); + ui_app_exit(); + return; } else if (strncmp(tmp, "enter/", sizeof("enter/") - 1) == 0) { char* krate_name, *launch_parameter; char new_uri[PATH_MAX]; @@ -137,7 +149,7 @@ static void __app_control(app_control_h app_control, void *data) if (launch_parameter != NULL) { *(launch_parameter++) = '\0'; if (launch_parameter[0] == '\0') { - launch_parameter = KASKIT_PACKAGE; + launch_parameter = KASKIT_PACKAGE; } } else { launch_parameter = KASKIT_PACKAGE; @@ -153,7 +165,7 @@ static void __app_control(app_control_h app_control, void *data) __launch_krate_app(krate_name, app_control); ui_app_exit(); return; - }else if (strncmp(tmp, "launch/", sizeof("launch/") - 1) == 0) { + } else if (strncmp(tmp, "launch/", sizeof("launch/") - 1) == 0) { char* app_id; app_id = tmp + sizeof("launch/") - 1; -- 2.7.4