CSR_CS_REMOVE_FAILED removed from response enum 60/68360/2
authorKyungwook Tak <k.tak@samsung.com>
Wed, 4 May 2016 01:08:01 +0000 (10:08 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Wed, 4 May 2016 01:13:33 +0000 (10:13 +0900)
remove failed info will be returned as error
code(CSR_ERROR_REMOVE_FAILED)
unlike other error cases, csr_cs_scan_file api allocates
detected handle when CSR_ERROR_REMOVE_FAILED returned

Change-Id: Ic4caf38b3a91da771813a83d4e3f4008a2251155
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
src/framework/service/logic.cpp
src/include/csr/content-screening-types.h
src/include/csr/content-screening.h

index 56482ca..9d0b8ad 100644 (file)
@@ -255,7 +255,7 @@ RawBuffer Logic::scanFile(const CsContext &context, const std::string &filepath)
 
                        if (!file && !file->remove()) {
                                ERROR("Failed to remove filepath: " << filepath);
-                               return BinaryQueue::Serialize(CSR_ERROR_REMOVE_FAILED, CsDetected()).pop();
+                               return BinaryQueue::Serialize(CSR_ERROR_REMOVE_FAILED, history).pop();
                        }
                } catch (const FileDoNotExist &) {
                        WARN("File already removed... : " << filepath);
index 2d57ddb..4fa8158 100644 (file)
@@ -62,7 +62,6 @@ typedef enum {
        CSR_CS_SKIP                   = 0x03, /**< A user decided to skip a detected malicious content. */
        CSR_CS_PROCESSING_ALLOWED     = 0x04, /**< A user decided to process a detected malicious data. */
        CSR_CS_PROCESSING_DISALLOWED  = 0x05, /**< A user decided not to process a detected malicious data. */
-       CSR_CS_REMOVE_FAILED          = 0x99  /**< A user decided to remove but removal failed. */
 } csr_cs_user_response_e;
 
 /**
index 93e3d96..df21dfb 100644 (file)
@@ -193,6 +193,9 @@ int csr_cs_scan_data(csr_cs_context_h handle,
  * @retval #CSR_ERROR_OUT_OF_MEMORY         Not enough memory
  * @retval #CSR_ERROR_INVALID_PARAMETER     file_path or presult is invalid
  * @retval #CSR_ERROR_PERMISSION_DENIED     Access denied
+ * @retval #CSR_ERROR_REMOVE_FAILED         File remove failed when malware exist and
+ *                                          user select to remove by popup. @a pdetected
+ *                                          will be allocated on this error unlike others.
  * @retval #CSR_ERROR_FILE_NOT_FOUND        File not found
  * @retval #CSR_ERROR_SOCKET                Socket error between client and server
  * @retval #CSR_ERROR_SERVER                Server has been failed for some reason