Commit Graph

9937 Commits

Author SHA1 Message Date
Bernhard Miklautz
50649acf47 Merge pull request #3407 from nfedera/enable-tests-on-windows
ci: build tests on windows from now on
2016-06-14 13:57:00 +02:00
Norbert Federa
675ea70e86 ci: build tests on windows from now on 2016-06-14 12:57:30 +02:00
Bernhard Miklautz
0cb37b0db8 Merge pull request #3406 from nfedera/fix-winpr-ntlm
winpr/sspi/ntlm: fix GetComputerNameExA parameters
2016-06-14 12:54:01 +02:00
Norbert Federa
26ed09a14f winpr/sspi/ntlm: fix GetComputerNameExA parameters
On input, the lpnSize [in, out] parameter for GetComputerNameEx()
specifies the total size of the buffer (in characters).
Several functions in ntlm.c were off by one which caused ntlm to fail
if the netbios hostname's strlen was exactly MAX_COMPUTERNAME_LENGTH.
2016-06-14 12:37:37 +02:00
akallabeth
f0bdd62e9c Merge pull request #3404 from nfedera/fix-pathmakepath
winpr: fix PathMakePathA and TestWLog
2016-06-14 10:20:52 +02:00
Norbert Federa
62d73dcb75 winpr: fix PathMakePathA and TestWLog
PathMakePathA:
- This function had an endless loop if no native delimiter was in the string
- Use SHCreateDirectoryExA on Windows
- Replaced old code with a new implementation

TestWLog:
- Windows has no "/tmp" by default
- Use GetKnownPath(KNOWN_PATH_TEMP) for the WLog "outputfilepath"
2016-06-13 19:19:28 +02:00
Bernhard Miklautz
ee4d118beb Merge pull request #3403 from TingPing/freerdp-client.pc
Fix include path in freerdp-client.pc
2016-06-13 10:06:51 +02:00
TingPing
9fe5da8597 Fix include path in freerdp-client.pc 2016-06-12 22:10:00 -04:00
Bernhard Miklautz
f818bab4b6 Merge pull request #3399 from nfedera/fix-winpr-library2
winpr/library: fix GetModuleFileName and tests
2016-06-10 15:08:49 +02:00
Norbert Federa
581c000435 winpr/library: fix GetModuleFileName and tests
- Use correct SetLastError values in GetModuleFileName
- Fix wrong return codes in GetModuleFileName
- Build the TestLibraryA/TestLibraryB libraries always shared and
  put them in the test output directory
- TestLibraryGetModuleFileName always returned success
- Improve TestLibraryGetModuleFileName to also check last error values
  and insufficient buffer sizes
- Change TestLibraryGetProcAddress and TestLibraryLoadLibrary to load
  the TestLibrary from the test executable's directory
2016-06-10 13:12:08 +02:00
Marc-André Moreau
0c8af43153 Merge pull request #3397 from awakecoding/master
add missing inet_pton implementation on Windows
2016-06-08 11:03:40 -04:00
Marc-André Moreau
f905861616 wayk-now: add missing inet_pton implementation on Windows 2016-06-08 10:51:58 -04:00
Bernhard Miklautz
b71f60c26e Merge pull request #3393 from nfedera/fix-winpr-library-wtimer-test
winpr: fix some tests
2016-06-08 11:50:43 +02:00
Hardening
a0520f84a3 Merge pull request #3394 from nfedera/fix-client-x11-locked-mutex
client/x11: don't close locked mutex
2016-06-08 08:21:13 +02:00
Norbert Federa
374f97aad3 client/x11: don't close locked mutex 2016-06-07 19:01:03 +02:00
Norbert Federa
f2c825bb76 winpr: fix some tests
TestNtCreateFile, TestPipeCreateNamedPipeOverlapped
- These tests are currently only expected to succeed on _WIN32
- Also reflect the reverse meaning of this fact in the return values

TestSynchWaitableTimer, TestSynchWaitableTimerAPC:
- These tests are currently expected to fail on __APPLE__
- Also reflect the reverse meaning of this fact in the return values

This logic makes sure that we don't forget to fix the tests if the
corresponding WinPR implementations are fixed.

TestLibrary:
- TestLibraryA and TestLibraryB must always get built as shared libraries
2016-06-07 17:20:56 +02:00
MartinHaimberger
0abb285c3d Merge pull request #3392 from nfedera/fix-winpr-barrier-deadlock
winpr/synch: fix barrier deadlock in release build
2016-06-07 15:33:49 +02:00
Norbert Federa
f969e60a53 winpr/synch: fix barrier deadlock in release build
Let the compiler know that we're comparing a volatile value.
Otherwise the compiler might nuke the comparison operation
and produce code that will spin endlessly.
2016-06-07 13:06:50 +02:00
Bernhard Miklautz
aa15327a3a Merge pull request #3391 from nfedera/fix-initializewaitabletimer-result
winpr/synch: fix InitializeWaitableTimer result
2016-06-07 09:34:12 +02:00
Norbert Federa
a35a1e3d9b winpr/synch: fix InitializeWaitableTimer result
InitializeWaitableTimer must not reported success if the operating
sytem does not provide the required functionality.
2016-06-06 23:06:12 +02:00
Norbert Federa
6e15931a52 Merge pull request #3390 from nfedera/fix-winpr-barrier2
winpr/synch: improve barrier test
2016-06-06 16:21:39 +02:00
Norbert Federa
131ffaa89b winpr/synch: improve barrier test
The SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY flag caused this test
to run extremely long if the system has very few processors.
Although this is expected (thread starvation) this will cause a
intolerably long execution time for automated tests.
Changed the number of threads to be calculated dyamically based
on the number of processors.
Also do proper cleanup to prevent memory leaks.
2016-06-06 15:41:05 +02:00
Bernhard Miklautz
bd71b3685b Merge pull request #3388 from nfedera/fix-winpr-pool-synch
winpr: several pool and synch fixes
2016-06-06 13:54:39 +02:00
Bernhard Miklautz
11ecda2ef3 Merge pull request #3386 from nfedera/fix-winpr-barrier
winpr/synch: rewrite barrier implementation & test
2016-06-06 13:44:48 +02:00
Bernhard Miklautz
a24d1fd4c7 Merge pull request #3389 from nfedera/fix-winpr-synch-timer-queue-segfault
winpr/synch: fix timerqueue segfault
2016-06-06 13:39:36 +02:00
Norbert Federa
e35049c20e winpr/synch: fix timerqueue segfault
The current experimental/incomplete WinPR timer queue implementation
has several race conditions.
This commit fixes a segfault caused by not unklinking freed timers
from the timer queue timers list.
2016-06-06 13:24:04 +02:00
akallabeth
8c4f3ba165 Merge pull request #3387 from nfedera/fix-wfreerdp-verify-cert-callback
wfreerdp: fix invalid VerifyCertificate callback
2016-06-06 09:23:41 +02:00
Norbert Federa
882f593328 wfreerdp: fix invalid VerifyCertificate callback 2016-06-04 17:13:07 +02:00
Norbert Federa
c16bee759f winpr: several pool and synch fixes
pool:
- the winpr implementation fallback was not used on older windows editions
- drop useless and conflicting TP_CALLBACK_ENVIRON_V3
- fix race conditions by using use proper one-time initialization
- on win32 WinPR tried to load several pool/callback_environment functions
  from kernel32.dll but since these are defined as inline functions in the
  windows headers, no windows edition has ever exported them in any dll.
- removed callback_environment.c and added corresponding static inline
  function to pool.h
- fix segfault in TestPoolWork: CloseThreadpoolWork() must not be called
  if there is a cleanup group associated with the work object since calling
  CloseThreadpoolCleanupGroupMember() already releases the work object

sync:
- The windows headers incorrectly define InitializeCriticalEx support if
  _WIN32_WINNT >= 0x0403 instead of >= 0x0600 (Vista)
- created a compatible define to deal with this issue
2016-06-04 17:09:48 +02:00
Norbert Federa
2dba082587 winpr/synch/barrier: fix return value and test
- According to the msdn docs DeleteSynchronizationBarrier always returns TRUE
- Added additional error checks to the barrier test
2016-06-04 13:40:01 +02:00
Norbert Federa
85f44262de winpr/synch: add spinning support to barrier
Implemented the SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY and
SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY flags.
2016-06-04 00:55:27 +02:00
Norbert Federa
341eed138f winpr/synch: rewrite barrier implementation & test
The synchronization barrier test as well as the actual WinPR
implementation were completely broken.
2016-06-03 18:56:36 +02:00
Bernhard Miklautz
8ea8b7c780 Merge pull request #3381 from nfedera/fix-winpr-misc
fix race conditions, tests and some invalid return values
2016-06-03 18:53:14 +02:00
Norbert Federa
458f606934 winpr/thread: fix SwitchToThread
On some operating systems sched_yield is a stub returning returning -1.
In that case use usleep which should at least trigger a context switch
if any thread is waiting.
2016-06-02 15:38:57 +02:00
Bernhard Miklautz
215e7b5562 Merge pull request #3382 from giox069/master
Fix some memory leaks in freerdp_settings_free()
2016-06-02 10:49:42 +02:00
Giovanni Panozzo
01a8db2c17 Fix some memory leaks in freerdp_settings_free() 2016-06-02 10:23:28 +02:00
Norbert Federa
e718fb324b fix race conditions, tests and some invalid return values
Since the current winpr implementation for overlapped operations is
incomplete and buggy, all affected functions will now fail if they are
called with a set FILE_FLAG_OVERLAPPED flag or a non-null pointer to
a OVERLAPPED structure.

winpr/nt:
- use proper one-time initialization on win32
- fix TestNtCreateFile
- fix broken/incomplete _RtlAnsiStringToUnicodeString
- unimplemented functions return appropriate error codes

winpr/pipe:
- improved TestPipeCreateNamedPipe
- rewrite the completely broken TestPipeCreateNamedPipeOverlapped test

rdtk:
- improve test and don't blindly return success

winpr/synch:
- fix race condition in TestSynchTimerQueue

winpr/ssspi:
- fix TestEnumerateSecurityPackages printf output
- fix TestQuerySecurityPackageInfo printf output

winpr/environment:
- fix GetEnvironmentStrings printf output

winpr/comm:
- unimplemented functions return appropriate error codes

winpr/io:
- unimplemented functions return appropriate error codes

winpr/thread:
- implement SwitchToThread() via sched_yield()
2016-06-01 16:26:26 +02:00
Norbert Federa
42d2b69de3 Merge pull request #3379 from nfedera/fix-winpr-wtsapi
winpr/wtsapi: fixed race conditions and tests
2016-05-31 09:41:09 +02:00
akallabeth
345478bd8e Merge pull request #3376 from realjiangms/fix_client_gfx
channels/rdpgfx: Fix for gfx client
2016-05-31 09:37:31 +02:00
Bernhard Miklautz
9daf129c63 Merge pull request #3371 from realjiangms/fix_x11_shadow_race
Server/shadow: Protect X operations on shared subystem X11 display with X11 display lock
2016-05-30 19:25:20 +02:00
Norbert Federa
c6aeba6a67 winpr/wtsapi: fixed race conditions and tests 2016-05-30 17:54:59 +02:00
MartinHaimberger
69f738f4bc Merge pull request #3377 from nfedera/fix-channel-name-parsing
freerdp/core/gcc: channel name hardening
2016-05-30 14:59:34 +02:00
Norbert Federa
7a42a8dd5b freerdp/core/gcc: channel name hardening
According to [MS-RDPBCGR 2.2.1.3.4.1 Channel Definition Structure]
the channel name must be an 8-byte array containing a null-terminated
collection of seven ANSI characters that uniquely identify the channel.

We did not check if the transmitted name was null-terminated which
could have the usual severe effects on stabiliy and security since
the channel name is used in several functions expecting a null-
terminated string (strlen, printf, etc.)
2016-05-30 14:40:23 +02:00
Bernhard Miklautz
ca03b510ac Merge pull request #3375 from nfedera/fix-sizet-format-segfaults
fix segfaults casused by size_t format specifier
2016-05-30 13:00:32 +02:00
zihao.jiang
e7d9e91864 channels/rdpgfx: Make freerdp_client_codecs_prepare calls codec reset. It fix broken h264 client from #3328. Also it doesn't make sense that we don't need width and height for codec initialization while we need them for codec reset 2016-05-30 02:00:05 +08:00
Norbert Federa
e8c4910e2e fix segfaults casused by size_t format specifier
win32/msvc cc does not recognize the %z format specifier which caused
invalid references and segfaults on win32.
Until FreeRDP gets format specifier macros we'll cast size_t to
unsigned long and use the %lu specifier.

Also simplified winpr_backtrace_symbols() a little bit and fixed it
to allocate the correct amount of bytes for the return buffer.
2016-05-27 15:55:28 +02:00
Hardening
00dd6f8c51 Merge pull request #3372 from nfedera/fix-winpr-test-library
winpr/library: fix win32 test and some cleanup
2016-05-27 14:53:12 +02:00
Norbert Federa
d2b2a921f1 winpr/library: fix win32 test and some cleanup
On Windows we seem to have to load the TestLibrary[AB] test libraries
from in same folder the test executable runs.

Also removed the empty RemoveDllDirectory, SetDefaultDllDirectories,
AddDllDirectory tests and the redundant FreeLibrary test.

TestLibrary now works and succeeds on Win32.

sadasd
2016-05-27 14:34:41 +02:00
Hardening
9f37f46b66 Merge pull request #3374 from nfedera/fix-winpr-path
winpr/path: fix PathCchFindExtensionA and more
2016-05-27 11:19:50 +02:00
Norbert Federa
a45ac8dad8 winpr/path: fix PathCchFindExtensionA and more
- PathCchFindExtensionA had an off-by-one error when verifying the
  required null termination
- TestPathCchFindExtension used unicode strings when testing the
  *A (ASCII) functions
- The PathAllocCombineW implementation (which is still buggy has
  hell) used strlen to calculate the lenght of unicode strings

TestPath now succeeds on WIN32
2016-05-26 18:36:02 +02:00