Skip to content

Commit

Permalink
Apply suggestions from code review (LOG)
Browse files Browse the repository at this point in the history
Co-authored-by: Luc Guyot <162997198+luc-guyot-infomaniak@users.noreply.github.com>
  • Loading branch information
herve-er and luc-guyot-infomaniak authored Apr 25, 2024
1 parent dd6b5a0 commit d35a39f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/libcommonserver/io/iohelper_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static bool setRightsWindowsApi(const SyncPath &path, DWORD permission, ACCESS_M

if (ValueReturned != ERROR_SUCCESS) {
ioError = dWordError2ioError(ValueReturned);
LOG_WARN(logger, L"Error in GetNamedSecurityInfo: " << Utility::formatSyncPath(path).c_str() << L" error="
LOGW_WARN(logger, L"Error in GetNamedSecurityInfo: " << Utility::formatIoError(path, ioError).c_str());
<< IoHelper::ioError2StdString(ioError).c_str());
LocalFree(pSecurityDescriptor);
LocalFree(pACL_new);
Expand All @@ -370,7 +370,7 @@ static bool setRightsWindowsApi(const SyncPath &path, DWORD permission, ACCESS_M
ValueReturned = SetEntriesInAcl(1, &ExplicitAccess, pACL_old, &pACL_new);
if (ValueReturned != ERROR_SUCCESS) {
ioError = dWordError2ioError(ValueReturned);
LOG_WARN(logger, L"Error in SetEntriesInAcl: " << Utility::formatSyncPath(path).c_str() << L" error="
LOGW_WARN(logger, L"Error in SetEntriesInAcl: " << Utility::formatIoError(path, ioError).c_str());
<< IoHelper::ioError2StdString(ioError).c_str());
LocalFree(pSecurityDescriptor);
LocalFree(pACL_new);
Expand All @@ -380,7 +380,7 @@ static bool setRightsWindowsApi(const SyncPath &path, DWORD permission, ACCESS_M

if (!IsValidAcl(pACL_new)) {
ioError = IoErrorUnknown;
LOG_WARN(logger, L"Invalid ACL: " << Utility::formatSyncPath(path).c_str());
LOGW_WARN(logger, L"Invalid ACL: " << Utility::formatSyncPath(path).c_str());

LocalFree(pSecurityDescriptor);
LocalFree(pACL_new);
Expand All @@ -391,7 +391,7 @@ static bool setRightsWindowsApi(const SyncPath &path, DWORD permission, ACCESS_M
ValueReturned = SetNamedSecurityInfo(pathw, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, nullptr, nullptr, pACL_new, nullptr);
if (ValueReturned != ERROR_SUCCESS) {
ioError = dWordError2ioError(ValueReturned);
LOG_WARN(logger, L"Error in SetNamedSecurityInfo: " << Utility::formatSyncPath(path).c_str() << L" error="
LOGW_WARN(logger, L"Error in SetNamedSecurityInfo: " << Utility::formatIoError(path, ioError).c_str());
<< IoHelper::ioError2StdString(ioError).c_str());
LocalFree(pSecurityDescriptor);
LocalFree(pACL_new);
Expand Down Expand Up @@ -437,7 +437,7 @@ bool IoHelper::getRights(const SyncPath &path, bool &read, bool &write, bool &ex
LOGW_INFO(logger(), L"Access denied - path=" << szFilePath);
}

LOGW_WARN(logger(), L"Error in GetNamedSecurityInfoW - path=" << szFilePath << L" result=" << result);
LOGW_WARN(logger(), L"Error in GetNamedSecurityInfoW:" << Utility::formatSyncPath(path).c_str() << L" result=" << result);
return _isExpectedError(ioError);
}

Expand Down Expand Up @@ -484,7 +484,7 @@ bool IoHelper::getRights(const SyncPath &path, bool &read, bool &write, bool &ex
}
if (!readCtrl) {
ioError = IoErrorAccessDenied;
LOGW_INFO(logger(), L"Access denied - path=" << szFilePath);
LOGW_INFO(logger(), L"Access denied : " << Utility::formatSyncPath(path).c_str());
return _isExpectedError(ioError);
}
}
Expand Down

0 comments on commit d35a39f

Please sign in to comment.