Set a default minimum of 4 threads in a pool. Avoids issues with system
running with a single processor (might lead to deadlocks if the code
assumes > 1 thread handling stuff)
Increase the deadlock detection timeout in TestSynchCritical to accommodate
longer runtime on systems with large number of CPUs/threads. The usual test
run time when the threads are finishing correctly won't change.
Fixes: https://github.com/FreeRDP/FreeRDP/issues/11800
The generic WLog_PrintMessage(VA) functions lack proper checks of the
supplied format strings.
Add WLog_PrintTextMessage(VA) functions that do compile time checks of
supplied format strings to uncover usage errors early and use them in
the logger macros.
The cast works best if you don't imply another conversion to a
temporary. Just return the value directly from the syscall/pthreads
call, while casting to a DWORD.
macOS uses a 64-bit thread ID, so rather than truncate this in
GetCurrentThreadId, use pthread_self's result and mix it with the MSBs
of the pointer to reduce the probability of a collision.
Truncating 64-bit thread IDs to 32-bits can result in collisions on
systems with large numbers of CPUs. GetCurrentThreadId() does this, and
there are fairly easy to reproduce collisions on systems with ~128 CPU
cores.
The `GetCurrentThreadId` API should wrap an OS-specific way of providing
the current thread ID. Keep the XOR-folded pointer as a fallback for
OSes which aren't explicitly supported.
This fixes failures in TestSynchCritical that are readily reproducible
on such systems..
Tested on FreeBSD 14.3 and various Linux variants on x86_64.
The credential module from FreeRDP2 was removed, but sometime you still need to
have support for Cred[Marshal|Unmarshal]Credential especially when it's a
smartcard logon and that the cert sha1 is encoded using these functions.
In a server-side user2user scenario, you can have either a configuration with
a service mapped to a user or something host based. So your keytab will contain
either a TERMSRV/<host>@<realm> entry that is able to retrieve a TGT, or the
machine account associated with <host>$@<realm>.
This patch makes the kerberos SSPI first try to retrieved a TGT as if it was
a service mapped to a user. And if it doesn't work (or if the entry is missing),
it goes for a host based attempt.
This patch adds the possibility to disable kerberos user2user in the SPnego SSPI
module, so you can set "!u2u" in the authPackageList to disable user2user kerberos.
It also does a few cleanups (FALSE instead of 0, and defaulting to no kerberos when
kerberos support is not compiled in).