Commit Graph

3419 Commits

Author SHA1 Message Date
Armin Novak
ff8c47b1fc [winpr,utils] do not log command line arguments
Only builds with -DWITH_DEBUG_UTILS_CMDLINE_DUMP=ON will dump the
command line argument that failed during parsing to the log.
2025-07-09 12:26:44 +02:00
Armin Novak
45b3cbf120 [winpr,utils] Add escaped quote support
In CommandLineParseCommaSeparatedValues[Ex] now escaped characters are
respected, so a single quote in a string does not break parsing.
2025-07-09 09:55:57 +02:00
David Fort
20686345da kerberos: do various tries for TGT retrieval in u2u
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.
2025-07-03 14:28:49 +02:00
David Fort
6e7f5c6355 negotiate: add user2user filtering
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).
2025-07-02 10:01:57 +02:00
Armin Novak
07e39ede20 [winpr,file] Add winpr_CreateFile wrapper
Allows creation of a file HANDLE from a utf-8 name
2025-06-05 11:58:47 +02:00
Armin Novak
b5b258c9f4 [winpr,path] fix NULL arguments for DeleteFile 2025-06-05 11:58:47 +02:00
Armin Novak
f1fa7b56c2 [winpr,file] add GetLogicalDriveStrings[A|W] 2025-06-05 11:58:47 +02:00
Armin Novak
bcbf72ea99 [winpr,path] fix windows unicode paths 2025-06-05 11:58:47 +02:00
akallabeth
78a8dbfcbb [winpr,file] handle FILE_ATTRIBUTE_NORMAL in SetFileAttributesA 2025-06-02 20:13:17 +02:00
akallabeth
fc5198e5a6 [winpr,file] improve errno to lasterror mapping 2025-05-27 16:27:46 +02:00
akallabeth
022871969c [winpr,timezone] use new JSON config reader 2025-05-26 19:36:40 +02:00
akallabeth
aadc257ecd [utils,json] add functions to read from file 2025-05-26 19:36:40 +02:00
Yixue Wang
e444ce53d7 [stream] reset pool array size after clearing
StreamPool becomes inconsistent after clearing. This might be a
problem in some critical situation. Reset pool array size after
clearing.
2025-05-26 14:27:14 +08:00
akallabeth
34ab0b893d [warnings] fix clang-tidy warnings 2025-05-23 15:29:31 +02:00
akallabeth
135fdb0b9c [winpr,sspi] fix realm usage for Heimdal
Fix retrieval of realm name from krb5_principal::realm
* MIT krb5 uses type krb5_data
* Heimdal krb5 uses type Realm
2025-05-16 11:06:17 +02:00
akallabeth
c1be9cb001 [winpr,sspi] add kerberos string len checks 2025-05-15 21:39:30 +02:00
akallabeth
1ba91069ce [cmake,winpr] set policy CMP0177 2025-05-13 09:21:57 +02:00
akallabeth
330f9b1b20 [winpr,file] fix strcat warning 2025-05-09 10:26:22 +02:00
akallabeth
f3de09a03c [winpr,file] fix wrong status code 2025-05-09 09:09:50 +02:00
akallabeth
1aa4566cbd [winpr,file] add TestFileWriteFile testcase 2025-05-08 07:53:30 +02:00
ljh0121
2a7f7c0249 feat:add FileFlushFileBuffers 2025-05-08 11:21:26 +09:00
lazy5f
05326f15b6 [winpr,file] Fix assert fail always when removing flags 2025-04-29 07:58:34 +09:00
akallabeth
4840c9d4ae [winpr,stream] fill up empty stream
In Stream_Write_UTF16_String_From_UTF8 fill up WCHAR if requested even
for empty source strings
2025-04-28 17:09:12 +02:00
Mark Nauwelaerts
b7a2eecaa1 [winpr,sysinfo] use a single clock to provide System and Local time
... rather than a different one for second and sub-second part
2025-04-22 21:01:54 +02:00
Armin Novak
a4c4bad132 [common,settings] new settings (de)serialization API
* Add rdpKey to PEM conversion
* Modify WINPR_JSON_Version to return -1 if not supported
* Add rdpSettings serialize and deserialize functions
2025-04-22 12:00:48 +02:00
lazy5f
706110ef4e [winpr] Put '\0' when converting empty string to wstr 2025-04-20 18:06:15 +09:00
akallabeth
897012052a Merge pull request #11491 from akallabeth/unwind-ignore
[winpr,utils] ignore _Unwind_Backtrace return
2025-04-11 08:26:18 +02:00
akallabeth
c97fb38a4f [winpr,utils] ignore _Unwind_Backtrace return
See https://github.com/FreeRDP/FreeRDP/issues/11490
there is no consensus on what the return value should be, so warn but
ignore it. The context might contain a NULL stack trace, but that is
better than not to show anything.
2025-04-11 08:17:01 +02:00
akallabeth
9cd3ffa843 Update timezone definitions 2025-04-11 05:06:20 +00:00
Armin Novak
6877cf5d25 [winpr,smartcard] PCSC_SCardGetAttrib support NULL buffer
In case of NULL buffer return success with required length
2025-04-09 10:21:59 +02:00
Armin Novak
462051dfec [winpr,smartcard] fix SCARD_ATTR_DEVICE_FRIENDLY_NAME_[AW]
* Include terminating '\0' in length
* Properly return SCARD_S_SUCCESS if only length is requested
2025-04-09 09:54:17 +02:00
akallabeth
5dc8d203f8 [winpr,smartcard] fix SCARD_ATTR_VENDOR_NAME length 2025-04-09 09:09:12 +02:00
David Fort
419f469583 kerberos: fix server-side user2user
In user to user mode the requested name is something like TERMSRV/<host>@<realm>,
but we can request a TGT only for <host>$@<realm> as it's the only account that
we have in our keytab that can do it. So this patch fix the research in the keytab, and
retrieves the TGT using <host>$@<realm> instead of TERMSRV/<host>@<realm>. That
fixes NLA server-side with kerberos users2user.
2025-03-31 23:03:15 +02:00
David Fort
9fd97beb23 ncrypt_pkcs11: remove verbose unneeded log 2025-03-31 11:15:52 +02:00
akallabeth
99619b3392 [warnings] fix stringlength checks 2025-03-26 20:08:13 +01:00
akallabeth
c06bf6ccb0 [warnings] fix format warnings 2025-03-24 21:23:10 +01:00
akallabeth
cd682e2c1b [winpr,file] create global instance for GetStdHandle 2025-03-20 17:03:06 +01:00
akallabeth
56432b902c [winpr,pipe] fix handle clean up
if pipe creation fails ensure all resources are cleaned up
2025-03-20 17:02:54 +01:00
akallabeth
34f6927c12 Merge pull request #11369 from akallabeth/sdl3-clip-png
Sdl3 clip png
2025-03-20 09:06:38 +01:00
Armin Novak
e4df43a37a [freerdp] fix argument consistency, casts 2025-03-19 19:32:09 +01:00
Armin Novak
b14f9e8965 [winpr] refactor complex expressions
* avoid unnecessary casts
2025-03-19 19:00:09 +01:00
akallabeth
32cc0f0927 [winpr,utils] fix PNG and BMP image creation
properly adjust for stride alignments
2025-03-19 12:49:10 +01:00
akallabeth
299d06c63c [winpr,clipboard] add image to html synthesizers 2025-03-19 12:49:09 +01:00
akallabeth
b53bff5541 [winpr,utils] add test image conversion utility
allows quick testing of image convertsions
2025-03-19 12:12:01 +01:00
akallabeth
253b2b71a2 [winpr,clipboard] add logging to Clipboard[GS]etData 2025-03-14 08:48:57 +01:00
akallabeth
beae583dbd [winpr,clipboard] fix image conversion routines
properly define guard the functions to be available for all combinations
of image formats (un)supported
2025-03-14 08:48:55 +01:00
akallabeth
da049b2f96 [winpr,registry] limit REG_SZ value length
Add a (sensible) upper limit for entries and add a warning should some
value be truncated
2025-03-13 12:18:49 +01:00
akallabeth
d42cdd656d [winpr,utils] limit debug string length 2025-03-13 11:47:14 +01:00
Armin Novak
c79f080e8d [warnings] improve array bound checks 2025-03-12 15:04:38 +01:00
Armin Novak
8fb49b0abe [warnings] fix coverity warnings 2025-03-12 13:44:59 +01:00