Commit Graph

1348 Commits

Author SHA1 Message Date
Emmanuel Ledoux
f74cd12df2 winpr-thread: a better error message and comments about thread_list 2015-05-26 18:15:57 +02:00
Emmanuel Ledoux
56f34582c7 winpr-thread: added an assertion to enforce that thread_list is correctly set 2015-05-26 17:55:27 +02:00
Emmanuel Ledoux
93127e0a7a winpr-thread: thread_list's synchronization based on an Event 2015-05-26 17:40:34 +02:00
Emmanuel Ledoux
f94ab0033b winpr-thread: better error message upon a failure of TestThreadExitThread 2015-05-22 19:17:30 +02:00
Emmanuel Ledoux
6f5de27081 winpr-thread:
- added the unit test: TestThreadExitThread
  - fix: ensure thread_list to be up to date before to call ExitThread()
  - possibly resolved: Problems with serial redirection #2389
2015-05-22 18:28:10 +02:00
Petr Sumbera
fe5ce30f92 winsock.c Solaris build fixes 2015-05-21 13:24:03 -07:00
Marc-André Moreau
b9c1cddc2e Merge pull request #2583 from bceverly/OpenBSD-cleanup
Two minor source code changes to remove warnings
2015-05-21 10:17:54 -04:00
Norbert Federa
cd0a8e0506 Merge pull request #2630 from hardening/new_2616
Add checks for some XXX_New and XXX_Add functions
2015-05-21 16:04:26 +02:00
David FORT
29d372480a Take in account nfedera's review 2015-05-20 19:19:50 +02:00
Bryan Everly
a3a3efe31e Fixed mistake with bitwise operator in previous two commits 2015-05-20 12:17:05 -04:00
Bryan Everly
80af54b169 Moved thread code to OpenBSD only 2015-05-20 10:52:24 -04:00
Hardening
f8120919af Add checks for some XXX_New and XXX_Add functions
Based on PR #2616
2015-05-18 11:28:00 +02:00
Konrad Witaszczyk
29d3b0bebb QueryContextAttributes shouldn't return an error when a user or a domain
is empty.
2015-05-18 09:42:17 +02:00
Konrad Witaszczyk
95f9e6a641 Pass valid context to CompleteAuthToken function in Negotiate Security Package. 2015-05-15 13:02:40 +02:00
Hardening
75634d460f Merge pull request #2613 from oshogbo/gethostname
At least at FreeBSD - the gethostname(3) function can fail.
2015-05-12 16:18:08 +02:00
Mariusz Zaborski
401152f357 At least at FreeBSD - the gethostname(3) function can fail.
Check returned value.
2015-05-12 15:43:38 +02:00
Mariusz Zaborski
b8c5da138d Function return bool, so lets return FALSE if 0 or TRUE if 1. 2015-05-12 15:40:28 +02:00
Norbert Federa
1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Bernhard Miklautz
d4df3a952b Merge pull request #2594 from baruchsiach/fix-math-2
Don't disable C99 long double math on non Unix platforms
2015-05-08 13:44:26 +02:00
Bernhard Miklautz
81568ff03a Merge pull request #2596 from akallabeth/wlog_default_out_fix
Wlog console output to stderr
2015-05-08 00:49:41 +02:00
Norbert Federa
f9f59cd29b Fix unchecked CreateDirectory calls 2015-05-07 13:28:13 +02:00
Norbert Federa
c77def3048 Fix unchecked CreateMutex calls 2015-05-07 13:27:49 +02:00
Armin Novak
1d3e847f12 Fixed broken indent. 2015-05-06 15:37:55 +02:00
Armin Novak
c0fbaa579b Not writing messages if level is WLOG_OFF. 2015-05-06 10:58:57 +02:00
Armin Novak
c375071b5d Console logging to stdout and stderr
With this patch the default for the console logger
changes to writing to stdout for TRACE, DEBUG and INFO
messages and stderr for WARNING, ERROR and FATAL messages.
2015-05-06 10:56:30 +02:00
Martin Fleisz
063c1bc806 Merge pull request #2592 from nfedera/fix-2015-05-05-01
Fix unchecked CreateThread calls and misc fixes
2015-05-06 10:16:26 +02:00
Baruch Siach
81fc2c9740 Don't disable C99 long double math on non Unix platforms
CMakeLists.txt may enable HAVE_MATH_C99_LONG_DOUBLE only on Unix platforms.
Limit the effect of this symbol accordingly.
2015-05-05 21:27:17 +03:00
Bryan Everly
9865854f3c Simplified random byte stream generation code to use SSL RAND_bytes() and also eliminated two more compiler warnings. 2015-05-05 12:33:44 -04:00
Marc-André Moreau
70ecd9b619 Merge pull request #2589 from baruchsiach/fix-math
Don't use unavailable C99 long double math functions
2015-05-05 10:47:03 -04:00
Norbert Federa
25fc866a58 Fix unchecked CreateThread calls and misc fixes 2015-05-05 13:55:48 +02:00
MartinHaimberger
9a4f645f78 Merge pull request #2582 from nfedera/fix-2015-04-28-01
Fix unchecked CreateEvent calls and misc fixes
2015-05-04 10:14:27 +02:00
Baruch Siach
414663cc36 Don't use unavailable C99 long double math functions
uClibc variants do not provide the C99 long double math functions like ceill,
powl, etc.. For future compatibility use check_symbol_exists() to check
whether these functions are available, and keep the result in
HAVE_MATH_C99_LONG_DOUBLE. Use that instead of the fragile Cygwin version
check in triodef.h.

Fixes build failures under uClibc(-ng) like:

../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `powl'
../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `fmodl'
../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `ceill'
../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `log10l'
../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `floorl'
collect2: error: ld returned 1 exit status

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2015-05-03 21:12:30 +03:00
Bryan Everly
df9ae5e31b Changed the xf_tsmf.c code to test for zero visible rectangles for all platforms. Modified arc4random() change to actually have a skeletal implementation in winpr for BCryptGenRandom() on all platforms. 2015-04-30 10:12:37 -04:00
Bernhard Miklautz
dd2e7f393d Merge pull request #2584 from baruchsiach/fix-eventfd-2
Fix build with newer uclibc versions
2015-04-30 14:20:33 +02:00
Baruch Siach
3b7d3190a1 Fix build with newer uclibc versions
uClibc master branch, as well as uclibc-ng add eventfd_{read,write}
definitions. Instead of testing for __UCLIBC__, have cmake explicitly check
for the existence of eventfd_read and save the result in
WITH_EVENTFD_READ_WRITE.

Fixes build errors like:

.../winpr/libwinpr/synch/event.c:120:12: error: static declaration of 'eventfd_read' follows non-static declaration
 static int eventfd_read(int fd, eventfd_t* value)
            ^
In file included from .../winpr/libwinpr/synch/event.c:39:0:
.../usr/include/sys/eventfd.h:37:12: note: previous declaration of 'eventfd_read' was here
 extern int eventfd_read (int __fd, eventfd_t *__value);
            ^
.../winpr/libwinpr/synch/event.c:125:12: error: static declaration of 'eventfd_write' follows non-static declaration
 static int eventfd_write(int fd, eventfd_t value)
            ^
In file included from .../winpr/libwinpr/synch/event.c:39:0:
.../usr/include/sys/eventfd.h:40:12: note: previous declaration of 'eventfd_write' was here
 extern int eventfd_write (int __fd, eventfd_t __value);
2015-04-29 20:31:25 +03:00
Norbert Federa
ef1fd12b15 Fix unchecked CreateEvent calls and misc fixes
1)
Added missing checks for CreateEvent which also required the
following related changes:

- changed freerdp_context_new API to BOOL
- changed freerdp_peer_context_new API to BOOL
- changed pRdpClientNew callback to BOOL
- changed pContextNew callback to BOOL
- changed psPeerAccepted callback to BOOL
- changed psPeerContextNew callback to BOOL

2)
Fixed lots of missing alloc and error checks in the
changed code's neighbourhood.

3)
Check freerdp_client_codecs_prepare result to avoid segfaults
caused by using non-initialized codecs.

4)
Fixed deadlocks in x11 caused by missing xf_unlock_x11() calls
in some error handlers

5)
Some fixes in thread pool:
- DEFAULT_POOL assignment did not match TP_POOL definition
- don't free the pool pointer if it points to the static DEFAULT_POOL
- added error handling and cleanup in InitializeThreadpool
2015-04-29 18:18:39 +02:00
Armin Novak
b7fccafb94 Added EBUSY to success states. 2015-04-29 08:48:07 +02:00
Armin Novak
07ee198203 Better error handling on mutex destroy. 2015-04-28 17:31:27 +02:00
Armin Novak
fe27913859 Ensuring mutex is unlocked on destroy. 2015-04-28 09:42:46 +02:00
Armin Novak
ac15ce2da8 Added mutex debug flag.
When mutex debugging is enabled now a stack trace
is logged, if a mutex is locked on destruction.
2015-04-28 08:55:49 +02:00
Bryan Everly
cb66f3ee70 Removed compiler warning about obsolete header file in OpenBSD 2015-04-22 09:50:50 -04:00
Bernhard Miklautz
d5e7314392 Merge pull request #2564 from akallabeth/pthread_mutex_timedjoin_detection
Fixed pthread_mutex_timedjoin detection.
2015-04-22 14:42:31 +02:00
Hardening
6cd7713e12 Merge pull request #2544 from bmiklautz/boolenization
change return types of callbacks to BOOL
2015-04-22 11:01:27 +02:00
Armin Novak
5911332dfe Fixed pthread_mutex_timedjoin detection. 2015-04-22 09:32:59 +02:00
Bryan Everly
d31301f73f Modified code to use bulitin pthread functions on OpenBSD 2015-04-21 16:14:56 -04:00
Bryan Everly
8c75127a67 Necessary changes to get latest branch working on OpenBSD 5.6 2015-04-21 14:42:06 -04:00
Bernhard Miklautz
c9ee30a815 TestStream: set function parameters to void 2015-04-21 14:25:59 +02:00
Bernhard Miklautz
61473923e4 TestStream: fix compiler warning
Remove unnecessary argument from read function call.
2015-04-21 14:16:33 +02:00
Armin Novak
ad41fc59a3 Fixed reading bitmap from buffer. 2015-04-20 15:13:23 +02:00
Armin Novak
7990ea6371 Added proper bitmap and png image test. 2015-04-19 12:29:28 +02:00