Commit Graph

2778 Commits

Author SHA1 Message Date
Marc-André Moreau
32264b90cc add WITH_UNICODE_BUILTIN option to use built-in UTF conversion functions 2023-04-18 16:51:08 -04:00
Armin Novak
4408521421 [winpr,sspi] match SEC_WINNT_AUTH_IDENTITY integer
windows defines them with ULONG which does not match UINT32, so keep
these types proper
2023-04-11 11:37:09 +02:00
Armin Novak
13c025e04c [winpr,sspi] remove sspi_SetAuthIdentityWithUnicodePassword
the function is useless as we always use the SetAuthIdentityW API now
2023-04-11 11:37:09 +02:00
Rubycat
207d886a90 Unique kerberos ccaches for parallel connections.
The "MEMORY" ccache is shared in a process.
If a client uses it to make parallel connections,
the same ccache may be used for several clients with distinct
credentials.
To prevent such sharing we create a unique, dedicated ccache when
necessary with krb5_cc_new_unique.

We should destroy the ccaches we created, to avoid leaks.

The struct KRB_CREDENTIALS is extended to express the ccache ownership.
2023-04-07 11:21:12 +02:00
Rubycat
cec88e53bd don't log an error when running GetCurrentThread from non winpr thread
Since 7c4a774e4e
this can legitimately happen in WaitForMultipleObjectsEx and is not
actually an error.
2023-04-07 11:03:56 +02:00
akallabeth
efcacda24c [winpr,sspi] do not abort on empty password
sspi_SetAuthIdentityA might be called with empty passwords, do not abort
under these conditions.
2023-04-06 12:11:46 +02:00
Armin Novak
947bc7fe04 [winpr] added Win32ErrorCode2Tag 2023-04-05 10:02:27 +02:00
akallabeth
37aaa7802a [winpr,crt] added winpr_aligned_calloc 2023-03-28 11:34:52 +02:00
akallabeth
e8fbac14cc [winpr,shell] log when a known path is NULL
* Add GetKnownPathIdString to get a string representation of the known
  path ID requested
* Added a log message if a requested path is NULL
2023-03-24 08:42:40 +01:00
akallabeth
2f17622f65 [cmake] link PUBLIC for static builds 2023-03-16 10:58:01 +01:00
akallabeth
69b4898b73 [winpr,clipboard] fix wrong return check 2023-03-15 08:22:23 +01:00
akallabeth
41cb69b135 [winpr,stream] fix Stream_Read_UTF16_String
Fix wrong arguments for stream length check
2023-03-09 11:17:37 +01:00
Armin Novak
3d8cb485f4 [warnings] Fixed strict-prototypes warnings 2023-03-06 10:04:59 +01:00
Armin Novak
9a7432d23c [winpr,stream] log Stream_Read_UTF16_String failures 2023-03-06 08:35:24 +01:00
Armin Novak
e129ab749b fixed parsing of FILEDESCRIPTORW in WinPR 2023-03-05 17:55:28 +01:00
Armin Novak
9fb4465722 [winpr,clipboard] fix text/uri-list parsing
abort if an empty string remains
2023-03-05 17:55:28 +01:00
David Fort
7c4a774e4e winpr: fix WaitForMultipleObjectsEx(alertable) call from non winpr threads
When WaitForMultipleObjectsEx is called with the alertable flag set from a non
WinPR thread, we shall not try to treat APC, as for sure there is no APC scheduled,
as previous call that would have scheduled such APC would have failed.
2023-03-05 17:10:37 +01:00
Armin Novak
a726fa613a [winpr] improve digest failure logging 2023-03-05 17:03:18 +01:00
Armin Novak
6d0a9b075b [winpr,cynch] WINPR_ASSERT critical section functions 2023-03-01 13:45:13 +01:00
akallabeth
61175a96ea [winpr,clipboard] fixed mate-copied-files
wrong lineending and size fixed
2023-02-28 09:47:54 +01:00
Armin Novak
e1307b90db [winpr,clipboard] fix length of uri list
we overallocate the size, so ensure the result size only contains the
data actually used.
2023-02-28 09:47:54 +01:00
akallabeth
c9e61ff0c5 [cmake] simplify krb5 detection 2023-02-27 11:18:02 +01:00
Armin Novak
acc415442a [winpr] add macros for library options
* compile definitions
* linker options
* cflags
2023-02-27 11:18:02 +01:00
Armin Novak
f4acc88c58 [winpr,clipboard] add getter for clipboard id string 2023-02-23 20:28:15 +01:00
Armin Novak
d8d4d044ff [clipboard] cleanup definitions
* remove definitions for clipboard formats that are dynamically registered
* fix length of converted clipboard string
2023-02-23 20:28:15 +01:00
Armin Novak
9cb28f47ef xxx 2023-02-21 16:42:54 +01:00
Armin Novak
1522b5aa91 xx 2023-02-21 16:42:54 +01:00
Armin Novak
3d3e577190 [winpr,clipboard] fix file list conversion 2023-02-21 16:42:54 +01:00
Armin Novak
53afedf9de [winpr,clipboard] close file after read 2023-02-21 16:42:54 +01:00
Armin Novak
10404121c4 [winpr,clipboard] fix error message format string 2023-02-21 16:42:54 +01:00
Armin Novak
62028f1488 [winpr,file] map EMFILE 2023-02-21 16:42:54 +01:00
akallabeth
2f05166fb1 [winpr,crypto] improve logging 2023-02-03 11:09:59 +01:00
akallabeth
f2b4fa9acc [winpr,sspi] fix const correctness of function argument
sspi_SetAuthIdentityWithUnicodePassword arguments should be const to
avoid compiler warnings if the variable is also const
2023-02-01 09:51:54 +01:00
akallabeth
ee07a13130 [cleanup] fix compiler warnings 2023-01-26 09:30:17 +01:00
Armin Novak
1dc2225bd2 [winpr,wlog] include function name in log message
default to print the function the log message was called from
2023-01-25 16:26:39 +01:00
Armin Novak
641022b795 [logging] remove __FUNCTION__ from actual message
prefer the log formatter to provide that information.
2023-01-25 16:26:39 +01:00
akallabeth
de40b43037 [winpr,stream] modify logging stream length checks
* Split length argument to nmemb and size for all Stream_CheckAndLogRequiredLength* functions
* Add new macros to allow setting nmemb and size arguments
2023-01-25 14:27:32 +01:00
akallabeth
74530a7931 [format strings] ensure __LINE__ is of type size_t
__LINE__ is not particularily well defined (most fall back to int).
We want to ensure that all the uses in a format string match the format
specifier, so do an explicit cast
2023-01-25 14:27:32 +01:00
akallabeth
8ed37e68d2 [stream] use logging capacity checks 2023-01-25 14:27:32 +01:00
akallabeth
b6648288e4 [winpr,stream] add functions to check and log capacity
Add functions (and macros) to provide a method to check the remaining
capacity of a stream and log failures
* Stream_CheckAndLogRequiredCapacityWLog
* Stream_CheckAndLogRequiredCapacityWLogEx
* Stream_CheckAndLogRequiredCapacityWLogExVa
2023-01-25 14:27:32 +01:00
Armin Novak
f62c658e17 [winpr] Make Stream_SafeSeek log a failure 2023-01-24 10:16:55 +01:00
Armin Novak
2d16ab5255 [winpr,sam] fix inalid NULL arguments 2023-01-11 21:37:16 +01:00
Armin Novak
39210d1efd [winpr,sam] allow empty domain in SamLookupUserW 2023-01-11 21:37:16 +01:00
akallabeth
92d3e3c64a [winpr] use WINPR_ prefix for conditional includes 2023-01-10 17:38:00 +01:00
akallabeth
2479ebd816 Fixed compiler warnings 2023-01-10 17:38:00 +01:00
Armin Novak
7a95c7343d [winpr,wlog] fixed noisy wlog filter 2022-12-22 15:09:03 +01:00
akallabeth
784becd946 [winpr,image] add winpr_bitmap_write_ex
Added a helper function writing a bitmap from an image that has a stride
that is not width * <bytes per pixel>
2022-12-16 11:03:13 +01:00
Armin Novak
51e49b4329 [winpr,asn] Fixed a compiler warning
WinPrAsn1DecReadEnumerated expects an argument of type
WinPrAsn1_ENUMERATED* so ensure the variable referenced is of said type.
2022-12-15 14:57:29 +01:00
David Fort
e915b294d5 winpr: add functions to test for read / write availability in pollset 2022-12-13 15:54:33 +01:00
fifthdegree
497ada661f Change the logic flow on error to a better style
Use do-while and break instead of checking return value before every
line
2022-12-13 14:26:45 +01:00