Release version 1.34.25
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_recover_change_owner.h
1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMMON_STEP_FILESYSTEM_STEP_RECOVER_CHANGE_OWNER_H_
6 #define COMMON_STEP_FILESYSTEM_STEP_RECOVER_CHANGE_OWNER_H_
7
8 #include <manifest_parser/utils/logging.h>
9
10 #include "common/installer_context.h"
11 #include "common/step/recovery/step_recovery.h"
12
13 namespace common_installer {
14 namespace filesystem {
15
16 /**
17  * @brief step responsible for changing ownership.
18  *
19  * Part of Recovery Mode. Is responsible for changing ownership of package
20  * directories during package recovery.
21  * Used by WGT and TPK.
22  */
23 class StepRecoverChangeOwner : public recovery::StepRecovery {
24  public:
25   using StepRecovery::StepRecovery;
26
27   Status RecoveryNew() override { return Status::OK; };
28   Status RecoveryUpdate() override;
29   Status RecoveryReadonlyUpdateInstall() override { return Status::OK; };
30
31  private:
32   Step::Status ChangeOwnershipIconsAndManifest(const boost::optional<gid_t> gid,
33       const uid_t uid);
34
35   STEP_NAME(RecoverChangeOwner)
36 };
37
38 }  // namespace filesystem
39 }  // namespace common_installer
40
41 #endif  // COMMON_STEP_FILESYSTEM_STEP_RECOVER_CHANGE_OWNER_H_