# HG changeset patch # User Alain Mazy # Date 1713775833 -7200 # Node ID c80dbbae3f6073f76ada6234861972afcdc084bd # Parent 462b8f8a619c6fc810a2987a5bc0155c32245a5c Removed potential PHI from the logs when Orthanc encounters an error while creating a zip file diff -r 462b8f8a619c -r c80dbbae3f60 NEWS --- a/NEWS Mon Apr 22 10:39:33 2024 +0200 +++ b/NEWS Mon Apr 22 10:50:33 2024 +0200 @@ -13,6 +13,9 @@ * The 0x0111 DIMSE Status is now considered as a warning instead of an error when received as a response to a C-Store. See https://discourse.orthanc-server.org/t/ignore-dimse-status-0x0111-when-sending-partial-duplicate-studies/4555/3 +* Removed potential PHI from the logs when Orthanc encounters an error while + creating a zip file. + REST API -------- diff -r 462b8f8a619c -r c80dbbae3f60 OrthancFramework/Sources/Compression/ZipWriter.cpp --- a/OrthancFramework/Sources/Compression/ZipWriter.cpp Mon Apr 22 10:39:33 2024 +0200 +++ b/OrthancFramework/Sources/Compression/ZipWriter.cpp Mon Apr 22 10:50:33 2024 +0200 @@ -553,7 +553,7 @@ if (!pimpl_->file_) { throw OrthancException(ErrorCode_CannotWriteFile, - "Cannot create new ZIP archive: " + path_); + "Cannot create new ZIP archive"); // we do not log the path anymore since it can contain PHI } } } @@ -632,10 +632,10 @@ compressionLevel_); } - if (result != 0) + if (result != ZIP_OK) { throw OrthancException(ErrorCode_CannotWriteFile, - "Cannot add new file inside ZIP archive: " + std::string(path)); + "Cannot add new file inside ZIP archive - error code = " + boost::lexical_cast(result)); // we do not log the path anymore since it can contain PHI } hasFileInZip_ = true; @@ -666,10 +666,11 @@ { int bytes = static_cast(length <= maxBytesInAStep ? length : maxBytesInAStep); - if (zipWriteInFileInZip(pimpl_->file_, p, bytes)) + int result = zipWriteInFileInZip(pimpl_->file_, p, bytes); + if (result != ZIP_OK) { throw OrthancException(ErrorCode_CannotWriteFile, - "Cannot write data to ZIP archive: " + path_); + "Cannot write data to ZIP archive - error code =" + boost::lexical_cast(result)); // we do not log the path anymore since it can contain PHI } p += bytes;