apply secure log for privacy 26/94526/6
authorSan Cho <san.cho@samsung.com>
Thu, 28 Jul 2016 08:58:48 +0000 (17:58 +0900)
committerintae jeon <intae.jeon@samsung.com>
Tue, 1 Nov 2016 09:10:34 +0000 (02:10 -0700)
Change-Id: Ia76e7dffe1004eee9baf78ed109e7c40ea12034a
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
email-common-use/email-utilities.c
email-common-use/include/email-debug-log.h
email-core/email-core-gmime.c
email-core/email-core-mime.c
email-core/email-core-mm-callbacks.c
email-core/email-core-smtp.c
email-core/email-core-utils.c
email-core/email-storage/email-storage.c

index 96cfb9c..f0e6ee4 100755 (executable)
@@ -165,7 +165,7 @@ INTERNAL_FUNC int em_upper_path(char *path)
 
 INTERNAL_FUNC void em_skip_whitespace(char *addr_str, char **pAddr)
 {
-       EM_DEBUG_FUNC_BEGIN("addr_str[%p]", addr_str);
+       EM_DEBUG_FUNC_BEGIN_SEC("addr_str[%p]", addr_str);
 
        if (!addr_str)
                return ;
@@ -181,12 +181,12 @@ INTERNAL_FUNC void em_skip_whitespace(char *addr_str, char **pAddr)
        ptr[j] = NULL_CHAR;
 
        *pAddr = EM_SAFE_STRDUP(ptr);
-       EM_DEBUG_FUNC_END("ptr[%s]", ptr);
+       EM_DEBUG_FUNC_END_SEC("ptr[%s]", ptr);
 }
 
 INTERNAL_FUNC void em_skip_whitespace_without_alias(char *addr_str, char **pAddr)
 {
-       EM_DEBUG_FUNC_BEGIN("addr_str[%p]", addr_str);
+       EM_DEBUG_FUNC_BEGIN_SEC("addr_str[%p]", addr_str);
 
        if (!addr_str)
                return ;
@@ -231,7 +231,7 @@ INTERNAL_FUNC void em_skip_whitespace_without_alias(char *addr_str, char **pAddr
        ptr[j++] = NULL_CHAR;
 
        *pAddr = EM_SAFE_STRDUP(ptr);
-       EM_DEBUG_FUNC_END("ptr[%s]", ptr);
+       EM_DEBUG_FUNC_END_SEC("ptr[%s]", ptr);
 }
 
 INTERNAL_FUNC char* em_skip_whitespace_without_strdup(char *source_string)
@@ -1384,7 +1384,7 @@ INTERNAL_FUNC int em_fopen(const char *filename, const char *mode, FILE **fp)
 
 INTERNAL_FUNC int em_open(const char *filename, int oflags, mode_t mode, int *handle)
 {
-       EM_DEBUG_FUNC_BEGIN("filename: [%s]", filename);
+       EM_DEBUG_FUNC_BEGIN_SEC("filename : [%s]", filename);
        int err = EMAIL_ERROR_NONE;
 
        if (!filename) {
index ef9141c..8c9cf9c 100755 (executable)
@@ -64,6 +64,7 @@ extern "C"
 #define        EM_DEBUG_LOG_SEC(format, arg...)        SECURE_SLOGD(format, ##arg)
 #define        EM_DEBUG_EXCEPTION_SEC(format, arg...)  SECURE_SLOGE("[EXCEPTION!] " format "\n", ##arg)
 #define        EM_DEBUG_FUNC_BEGIN_SEC(format, arg...) EM_DEBUG_LOG_SEC("BEGIN - "format, ##arg)
+#define        EM_DEBUG_FUNC_END_SEC(format, arg...) EM_DEBUG_LOG_SEC("END - "format, ##arg)
 
 #ifdef  _DEBUG_MIME_PARSE_
 #define EM_DEBUG_LOG_MIME(format, arg...)   EM_DEBUG_LOG_SEC(format, ##arg)
@@ -79,6 +80,8 @@ extern "C"
 #define        EM_DEBUG_FUNC_END(format, arg...)
 #undef EM_DEBUG_FUNC_BEGIN_SEC
 #define        EM_DEBUG_FUNC_BEGIN_SEC(format, arg...)
+#undef EM_DEBUG_FUNC_END_SEC
+#define        EM_DEBUG_FUNC_END_SEC(format, arg...)
 #endif
 
 #ifdef __FEATURE_LOG_FOR_DEBUG_LOG_DEV__
index cfb2494..7ec0c59 100755 (executable)
@@ -3256,7 +3256,7 @@ INTERNAL_FUNC void emcore_gmime_construct_multipart(GMimeMultipart *multipart,
                if (part->body.parameter) {
                        PARAMETER *param = part->body.parameter;
                        while (param) {
-                           EM_DEBUG_LOG("Content-Type Parameter: attribute[%s], value[%s]", param->attribute, param->value);
+                           EM_DEBUG_LOG_SEC("Content-Type Parameter: attribute[%s], value[%s]", param->attribute, param->value);
                                if (param->attribute || param->value)
                                        g_mime_object_set_content_type_parameter(subpart, param->attribute, param->value);
                                param = param->next;
@@ -4980,7 +4980,7 @@ FINISH_OFF:
 
 INTERNAL_FUNC int emcore_gmime_check_filename_duplication(char *source_filename, struct _m_content_info *cnt_info)
 {
-       EM_DEBUG_FUNC_BEGIN("source_file_name [%s], content_info [%p]", source_filename, cnt_info);
+       EM_DEBUG_FUNC_BEGIN_SEC("source_file_name [%s], content_info [%p]", source_filename, cnt_info);
 
        if (!source_filename || !cnt_info || strlen(source_filename) <= 0) {
                EM_DEBUG_EXCEPTION("Invalid parameter");
@@ -5074,7 +5074,7 @@ INTERNAL_FUNC char *emcore_gmime_get_decoding_text(const char *text)
         return NULL;
     }
 
-    EM_DEBUG_LOG("decoded_text : [%s]", decoded_text);
+    EM_DEBUG_LOG_SEC("decoded_text : [%s]", decoded_text);
 
     return decoded_text;
 }
index 013b8f8..6ca95a8 100755 (executable)
@@ -134,7 +134,7 @@ extern long pop3_reply(MAILSTREAM *stream);
 
 char *em_get_escaped_str(const char *str)
 {
-       EM_DEBUG_FUNC_BEGIN("str [%s]", str);
+       EM_DEBUG_FUNC_BEGIN_SEC("str [%s]", str);
 
        int i = 0, j = 0;
        int len = 0;
@@ -161,6 +161,7 @@ char *em_get_escaped_str(const char *str)
        }
        ret[ret_i++] = '\0';
 
+       EM_DEBUG_FUNC_END();
        return ret;
 }
 
@@ -243,6 +244,8 @@ char *em_split_file_path(char *str)
 
        EM_SAFE_FREE(temp_str);
        EM_SAFE_FREE(temp_cid_data);
+
+       EM_DEBUG_FUNC_END();
        return buf;
 }
 
index eb78dea..eef6494 100755 (executable)
@@ -291,7 +291,7 @@ INTERNAL_FUNC void mm_log(char *string, long errflg)
 
        switch (errflg)  {
                case NIL:
-                       EM_DEBUG_LOG("IMAP_TOOLKIT_LOG [%s]", string);
+                       EM_DEBUG_LOG_SEC("IMAP_TOOLKIT_LOG [%s]", string);
                        break;
 
                case WARN:
index 4c9cd93..2e5dba4 100755 (executable)
@@ -132,7 +132,7 @@ static char *emcore_find_img_tag(char *source_string)
                        if (source_string[cur] == 'M' || source_string[cur] == 'm') {
                                cur++;
                                if (source_string[cur] == 'G' || source_string[cur] == 'g') {
-                                       EM_DEBUG_FUNC_END("%s", source_string + cur - 2);
+                                       EM_DEBUG_FUNC_END_SEC("%s", source_string + cur - 2);
                                        return source_string + cur - 2;
                                }
                        }
@@ -2612,7 +2612,7 @@ static int emcore_send_mail_smtp(char *multi_user_name,
        }
 
        send_ret = smtp_send(stream, "MAIL", buf);
-       EM_DEBUG_LOG("[SMTP] MAIL %s --------> %s", buf, stream->reply);
+       EM_DEBUG_LOG_SEC("[SMTP] MAIL %s --------> %s", buf, stream->reply);
 
        switch (send_ret) {
                case SMTP_RESPONSE_OK:
@@ -2858,7 +2858,7 @@ FINISH_OFF:
 
 char *emcore_generate_content_id_string(const char *hostname, int *err)
 {
-       EM_DEBUG_FUNC_BEGIN("hostname[%p]", hostname);
+       EM_DEBUG_FUNC_BEGIN_SEC("hostname[%p]", hostname);
 
        if (!hostname) {
                EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
@@ -2891,7 +2891,7 @@ char *emcore_generate_content_id_string(const char *hostname, int *err)
        if (err)
                *err = EMAIL_ERROR_NONE;
 
-       EM_DEBUG_FUNC_END("cid_string [%s]", cid_string);
+       EM_DEBUG_FUNC_END_SEC("cid_string [%s]", cid_string);
        return cid_string;
 }
 
@@ -3378,7 +3378,7 @@ FINISH_OFF:
 #endif
 static char *emcore_encode_rfc2047_text(char *utf8_text, int *err_code)
 {
-       EM_DEBUG_FUNC_BEGIN("utf8_text[%s], err_code[%p]", utf8_text, err_code);
+       EM_DEBUG_FUNC_BEGIN_SEC("utf8_text[%s], err_code[%p]", utf8_text, err_code);
 
        if (utf8_text == NULL) {
                if (err_code != NULL)
index db9fea5..885e7fb 100755 (executable)
@@ -593,7 +593,7 @@ FINISH_OFF:
 
 INTERNAL_FUNC int emcore_get_file_size(char *path, int *size, int *err_code)
 {
-       EM_DEBUG_FUNC_BEGIN("path[%s], size[%p], err_code[%p]", path, size, err_code);
+       EM_DEBUG_FUNC_BEGIN_SEC("path[%s], size[%p], err_code[%p]", path, size, err_code);
 
        int ret = false;
        int error = EMAIL_ERROR_NONE;
@@ -627,7 +627,7 @@ FINISH_OFF:
 
 INTERNAL_FUNC int emcore_check_drm_file(char *path, int *err_code)
 {
-       EM_DEBUG_FUNC_BEGIN("path[%s], err_code[%p]", path, err_code);
+       EM_DEBUG_FUNC_BEGIN_SEC("path[%s], err_code[%p]", path, err_code);
 
        int ret = false;
        int error = EMAIL_ERROR_NONE;
@@ -1317,7 +1317,7 @@ static char *emcore_get_sound_file_path(int default_ringtone_status, char *alert
                ret = EM_SAFE_STRDUP(vconf_get_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR));
        }
 
-       EM_DEBUG_FUNC_END("ret [%s]", ret);
+       EM_DEBUG_FUNC_END_SEC("ret [%s]", ret);
        return ret;
 }
 
@@ -1805,6 +1805,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac
                        break;
                }
 */
+
                if ((noti_err = notification_set_layout(noti,
                                                                                                NOTIFICATION_LY_NOTI_EVENT_SINGLE)) != NOTIFICATION_ERROR_NONE) {
                        EM_DEBUG_EXCEPTION("notification_set_layout failed [%d]", noti_err);
index ac41f4b..ff45094 100755 (executable)
@@ -11568,7 +11568,7 @@ INTERNAL_FUNC int emstorage_get_save_name(char *multi_user_name, int account_id,
 
                /* Did not allow the slash */
                modified_fname = reg_replace_new(fname, "/", "_");
-               EM_DEBUG_LOG("modified_fname : [%s]", modified_fname);
+               EM_DEBUG_LOG_SEC("modified_fname : [%s]", modified_fname);
 
                if (modified_fname == NULL) modified_fname = g_strdup(fname);
 
@@ -11623,10 +11623,10 @@ INTERNAL_FUNC int emstorage_get_save_name(char *multi_user_name, int account_id,
                        goto FINISH_OFF;
                }
         snprintf(move_buf, 512, "%s/%s", prefix_path, path_buf);
-        EM_DEBUG_LOG("move_buf : [%s]", move_buf);
+        EM_DEBUG_LOG_SEC("move_buf : [%s]", move_buf);
     } else {
         snprintf(move_buf, 512, "%s", path_buf);
-        EM_DEBUG_LOG("move_buf : [%s]", move_buf);
+        EM_DEBUG_LOG_SEC("move_buf : [%s]", move_buf);
     }
 
        ret = true;
@@ -11814,7 +11814,7 @@ FINISH_OFF:
 
 INTERNAL_FUNC int emstorage_copy_file(char *src_file, char *dst_file, int sync_status, int *err_code)
 {
-       EM_DEBUG_FUNC_BEGIN("src_file[%s], dst_file[%s], err_code[%p]", src_file, dst_file, err_code);
+       EM_DEBUG_FUNC_BEGIN_SEC("src_file[%s], dst_file[%s], err_code[%p]", src_file, dst_file, err_code);
        EM_DEBUG_LOG("Using the fsync function");
        int ret = false;
        int error = EMAIL_ERROR_NONE;