Remove 'erase' API from secure-erase 12/151912/1
authors414kim <s414.kim@samsung.com>
Fri, 22 Sep 2017 08:55:42 +0000 (17:55 +0900)
committers414kim <s414.kim@samsung.com>
Fri, 22 Sep 2017 08:55:42 +0000 (17:55 +0900)
Change-Id: I4d9d287fe3915e1d2a4fd8fc7a405af06139efd0
Signed-off-by: s414kim <s414.kim@samsung.com>
lib/ode/secure-erase.cpp
lib/ode/secure-erase.h
lib/secure-erase.cpp
rmi/secure-erase.h
server/secure-erase.cpp
tools/cli/ode-admin-cli.cpp

index 1ad49f56c21438a1c2e16dacd70c9757ecfc52f3..ff84342a7db5c37fe03a434eaa1bb58841bce451 100644 (file)
 
 using namespace ode;
 
-int ode_secure_erase(const char* name)
-{
-       RET_ON_FAILURE(name, ODE_ERROR_INVALID_PARAMETER);
-
-       ODEContext client;
-       RET_ON_FAILURE(client.connect() == 0, ODE_ERROR_CONNECTION_REFUSED);
-       SecureErase secure = client.createInterface<SecureErase>();
-
-       return secure.erase(name);
-}
-
 int ode_secure_clean(const char* name)
 {
        RET_ON_FAILURE(name, ODE_ERROR_INVALID_PARAMETER);
index 8fb8c6d8bb1ab4bcdeb4ca5350f60aae3670508c..e70ee1d9a3eda2709a7abc5f9449353e231e0890 100644 (file)
 extern "C" {
 #endif
 
-/**
- * @brief       Erase the file or device with given name securely.
- * @details     Administrator can use this API to secure-erase the files.
- * @since_tizen 4.0
- * @param[in]   name The file/directory or device name
- * @return      #ODE_ERROR_NONE on success, otherwise a negative value
- * @retval      #ODE_ERROR_NONE Successful
- * @retval      #ODE_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval      #ODE_ERROR_TIMED_OUT Time out
- * @retval      #ODE_ERROR_NO_SUCH_FILE No such file or directory
- * @retval      #ODE_ERROR_NOT_PERMITTED Operation not permitted
- * @retval      #ODE_ERROR_PERMISSION_DENIED The application does not have
- *              the privilege to call this API
- * @pre         The file or device to the given name must be exists.
- * @pre         If the device is specified, it must be a block device.
- */
-ODE_API int ode_secure_erase(const char* name);
-
 /**
  * @brief       Clean garbage in the device with given name securely.
  * @details     Administrator can use this API to collect garbage in the device.
index f96ced9339f20fe9c53320649e80ba17eeda0413..2d397e55dd5440cab02128ddc4f1ebe60dd2e90d 100644 (file)
@@ -26,15 +26,6 @@ SecureErase::~SecureErase()
 {
 }
 
-int SecureErase::erase(const std::string& name)
-{
-       try {
-               return context->methodCall<int>("SecureErase::erase", name);
-       } catch (runtime::Exception& e) {
-               return -1;
-       }
-}
-
 int SecureErase::clean(const std::string& name)
 {
        try {
index 2eb47356dcaacfaf1f5ca83f6141cd6f8c891d81..a64ee990d065438f316f4d9eca71722964728b28 100644 (file)
@@ -30,7 +30,6 @@ public:
        SecureErase(ODEControlContext& ctxt);
        ~SecureErase();
 
-       int erase(const std::string& name);
        int clean(const std::string& name);
 
 private:
index fe0e36276f1116fc8fb5adfd85653ffa7d2974d2..a0c6cda4b727fcd31263caf3af594d465a6d8d24 100644 (file)
@@ -94,7 +94,6 @@ const std::string evaluateTarget(const std::string &path)
 SecureErase::SecureErase(ODEControlContext &ctx) :
        context(ctx)
 {
-       context.expose(this, PRIVILEGE_PLATFORM, (int)(SecureErase::erase)(std::string));
        context.expose(this, PRIVILEGE_PLATFORM, (int)(SecureErase::clean)(std::string));
 
        engine.reset(new ERASE_ENGINE(ProgressBar([](int v) {
@@ -107,21 +106,6 @@ SecureErase::~SecureErase()
 {
 }
 
-
-
-int SecureErase::erase(const std::string &name)
-{
-       auto eraseWorker = [name, this]() {
-               try {
-               } catch (runtime::Exception &e) {}
-       };
-
-       std::thread asyncWork(eraseWorker);
-       asyncWork.detach();
-
-       return 0;
-}
-
 int SecureErase::clean(const std::string &name)
 {
        auto cleanWorker = [name, this]() {
index ae9a6f9ec90a666217fa027bb075341833f902d3..4bce8ad426a353e167cf014bfe96eccd9afa2ea3 100644 (file)
@@ -48,7 +48,6 @@ static inline int usage(const std::string name)
                          << "   -p, --changepw=internal|external|extension change password" << std::endl
                          << "   -s, --state=internal|external|extension    get state" << std::endl
                          << "   -w, --waitmnt=internal|external|extension  wait for mount"<< std::endl
-                         << "   -r, --erase=FILE|DIRECTORY                 secure-erase" << std::endl
                          << "   -c, --clean=DIRECTORY                      secure-clean" << std::endl
                          << "   -h, --help                                 show this" << std::endl
                          << std::endl;
@@ -420,18 +419,6 @@ static inline int wait_for_mount(const std::string name)
        return ret;
 }
 
-static inline int erase(const std::string name)
-{
-       int ret;
-
-       ret = ode_secure_erase(name.c_str());
-       if (ret != 0) {
-               std::cerr << "Error : " << ret <<std::endl;
-       }
-
-       return ret;
-}
-
 static inline int clean(const std::string name)
 {
        int ret;
@@ -457,7 +444,6 @@ int main(int argc, char* argv[])
                {"format", required_argument, 0, 'f'},
                {"state", required_argument, 0, 's'},
                {"waitmnt", required_argument, 0, 'w'},
-               {"erase", required_argument, 0, 'r'},
                {"clean", required_argument, 0, 'c'},
                {0, 0, 0, 0}
        };
@@ -467,7 +453,7 @@ int main(int argc, char* argv[])
                return EXIT_SUCCESS;
        }
 
-       while ((opt = getopt_long(argc, argv, "m:u:e:d:f:p:s:w:r:c:h", options, &index)) != -1) {
+       while ((opt = getopt_long(argc, argv, "m:u:e:d:f:p:s:w:c:h", options, &index)) != -1) {
                switch (opt) {
                case 'm':
                        ret = mount(optarg);
@@ -493,9 +479,6 @@ int main(int argc, char* argv[])
                case 's':
                        ret = get_state(optarg);
                        break;
-               case 'r':
-                       ret = erase(optarg);
-                       break;
                case 'c':
                        ret = clean(optarg);
                        break;