[Bug] Fix installation/deinstallation mode with smack 29/46429/7
authorTomasz Iwanek <t.iwanek@samsung.com>
Thu, 20 Aug 2015 07:24:23 +0000 (09:24 +0200)
committerPawel Sikorski <p.sikorski@samsung.com>
Thu, 20 Aug 2015 13:20:08 +0000 (06:20 -0700)
commit775bf2df912f040df96f0b00a893a06a703308b5
treecd9d5c4a68d4997909abf8ecdcd6284bf3dafa34
parent661e592210facc2fbded2a69e1a6b2dd1d990205
[Bug] Fix installation/deinstallation mode with smack

As stated in: https://review.tizen.org/gerrit/#/c/46420/

"""
On uninstall steps, old code runs StepRevokeSecurity before
StepRemoveFiles. With SMACK enabled, once StepRevokeSecurity
is finished, the installer processes(tpk and wgt) don't have
an authority to remove files, so the app
directory($HOME/apps_rw/[pkgid]) is still remained. When the
same app is installed again, the installer process crashes,
as the boost::exists() to the app destination directory raises
an exception on SMACK denial. This patch moves the
StepRevokeSecurity to the end of the list of steps on uninstall,
to give the privilege to delete the app directory to the installers.
"""

Splitting StepRevokeSecurity into two parts so that deinstallation
and deinstallation rollback should work.

Splitting StepRegisterSecurity into 2 steps. Because we need to
remove files before revoking security on rollback.

Change-Id: If597a3c256e09d57aa923566f5c3454d497c0593
src/common/CMakeLists.txt
src/common/step/step_register_security.cc
src/common/step/step_register_security.h
src/common/step/step_revoke_security.cc
src/common/step/step_revoke_security.h
src/common/step/step_rollback_deinstallation_security.cc [new file with mode: 0644]
src/common/step/step_rollback_deinstallation_security.h [new file with mode: 0644]
src/common/step/step_rollback_installation_security.cc [new file with mode: 0644]
src/common/step/step_rollback_installation_security.h [new file with mode: 0644]
src/tpk/tpk_installer.cc
src/wgt/wgt_installer.cc