Commit Graph

1821 Commits

Author SHA1 Message Date
Armin Novak
bba910bd85 Fixed RPATH settings for OS X 2017-04-06 08:08:07 +02:00
David PHAM-VAN
f54326e350 Fix indentation 2017-04-05 15:35:03 -07:00
David PHAM-VAN
30d0bde4ba Fix FindFirstFile return values 2017-03-31 15:33:28 -07:00
Armin Novak
aa11a6c89c Fixed memory leak and return value check issue. 2017-03-28 17:56:44 +02:00
Armin Novak
09d43a66f4 Fixed tests and dead store warnings. 2017-03-28 16:49:56 +02:00
David PHAM-VAN
b46aaeb973 Fix memory leaks, Mixed declarations 2017-03-27 11:15:22 -07:00
David Fort
b33371fe65 Fixed typo 2017-03-21 10:31:21 +01:00
Aric Belsito
70ab61c8e6
Support LibreSSL
Broken by the addition of OpenSSL 1.1.0 support.
2017-03-19 13:58:24 -07:00
David PHAM-VAN
5a66fe841a Misc Fixes 2017-03-17 14:07:33 -07:00
David PHAM-VAN
d6f78df195 Verify ConvertFromUnicode return values 2017-03-16 16:27:01 -07:00
David PHAM-VAN
ca0398ffc2 Fix FileGetMode writable detection 2017-03-14 12:41:11 -07:00
Armin Novak
3b56cd652f Fix format string is not a string literal 2017-03-14 10:56:00 +01:00
David PHAM-VAN
1c907d0b09 Fix WinPR FindFirstFile/FindNextFile functions 2017-03-13 14:19:03 -07:00
David PHAM-VAN
bc87fa69df Fix WinPR File creation functions 2017-03-13 14:18:59 -07:00
David PHAM-VAN
07c60ca8a4 Add Windows Errors to File operations 2017-03-13 14:18:55 -07:00
David PHAM-VAN
38507bae9f add _wcsrchr function 2017-03-13 14:18:42 -07:00
David PHAM-VAN
b89bfaaae4 Add missing functions to WinPR 2017-03-13 14:18:37 -07:00
Alexander Zakharov
3f139108ff Fix Stack_Peek 2017-03-13 15:45:27 +03:00
Armin Novak
b574e196d9 Fixed WLog_PrintMessagePrefixVA
WLog_PrintMessagePrefixVA is called with format being a stack variable.
Always copy the data to message->PrefixString otherwise the information
will be lost whenever the stack is destroyed.
2017-03-03 14:11:28 +01:00
Armin Novak
99c45405cb Fixed GetEnvironmentVariable. 2017-03-03 12:43:00 +01:00
Armin Novak
b2c29158be Scanbuild warning, argument checks and leak fixes.
* Added Stream_GetRemainingCapacity to check remaining stream size
  before writes.
* Fixed shadow server memory leak.
* Fixed lots of scanbuild warnings
* Added missing argument checks in many functions
* Added missing static function declarations
2017-03-02 18:13:43 +01:00
Norbert Federa
97ab14add4 Added test for GetComputerName/GetComputerNameEx 2017-02-28 11:03:10 +01:00
Armin Novak
270d68f949 Fixed setting of lpnSize according to spec. 2017-02-28 09:39:04 +01:00
Armin Novak
b11de26f98 Fixed GetComputerNameExA return checks. 2017-02-27 11:49:53 +01:00
Armin Novak
71d9a83c60 Fixed GetComputerNameEx last error. 2017-02-27 11:49:53 +01:00
akallabeth
8a22052b61 Fixed memory leaks. 2017-02-25 08:35:37 +01:00
akallabeth
705c0c1e12 Fixed GetComputerNameExA calls. #3815 2017-02-24 21:58:08 +01:00
Martin Fleisz
0ed0ecb397 Merge pull request #3789 from akallabeth/scan_warning_fixes
Scanbuild warning and error fixes
2017-02-21 11:07:57 +01:00
Armin Novak
6900b5eb77 Fixed scanbuild warnings. 2017-02-20 14:32:54 +01:00
Armin Novak
e9b5d78673 Fixed scanbuild warnings. 2017-02-20 14:28:33 +01:00
Armin Novak
c249705085 Fixed scanbuild warnings. 2017-02-20 13:45:19 +01:00
Andreas Schultz
d2f98261f7 smartcard: implement ListReaderGroups
Conflicts:
	channels/smartcard/client/smartcard_operations.c
	channels/smartcard/client/smartcard_pack.c
	channels/smartcard/client/smartcard_pack.h

smartcard_operations: move handling of call argument into functions

The call argument was only use by static functions and was always equal
to operation->call. Remove the argument and use operation-call directly.

Also put the memory allocation and check into the same place.

Conflicts:
	channels/smartcard/client/smartcard_operations.c

Updated formatting and API
2017-02-16 16:59:03 +01:00
Armin Novak
198bc6d9e1 Fixed compiler warnings. 2017-02-16 13:17:49 +01:00
Martin Fleisz
ae551e4f8a Merge pull request #3762 from akallabeth/sspi_init
Use INIT_ONCE for SSPI initialisation. #3471
2017-02-16 09:51:10 +01:00
pony
a57adc3fde libwinpr-utils: fix 3 logic errors 2017-02-15 10:08:53 +01:00
Martin Fleisz
096de0f7dd Merge pull request #3755 from pentagra/master
ifdef's for Cygwin compilation
2017-02-14 12:42:10 +01:00
Armin Novak
4f44cdc561 Use INIT_ONCE for SSPI initialisation. #3471 2017-02-13 18:06:27 +01:00
Armin Novak
c90a0be205 Fixed time conversion in FileSetFileTime. #3508 2017-02-13 15:14:20 +01:00
pentagra
df2b5c9cdf ifdef's for Cygwin compilation 2017-02-10 18:06:20 +03:00
Armin Novak
656b3be02d Added fallback for CMSPAR. (See debian #854689) 2017-02-09 19:58:26 +01:00
Norbert Federa
6001cb710d Merge pull request #3717 from akallabeth/prim_fixes
Fixed primitives.
2017-02-01 11:11:27 +01:00
Martin Fleisz
c2eacd3b31 Build: Use correct pdb names when installing with symbols 2017-01-31 13:32:51 +01:00
Armin Novak
ef71f7fd55 Removed unused files, added README with links 2017-01-31 10:01:41 +01:00
Ilya Shipitsin
879f1c3944 removed redundant condition:
[winpr/libwinpr/synch/semaphore.c:131] -> [winpr/libwinpr/synch/semaphore.c:136]: (warning) Either the condition 'if(semaphore)' is redundant or there is possible null pointer dereference: semaphore.
[winpr/libwinpr/synch/semaphore.c:132] -> [winpr/libwinpr/synch/semaphore.c:136]: (warning) Either the condition 'if(semaphore)' is redundant or there is possible null pointer dereference: semaphore.
[winpr/libwinpr/synch/semaphore.c:133] -> [winpr/libwinpr/synch/semaphore.c:136]: (warning) Either the condition 'if(semaphore)' is redundant or there is possible null pointer dereference: semaphore.
[winpr/libwinpr/synch/semaphore.c:134] -> [winpr/libwinpr/synch/semaphore.c:136]: (warning) Either the condition 'if(semaphore)' is redundant or there is possible null pointer dereference: semaphore.
2017-01-28 12:36:08 +05:00
Ilya Shipitsin
102913e808 make cppcheck a bit happier:
[channels/printer/client/printer_cups.c:103]: (error) Resource leak: fp
[server/Mac/mf_event.c:195]: (error) Memory leak: event_queue
[server/shadow/shadow_capture.c:233]: (error) Memory leak: capture
[winpr/libwinpr/sspi/test/TestSchannel.c:440]: (error) Memory leak: lpTokenIn
[winpr/libwinpr/thread/argv.c:198]: (error) Memory leak: lpEscapedChars
[winpr/libwinpr/utils/sam.c:312]: (error) Memory leak: entry
2017-01-25 17:09:25 +05:00
Armin Novak
0106405fff Using android cpufeatures library for detection. 2017-01-24 09:56:45 +01:00
Armin Novak
ec06c24794 Added arm64 and mips64 detection support. 2017-01-24 09:28:27 +01:00
Bernhard Miklautz
bbb6bf6b43 Include major version number in library names
Currently it is not possible to cleanly install multiple major version
of FreeRDP concurrently as some of the development libraries (.so files)
files can conflict.

This change renames all libraries to include the major version number in
the library name to fix this limitation.

The list of changed libraries:

libwinpr-tools.so -> libwinpr-tools2.so
libwinpr.so -> libwinpr2.so
libfreerdp.so -> libfreerdp2.so
libfreerdp-client.so -> libfreerdp-client2.so
libfreerdp-shadow.so -> libfreerdp-shadow2.so
libfreerdp-server.so ->  libfreerdp-server2.so
libfreerdp-shadow-subsystem.so -> libfreerdp-shadow-subsystem2.so
libuwac.so -> libuwac0.so

As the library names have changed, projects that use FreeRDP will need to
update their dependencies. -
If pkg-config or cmake find modules are used, reconfiguration might be
sufficient.

Fixes #3460
2017-01-16 11:11:58 +01:00
Norbert Federa
71ce3378da Merge pull request #3665 from realjiangms/fix_ssl_add_all_digests
Winpr/openssl: Fix digests initialization in multi-thread
2017-01-13 09:46:14 +01:00
Robert Corrigan
6e448e64af Update timezone data to Dec 2016 2017-01-11 16:56:34 -05:00
Martin Fleisz
ac090520c3 Fix compilation with OpenSSL 1.1.0 using MSVC 2017-01-09 16:43:28 +01:00
zihao.jiang
a505a6cd27 Winpr/openssl: Fix digests initialization in multi-thread
SSL functions like OpenSSL_add_all_digests should be invoked at very beginning as they are not MT safe.
If not we might meet double free exception as following:

 #0  0x00007f23ddd71c37 in raise () from /lib/x86_64-linux-gnu/libc.so.6
 #1  0x00007f23ddd75028 in abort () from /lib/x86_64-linux-gnu/libc.so.6
 #2  0x00007f23dddae2a4 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
 #3  0x00007f23dddba55e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
 #4  0x00007f23dc6ecfcd in CRYPTO_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #5  0x00007f23dc6ef8d1 in OBJ_NAME_add () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #6  0x00007f23dc77dcd8 in EVP_add_digest () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #7  0x00007f23dc782321 in OpenSSL_add_all_digests () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
 #8  0x00007f23c781da28 in winpr_openssl_get_evp_md (md=4) at /home/zihao/workspace/zihao_FreeRDP/winpr/libwinpr/crypto/hash.c:52
 #9  0x00007f23c781dccb in winpr_Digest_Init (ctx=0x7f22d064d470, md=<optimized out>) at /home/zihao/workspace/zihao_FreeRDP/winpr/libwinpr/crypto/hash.c:344
 #10 0x00007f23d486139b in security_salted_mac_signature (rdp=0x7f23859f5a20, data=0x7f238542d4fb "\004\204\022\004", length=4743, encryption=<optimized out>, output=0x7
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/security.c:378
 #11 0x00007f23d488d73f in fastpath_send_update_pdu (fastpath=<optimized out>, updateCode=4 '\004', s=0x7f23859f5f40, skipCompression=true)
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/fastpath.c:1076
 #12 0x00007f23d4891c4f in update_send_surface_frame_bits (context=0x7f23859f5540, cmd=0x7f22b2ffcc80, first=true, last=true, frameId=6)
     at /home/zihao/workspace/zihao_FreeRDP/libfreerdp/core/update.c:1041

Related reports: https://rt.openssl.org/Ticket/Display.html?id=2216&user=guest&pass=guest
2016-12-28 03:48:40 +08:00
Norbert Federa
ab0408ae5e ctest for int format specifiers and usage doc 2016-12-16 14:20:30 +01:00
Norbert Federa
f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00
Marc-André Moreau
d72ff5d241 Merge pull request #3640 from awakecoding/uwp_fix
UWP portability fixes
2016-12-02 16:54:06 -05:00
Marc-André Moreau
53a61f512c winpr: fix UWP portability 2016-12-02 13:18:55 -05:00
Armin Novak
8a80a10bc3 Fixed format specifier mismatch. 2016-12-02 12:04:53 +01:00
Norbert Federa
c6e6b44143 countless WLog/printf format specifier fixes 2016-11-25 17:06:25 +01:00
Martin Fleisz
971c8538ec winpr: Fix compile error after #3615 2016-11-25 11:50:28 +01:00
Norbert Federa
b2ad9803b7 disable ERR_remove_thread_state if not required 2016-11-25 10:39:20 +01:00
Norbert Federa
53bd98883e winpr/crypt api changes and memory leak fixes
- winpr_HMAC_New() now just returnes the opaque WINPR_HMAC_CTX* pointer
  which has to be passed to winpr_HMAC_Init() for (re)initialization
  and since winpr_HMAC_Final() no more frees the context you always have to
  use the new function winpr_HMAC_Free() once winpr_HMAC_New() has succeded

- winpr_Digest_New() now just returns the opaque WINPR_DIGEST_CTX* pointer
  which has to be passed to winpr_Digest_Init() for (re)initialization
  and since winpr_Digest_Final() no more frees the context you always have to
  use the new function winpr_Digest_Free() once winpr_Digest_New() has succeded
2016-11-24 18:27:29 +01:00
Norbert Federa
7befab856c Support for OpenSSL 1.1.0 2016-11-24 17:50:09 +01:00
Martin Fleisz
d30a138a01 wtsapi: Fix issue with setting custom API table 2016-11-24 10:35:36 +01:00
Robert Corrigan
2973b9ccf0 Updates time zone data to October 2016 2016-10-18 15:38:03 -04:00
Armin Novak
1122627e94 Fixed function argument and variable types. 2016-10-07 14:08:54 +02:00
Armin Novak
fb1dcf2689 Fixed invalid const type. 2016-10-07 14:08:33 +02:00
Armin Novak
edacd7c6b7 Thread using proper function pointer type. 2016-10-07 14:07:51 +02:00
Armin Novak
943e295714 WLog using C99 compatible variadic macros. 2016-10-07 14:05:27 +02:00
Bernhard Miklautz
e54c504eaa winpr/wait: add missing parameters
Add the missing parameters introduced with PR #3381
2016-10-06 15:40:11 +02:00
Armin Novak
8f1adf64ee Refactored ClipboardSetData. 2016-10-06 13:43:15 +02:00
Armin Novak
50c509eee2 Fixed barrier test. 2016-10-06 13:43:10 +02:00
Armin Novak
4b3d3cd69e Warning fixes. 2016-10-06 13:43:10 +02:00
Armin Novak
44b8756617 Warning fixes. 2016-10-06 13:43:10 +02:00
Armin Novak
a3fd9bf5af Fixed warnings. 2016-10-06 13:43:10 +02:00
Armin Novak
1454400236 Fixed windows defines for *LIST* 2016-10-06 13:43:10 +02:00
Armin Novak
9c64e77a84 Disabled thread local storage on iOS.
iOS does not support Thread Local Storage.
Disabling it for now until a solution is found.
Print a compiler warning informing developers about this issue.
2016-10-06 13:43:10 +02:00
Armin Novak
4f62d848ac Refactored interlocked typedefs, avoid namespace collisions. 2016-10-06 13:43:09 +02:00
Armin Novak
64c5d78b3f Fixed clang warnings. 2016-10-06 13:43:09 +02:00
Armin Novak
081b57905f Added ios home and temp dir support. 2016-10-06 13:43:08 +02:00
Armin Novak
88be64f10b Fixed apple file times. 2016-10-06 13:43:04 +02:00
Armin Novak
35f1347d53 Fixed warnings and mac build. 2016-10-06 13:43:04 +02:00
Bernhard Miklautz
bfdab0ed4a Merge pull request #3523 from rjcorrig/tz201609
winpr: Updated time zone definitions to Sept 2016
2016-10-06 12:19:57 +02:00
Marc-André Moreau
1d06087b60 Merge pull request #3515 from akallabeth/apple_time_fix
Fixed SetFileTime for mac.
2016-10-05 09:21:11 -04:00
Robert Corrigan
fc7378f59c Updated time zone definitions to Sept 2016 2016-10-04 10:54:11 -04:00
Armin Novak
3eb136d167 Fixed SetFileTime for mac. 2016-09-27 13:28:39 +02:00
ed.velez
ed697fa4ad fix_for_xcode8_clock_gettime 2016-09-22 15:42:43 -05:00
Martin Fleisz
71765b72e3 Merge pull request #3284 from ondrejholy/endianness
Endianness fixes
2016-08-25 08:17:52 +02:00
Marc-André Moreau
14cb6d33c6 freerdp: make modifications to NLA server-side fixes according to PR comments 2016-07-22 09:06:07 -04:00
Marc-André Moreau
801dc0f826 freerdp: add configurable NTLM SAM file option for server-side NLA 2016-07-21 18:58:24 -04:00
Marc-André Moreau
1ffbd774e9 freerdp: fix sending of TLS alert on NLA failure, add better handling of server-side NLA in shadow server 2016-07-21 17:53:20 -04:00
Armin Novak
d96fbd1bce Initialise WLog PrefixString for each message type. 2016-07-05 13:00:54 +02:00
Norbert Federa
333a1110f5 winpr/sspi/ntlm: fix computer name len calculation
The lpnSize parameter for GetComputerNameEx specifies the total
size of the buffer (in characters).
However, the current code calculated the amount of bytes.
Since only GetComputerNameExA was used and because sizeof(CHAR) == 1
the result was correct but the math was wrong.
Credit goes to @byteboon
2016-06-30 17:15:40 +02:00
Norbert Federa
27c439675f winpr: fix win32 linking issues
Depending on the windows target version (_WIN32_WINNT), the used
SDK and the build configuration the linker will see multiple
libraries exporting the same symbols.
To prevent ugly hacks (e.g. modifying cmake's default system
libraries or fragile library linking order chains) we prefix
these functions with "winpr_" and create corresponding defines
to keep the current api names.
2016-06-16 11:47:33 +02:00
Norbert Federa
7a68eebb03 cmake: remove some void statements and fix winpr source group 2016-06-15 13:54:31 +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
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
Ondrej Holy
b8f33aa59c winpr/crt: Make TestString endian-independent
Wide char strings use always little endian encoding since commit f722dc5.
Use only strings in little endian to make the tests endian-independent.
2016-06-10 18:18:47 +02:00
Ondrej Holy
bbcc0476c7 winpr/crt: Fix endianness in string utils
All WCHAR strings are stored as little endian after commit f722dc5,
therefor WCHAR string utils have to be changed appropriately.
2016-06-10 18:18:39 +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