From fcb591484e798cea7e66d865f94e79b55c60b36a Mon Sep 17 00:00:00 2001 From: Seokpil Park Date: Fri, 19 Apr 2013 08:31:22 +0900 Subject: [PATCH] [content] Apply secure log Change-Id: Idfba214169f6e175758c97006f29a2f60b97f2df Signed-off-by: Seokpil Park --- packaging/osp-content.spec | 4 ++-- src/FCntAudioContentInfo.cpp | 2 +- src/FCntImageContentInfo.cpp | 2 +- src/FCntOtherContentInfo.cpp | 2 +- src/FCntVideoContentInfo.cpp | 2 +- src/FCnt_ContentManagerImpl.cpp | 18 +++++++++--------- src/FCnt_ContentUtility.cpp | 2 +- src/FCnt_ImageMetadataImpl.cpp | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packaging/osp-content.spec b/packaging/osp-content.spec index a6af7da..95e9d1b 100644 --- a/packaging/osp-content.spec +++ b/packaging/osp-content.spec @@ -85,9 +85,9 @@ osp content library (DEV) %build MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %ifarch %{ix86} -CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_SECURE_LOG -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} %else -CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_SECURE_LOG -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} %endif # Call make instruction with smp support diff --git a/src/FCntAudioContentInfo.cpp b/src/FCntAudioContentInfo.cpp index 056cfa9..6bfc37c 100644 --- a/src/FCntAudioContentInfo.cpp +++ b/src/FCntAudioContentInfo.cpp @@ -116,7 +116,7 @@ AudioContentInfo::Construct(const String& contentPath, const String& thumbnailPa // checks parameters contentLength = contentPath.GetLength(); SysTryReturnResult(NID_CNT, _FileImpl::IsMediaPath(contentPath), E_INVALID_ARG, - "The contentPath should start with /Media or /Storagecard/Media(%ls).", contentPath.GetPointer()); + "The contentPath should start with /Media or /Storagecard/Media."); SysTryReturnResult(NID_CNT, File::IsFileExist(contentPath), E_FILE_NOT_FOUND, "The file corresponding to contentPath could not be found."); diff --git a/src/FCntImageContentInfo.cpp b/src/FCntImageContentInfo.cpp index 4e3e795..e7c9d00 100644 --- a/src/FCntImageContentInfo.cpp +++ b/src/FCntImageContentInfo.cpp @@ -79,7 +79,7 @@ ImageContentInfo::Construct(const String& contentPath, const String& thumbnailPa // checks parameters contentLength = contentPath.GetLength(); SysTryReturnResult(NID_CNT, _FileImpl::IsMediaPath(contentPath), E_INVALID_ARG, - "The contentPath should start with /Media or /Storagecard/Media(%ls).", contentPath.GetPointer()); + "The contentPath should start with /Media or /Storagecard/Media."); SysTryReturnResult(NID_CNT, File::IsFileExist(contentPath), E_FILE_NOT_FOUND, "The file corresponding to contentPath could not be found."); diff --git a/src/FCntOtherContentInfo.cpp b/src/FCntOtherContentInfo.cpp index 5cfdb17..40af32d 100644 --- a/src/FCntOtherContentInfo.cpp +++ b/src/FCntOtherContentInfo.cpp @@ -73,7 +73,7 @@ OtherContentInfo::Construct(const String& contentPath, const String& thumbnailPa // checks parameters contentLength = contentPath.GetLength(); SysTryReturnResult(NID_CNT, _FileImpl::IsMediaPath(contentPath), E_INVALID_ARG, - "The contentPath should start with /Media or /Storagecard/Media(%ls).", contentPath.GetPointer()); + "The contentPath should start with /Media or /Storagecard/Media."); SysTryReturnResult(NID_CNT, File::IsFileExist(contentPath), E_FILE_NOT_FOUND, "The file corresponding to contentPath could not be found."); diff --git a/src/FCntVideoContentInfo.cpp b/src/FCntVideoContentInfo.cpp index 577ecb3..f4df950 100644 --- a/src/FCntVideoContentInfo.cpp +++ b/src/FCntVideoContentInfo.cpp @@ -101,7 +101,7 @@ VideoContentInfo::Construct(const String& contentPath, const String& thumbnailPa // checks parameters contentLength = contentPath.GetLength(); SysTryReturnResult(NID_CNT, _FileImpl::IsMediaPath(contentPath), E_INVALID_ARG, - "The contentPath should start with /Media or /Storagecard/Media(%ls).", contentPath.GetPointer()); + "The contentPath should start with /Media or /Storagecard/Media."); SysTryReturnResult(NID_CNT, File::IsFileExist(contentPath), E_FILE_NOT_FOUND, "The file corresponding to contentPath could not be found."); diff --git a/src/FCnt_ContentManagerImpl.cpp b/src/FCnt_ContentManagerImpl.cpp index 6c08fb3..a2f1827 100644 --- a/src/FCnt_ContentManagerImpl.cpp +++ b/src/FCnt_ContentManagerImpl.cpp @@ -306,7 +306,7 @@ _ContentManagerImpl::CreateContent(const ContentInfo& contentInfo) "[E_INVALID_ARG] pContentData is null."); SysTryReturn(NID_CNT, VerifyMediaFilePathCompatibility(pContentData->contentPath, true), UuId::GetInvalidUuId(), - E_INVALID_ARG, "[E_INVALID_ARG] %ls is not compatible.", (pContentData->contentPath).GetPointer()); + E_INVALID_ARG, "[E_INVALID_ARG] The contentPath is not compatible."); SysTryReturn(NID_CNT, _FileImpl::IsFileExist(pContentData->contentPath), UuId::GetInvalidUuId(), E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] The file corresponding to contentInfo could not be found."); SysTryReturn(NID_CNT, pContentData->contentId == UuId::GetInvalidUuId(), UuId::GetInvalidUuId(), @@ -881,7 +881,7 @@ _ContentManagerImpl::ScanFile(const Tizen::Base::String& contentPath) { ClearLastResult(); - SysLog(NID_CNT, "The scan path is [%ls].", contentPath.GetPointer()); + SysSecureLog(NID_CNT, "The scan path is [%ls].", contentPath.GetPointer()); unique_ptr pContentPath(_StringConverter::CopyToCharArrayN(contentPath)); SysTryReturnResult(NID_CNT, pContentPath, E_SYSTEM, "pContentPath is NULL."); @@ -1297,14 +1297,14 @@ _ContentManagerImpl::MakeContentInfo(const media_info_h pMediaInfo, ContentInfo: else { SysLogException(NID_CNT, E_INVALID_ARG, - "[E_INVALID_ARG] The content path is not supported[%ls].", strFilePath.GetPointer()); + "[E_INVALID_ARG] The content path is not supported."); return E_INVALID_ARG; } } pContentData->contentPath = strFilePath; - SysLog(NID_CNT, "INFO: contentPath[%ls]", strFilePath.GetPointer()); + SysSecureLog(NID_CNT, "INFO: contentPath[%ls]", strFilePath.GetPointer()); } // mimeType @@ -1407,7 +1407,7 @@ _ContentManagerImpl::MakeContentInfo(const media_info_h pMediaInfo, ContentInfo: pContentData->pContentName = new (nothrow) String(pStrValue.get()); - SysLog(NID_CNT, "INFO: contentName[%ls]", (*pContentData->pContentName).GetPointer()); + SysSecureLog(NID_CNT, "INFO: contentName[%ls]", (*pContentData->pContentName).GetPointer()); } // description @@ -1449,7 +1449,7 @@ _ContentManagerImpl::MakeContentInfo(const media_info_h pMediaInfo, ContentInfo: pContentData->pLocationTag = new (nothrow) String(pStrValue.get()); - SysLog(NID_CNT, "INFO: locationTag[%ls]", (*pContentData->pLocationTag).GetPointer()); + SysSecureLog(NID_CNT, "INFO: locationTag[%ls]", (*pContentData->pLocationTag).GetPointer()); } // provider @@ -1490,7 +1490,7 @@ _ContentManagerImpl::MakeContentInfo(const media_info_h pMediaInfo, ContentInfo: { pContentData->latitude = doubleValue; } - SysLog(NID_CNT, "INFO: latitude[%f]", pContentData->latitude); + SysSecureLog(NID_CNT, "INFO: latitude[%f]", pContentData->latitude); val = media_info_get_longitude(pMediaInfo, &doubleValue); SysTryReturnResult(NID_CNT, val == MEDIA_CONTENT_ERROR_NONE, ConvertError(val), @@ -1500,7 +1500,7 @@ _ContentManagerImpl::MakeContentInfo(const media_info_h pMediaInfo, ContentInfo: { pContentData->longitude = doubleValue; } - SysLog(NID_CNT, "INFO: longitude[%f]", pContentData->longitude); + SysSecureLog(NID_CNT, "INFO: longitude[%f]", pContentData->longitude); val = media_info_get_altitude(pMediaInfo, &doubleValue); SysTryReturnResult(NID_CNT, val == MEDIA_CONTENT_ERROR_NONE, ConvertError(val), @@ -1872,7 +1872,7 @@ _ContentManagerImpl::VerifyHomeFilePathCompatibility(const String& contentPath) if (!(contentPath.StartsWith(App::App::GetInstance()->GetAppRootPath(), 0) || contentPath.StartsWith(Environment::GetExternalStoragePath(), 0))) { - SysLogException(NID_CNT, E_INVALID_ARG, "[E_INVALID_ARG] %ls is not supported.", contentPath.GetPointer()); + SysLogException(NID_CNT, E_INVALID_ARG, "[E_INVALID_ARG] The path is not supported."); return false; } } diff --git a/src/FCnt_ContentUtility.cpp b/src/FCnt_ContentUtility.cpp index 244a99b..c6bb8e9 100644 --- a/src/FCnt_ContentUtility.cpp +++ b/src/FCnt_ContentUtility.cpp @@ -278,7 +278,7 @@ _ContentUtility::FillContentData(media_info_h mediaHandle, ContentInfo::_Content if (pMediaPath.get() != NULL) { pContentData->contentPath = String(pMediaPath.get()); - SysLog(NID_CNT, "pContentData->contentPath = %ls", pContentData->contentPath.GetPointer()); + SysSecureLog(NID_CNT, "pContentData->contentPath = %ls", pContentData->contentPath.GetPointer()); } if (pThumbnailPath.get() != NULL) diff --git a/src/FCnt_ImageMetadataImpl.cpp b/src/FCnt_ImageMetadataImpl.cpp index 23f6217..04e2f97 100644 --- a/src/FCnt_ImageMetadataImpl.cpp +++ b/src/FCnt_ImageMetadataImpl.cpp @@ -523,7 +523,7 @@ _ImageMetadataImpl::GetThumbnailN(void) const SysTryReturn(NID_CNT, __pImageMeta != null, null, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] GetThumbnailN failed."); SysTryReturn(NID_CNT, _FileImpl::IsFileExist(__pImageMeta->contentPath), null, E_DATA_NOT_FOUND, - "[E_DATA_NOT_FOUND] GetThumbnailN failed [%ls].", (__pImageMeta->contentPath).GetPointer()); + "[E_DATA_NOT_FOUND] GetThumbnailN from contentPath failed."); Image image; result r = image.Construct(); -- 2.7.4