Skip to content

Commit 9f34905

Browse files
committed
Merge branch 'master' into work/listagg
2 parents 640b352 + c8def89 commit 9f34905

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1150
-1140
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ if (MINGW)
204204
set(CMAKE_SHARED_MODULE_PREFIX)
205205
set(CMAKE_STATIC_LIBRARY_PREFIX)
206206

207-
add_definitions(-D_WIN32_WINNT=0x0600)
207+
# 0x0601 is Windows 7 - see also comments in autoconfig_msvc.h
208+
add_definitions(-D_WIN32_WINNT=0x0601)
208209
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4 -std=c++20")
209210
endif()
210211

builds/win32/msvc15/FirebirdCommon.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<CompileAs>Default</CompileAs>
2828
<UseFullPaths>false</UseFullPaths>
2929
<MultiProcessorCompilation>true</MultiProcessorCompilation>
30-
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
30+
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
3131
<TreatSpecificWarningsAsErrors>4715</TreatSpecificWarningsAsErrors>
3232
</ClCompile>
3333
<Link>

builds/win32/msvc15/common.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
<ClInclude Include="..\..\..\src\common\utils_proto.h" />
237237
<ClInclude Include="..\..\..\src\common\xdr.h" />
238238
<ClInclude Include="..\..\..\src\common\xdr_proto.h" />
239+
<ClInclude Include="..\..\..\src\include\fb_exception.h" />
239240
<ClInclude Include="..\..\..\src\include\firebird\impl\dsc_pub.h" />
240241
</ItemGroup>
241242
<PropertyGroup Label="Globals">

builds/win32/msvc15/common.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,5 +623,8 @@
623623
<ClInclude Include="..\..\..\src\include\firebird\impl\dsc_pub.h">
624624
<Filter>headers</Filter>
625625
</ClInclude>
626+
<ClInclude Include="..\..\..\src\include\fb_exception.h">
627+
<Filter>headers</Filter>
628+
</ClInclude>
626629
</ItemGroup>
627630
</Project>

builds/win32/msvc15/instclient.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@
254254
<ClCompile Include="..\..\..\src\utilities\install\install_client.cpp" />
255255
</ItemGroup>
256256
<ItemGroup>
257+
<ClInclude Include="..\..\..\src\utilities\install\install_nt.h" />
257258
<ClInclude Include="..\..\..\src\utilities\install\install_proto.h" />
258259
</ItemGroup>
259260
<ItemGroup>
@@ -269,4 +270,4 @@
269270
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
270271
<ImportGroup Label="ExtensionTargets">
271272
</ImportGroup>
272-
</Project>
273+
</Project>

builds/win32/msvc15/instclient.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
<ClInclude Include="..\..\..\src\utilities\install\install_proto.h">
2626
<Filter>Header files</Filter>
2727
</ClInclude>
28+
<ClInclude Include="..\..\..\src\utilities\install\install_nt.h">
29+
<Filter>Header files</Filter>
30+
</ClInclude>
2831
</ItemGroup>
2932
<ItemGroup>
3033
<ResourceCompile Include="..\..\..\src\jrd\version.rc">

doc/README.trace_services

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Connection parameters switches :
8787
-U[SER] <string> User name
8888
-P[ASSWORD] <string> Password
8989
-FE[TCH] <string> Fetch password from file
90-
-T[RUSTED] <string> Force trusted authentication
90+
-T[RUSTED] Force trusted authentication
9191

9292
Also, it prints usage screen if run without parameters.
9393

extern/libcds/projects/Win/vc141/cds.vcxproj

Lines changed: 24 additions & 24 deletions
Large diffs are not rendered by default.

src/auth/SecureRemotePassword/srp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ class RemotePassword : public Firebird::GlobalStorage
103103
virtual ~RemotePassword();
104104

105105
static const char* plugName;
106-
static const unsigned SRP_KEY_SIZE = 128;
107-
static const unsigned SRP_VERIFIER_SIZE = SRP_KEY_SIZE;
108-
static const unsigned SRP_SALT_SIZE = 32;
106+
static constexpr unsigned SRP_KEY_SIZE = 128;
107+
static constexpr unsigned SRP_VERIFIER_SIZE = SRP_KEY_SIZE;
108+
static constexpr unsigned SRP_SALT_SIZE = 32;
109109

110110
static Firebird::string pluginName(unsigned bits);
111111

src/auth/trusted/AuthSspi.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ namespace
4141
Firebird::SimpleFactory<Auth::WinSspiClient> clientFactory;
4242
Firebird::SimpleFactory<Auth::WinSspiServer> serverFactory;
4343

44-
const char* plugName = "Win_Sspi";
44+
constexpr const char* plugName = "Win_Sspi";
4545

46-
void makeDesc(SecBufferDesc& d, SecBuffer& b, FB_SIZE_T len, void* p)
46+
void makeDesc(SecBufferDesc& d, SecBuffer& b, FB_SIZE_T len, void* p) noexcept
4747
{
4848
b.BufferType = SECBUFFER_TOKEN;
4949
b.cbBuffer = len;
@@ -57,7 +57,7 @@ namespace
5757
ToType getProc(HINSTANCE lib, const char* entry)
5858
{
5959
FARPROC rc = GetProcAddress(lib, entry);
60-
if (! rc)
60+
if (!rc)
6161
{
6262
LongJump::raise();
6363
}
@@ -70,21 +70,21 @@ namespace Auth {
7070

7171
static thread_local bool legacySSP = false;
7272

73-
void setLegacySSP(bool value)
73+
void setLegacySSP(bool value) noexcept
7474
{
7575
legacySSP = value;
7676
}
7777

7878

7979
HINSTANCE AuthSspi::library = 0;
8080

81-
bool AuthSspi::initEntries()
81+
bool AuthSspi::initEntries() noexcept
8282
{
83-
if (! library)
83+
if (!library)
8484
{
8585
library = LoadLibrary("secur32.dll");
8686
}
87-
if (! library)
87+
if (!library)
8888
{
8989
return false;
9090
}
@@ -136,7 +136,7 @@ AuthSspi::~AuthSspi()
136136
}
137137
}
138138

139-
const AuthSspi::Key* AuthSspi::getKey() const
139+
const AuthSspi::Key* AuthSspi::getKey() const noexcept
140140
{
141141
if (sessionKey.hasData())
142142
return &sessionKey;
@@ -152,6 +152,7 @@ bool AuthSspi::checkAdminPrivilege()
152152
{
153153
return false;
154154
}
155+
fb_assert(spc.AccessToken);
155156

156157
// Query required buffer size
157158
DWORD token_len = 0;
@@ -187,7 +188,6 @@ bool AuthSspi::checkAdminPrivilege()
187188
bool matched = false;
188189
char groupName[256];
189190
char domainName[256];
190-
DWORD dwAcctName = 1, dwDomainName = 1;
191191
SID_NAME_USE snu = SidTypeUnknown;
192192

193193
groupNames.clear();
@@ -200,8 +200,9 @@ bool AuthSspi::checkAdminPrivilege()
200200
if ((ptg->Groups[i].Attributes & SE_GROUP_ENABLED) &&
201201
!(ptg->Groups[i].Attributes & SE_GROUP_USE_FOR_DENY_ONLY))
202202
{
203-
DWORD dwSize = 256;
204-
if (LookupAccountSid(NULL, ptg->Groups[i].Sid, groupName, &dwSize, domainName, &dwSize, &snu) &&
203+
DWORD dwGroupName = sizeof(groupName);
204+
DWORD dwDomainName = sizeof(domainName);
205+
if (LookupAccountSid(NULL, ptg->Groups[i].Sid, groupName, &dwGroupName, domainName, &dwDomainName, &snu) &&
205206
domainName[0] && strcmp(domainName, "NT AUTHORITY"))
206207
{
207208
string sumName = domainName;
@@ -246,7 +247,7 @@ bool AuthSspi::request(AuthSspi::DataHolder& data)
246247

247248
ULONG fContextAttr = 0;
248249

249-
SECURITY_STATUS x = fInitializeSecurityContext(
250+
const SECURITY_STATUS x = fInitializeSecurityContext(
250251
&secHndl, hasContext ? &ctxtHndl : 0, 0, 0, 0, SECURITY_NATIVE_DREP,
251252
hasContext ? &inputDesc : 0, 0, &ctxtHndl, &outputDesc, &fContextAttr, &timeOut);
252253

@@ -308,7 +309,7 @@ bool AuthSspi::accept(AuthSspi::DataHolder& data)
308309
ULONG fContextAttr = 0;
309310
SecPkgContext_Names name;
310311
SecPkgContext_SessionKey key;
311-
SECURITY_STATUS x = fAcceptSecurityContext(
312+
const SECURITY_STATUS x = fAcceptSecurityContext(
312313
&secHndl, hasContext ? &ctxtHndl : 0, &inputDesc, 0,
313314
SECURITY_NATIVE_DREP, &ctxtHndl, &outputDesc,
314315
&fContextAttr, &timeOut);

0 commit comments

Comments
 (0)