Skip to content

Commit 9b9ca55

Browse files
committed
Fix returning null from KerberosUsernameProvider.GetUsername with concurrent calls (#6137)
Fixes #6136 (cherry picked from commit e3921f2)
1 parent 9b2b2bc commit 9b9ca55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Npgsql/KerberosUsernameProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace Npgsql;
1111
/// Launches MIT Kerberos klist and parses out the default principal from it.
1212
/// Caches the result.
1313
/// </summary>
14-
sealed class KerberosUsernameProvider
14+
static class KerberosUsernameProvider
1515
{
16-
static bool _performedDetection;
16+
static volatile bool _performedDetection;
1717
static string? _principalWithRealm;
1818
static string? _principalWithoutRealm;
1919

0 commit comments

Comments
 (0)