Skip to content

Commit

Permalink
Sentry compliance.
Browse files Browse the repository at this point in the history
  • Loading branch information
herve-er committed Apr 23, 2024
1 parent 556ef05 commit abf61b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libcommonserver/io/iohelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "libcommon/utility/types.h"
#include "libcommonserver/log/log.h"
#ifdef _WIN32
#include <accctrl.h>
#include <AccCtrl.h>
#endif

namespace KDC {
Expand Down
6 changes: 3 additions & 3 deletions src/libcommonserver/io/iohelper_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <shlguid.h>
#include <strsafe.h>
#include <AclAPI.h>
#include <Accctrl.h>
#include <AccCtrl.h>
#define SECURITY_WIN32
#include <security.h>

Expand Down Expand Up @@ -506,7 +506,7 @@ bool IoHelper::_setRightsWindows(const SyncPath &path, DWORD permission, ACCESS_
LPCWSTR pathw_c = Path2WStr(path).c_str();
size_t pathw_len = Path2WStr(path).length();

std::unique_ptr<WCHAR[]> pathw_ptr(new WCHAR[pathw_len + 1]);
std::unique_ptr<WCHAR[]> pathw_ptr = std::make_unique<WCHAR[]>(pathw_len + 1);
Path2WStr(path).copy(pathw_ptr.get(), pathw_len);
LPWSTR pathw = pathw_ptr.get();
pathw[pathw_len] = L'\0';
Expand Down Expand Up @@ -547,7 +547,7 @@ bool IoHelper::_setRightsWindows(const SyncPath &path, DWORD permission, ACCESS_
}

ValueReturned =
SetNamedSecurityInfo((LPWSTR)pathw, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, nullptr, nullptr, pACL_new, nullptr);
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 - path=" << Path2WStr(path).c_str() << L" error="
Expand Down

0 comments on commit abf61b6

Please sign in to comment.