Commit Graph

1849 Commits

Author SHA1 Message Date
Bernhard Miklautz
0cdb4f7924 Fix compiler warnings
gcc (Debian 4.9.2-10) 4.9.2

winpr/libwinpr/thread/argv.c: In function ‘CommandLineToArgvA’:
winpr/libwinpr/thread/argv.c:94:6: warning: unused variable ‘index’ [-Wunused-variable]
  int index;

winpr/libwinpr/file/test/TestFileGetStdHandle.c: In function ‘TestFileGetStdHandle’:
winpr/libwinpr/file/test/TestFileGetStdHandle.c:44:2: warning: implicit
	declaration of function ‘CloseHandle’ [-Wimplicit-function-declaration]
  CloseHandle(stdout);
    ^
libfreerdp/codec/test/TestFreeRDPRegion.c: In function ‘test_norbert2_case’:
libfreerdp/codec/test/TestFreeRDPRegion.c:697:6: warning: unused variable ‘i’ [-Wunused-variable]
  int i;

channels/cliprdr/server/cliprdr_main.c: In function ‘cliprdr_server_receive_format_list’:
channels/cliprdr/server/cliprdr_main.c:636:24: warning: unused variable ‘cliprdr’ [-Wunused-variable]
  CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle;
                        ^
channels/cliprdr/server/cliprdr_main.c: In function ‘cliprdr_server_init’:
channels/cliprdr/server/cliprdr_main.c:1097:24: warning: unused variable ‘cliprdr’ [-Wunused-variable]
  CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle;
2015-11-09 19:26:34 +01:00
Bernhard Miklautz
67368b2ec7 Adapt error level for debug messages
When using xfreerdp a regular invocation should really only report grave
problems as error. "Regular" messages should be either info or even
debug.
2015-11-09 18:27:38 +01:00
Bernhard Miklautz
07417599ce wlog: rework, cleanup and stabilize API
* only expose necessary functions and types in header
* don't expose appender internals
* add generic function WLog_ConfigureAppender to have the possibility
  to configure appender specific settings
* detect appender availability if WLog_SetLogAppenderType or
  WLog_Appender_New return FALSE or NULL respectively the appender isn't
  available or the initialization failed. This is very useful for the
  use with optional appenders.
* add Free to the appender interface. At the time of the Free the
  appender is known and available so it can be called directly (instead
  of calling the right function according to the type)
* make all appender internal function static
* all appenders return the generic wLogAppender type now. Typecasts
  are internally done where necessary this abstracts the appenders more
  cleanly
2015-11-09 18:25:45 +01:00
Bernhard Miklautz
d73c4898c1 Add build-config.h
build-config.h should contain configure/compile time settings that are
relevant for projects that use FreeRDP.

For example the compiled in plugin search paths.
2015-11-09 15:54:22 +01:00
Norbert Federa
2ac195e8eb Merge pull request #2964 from hardening/udp_appender
Add an UDP appender to wLog
2015-11-09 13:42:02 +01:00
David FORT
458aaa1213 Take in account @nfedera's remarks 2015-11-06 23:17:11 +01:00
Norbert Federa
d6b5b906f4 winpr/argv: fix CommandLineToArgvA memory access
- fixed access of unitialized memory beyond terminating null
- minor simplifications
2015-11-05 18:10:05 +01:00
David FORT
5fbf26acf2 Add an UDP appender to wLog
This appender allows to receive the logs over a network connection using UDP packets.
You can see the logs using a listening netcat, for example: nc -ul 127.0.0.1 20000.
2015-11-04 18:11:19 +01:00
Armin Novak
b5288daea5 Fixed return values. 2015-11-03 17:32:42 +01:00
Hardening
3d6e1fb418 Merge pull request #2951 from bmiklautz/friday
Misc fixes
2015-11-02 10:50:16 +01:00
David FORT
2a8de84342 Take in account @bmiklautz remarks
* I have added a function to set the journal identifier
* the appender name has been changed from SYSTEMD to JOURNALD
2015-11-01 21:34:03 +01:00
David FORT
e3915b66b7 Fix the env var leak 2015-10-30 20:22:25 +01:00
David FORT
89156e53b7 Use unbuffered output 2015-10-30 20:20:42 +01:00
David FORT
9ea301983d Adds a systemd journal appender 2015-10-30 14:50:14 +01:00
Bernhard Miklautz
a011719831 Merge pull request #2940 from hardening/syslog_appender
Add a wLog syslog appender
2015-10-29 18:44:14 +01:00
David FORT
8d2aadfccd Fixed a warning 2015-10-29 18:33:42 +01:00
David FORT
c2a322f4d0 Support syslog type for the WLOG_APPENDER env var 2015-10-29 18:31:22 +01:00
David FORT
0cf2a0e50b Don't include config.h in public headers
In fact we don't need the ifdefery in public headers, so don't include unneeded
config.h file.
2015-10-29 10:32:58 +01:00
David FORT
382993d4d5 Include config.h file when needed 2015-10-27 21:45:26 +01:00
Bernhard Miklautz
c70559d128 winpr API: add EnvironmentBlockToEnvpA
* expose EnvironmentBlockToEnvpA
* cleanup includes in process.c
* removed unused "flag" variable in _CreateProcessExA
* make ProcessHandleCloseHandle static
2015-10-23 18:38:42 +02:00
Bernhard Miklautz
ab05a79c21 winpr/stream: don't allow 0-size streams 2015-10-23 18:38:41 +02:00
Bernhard Miklautz
a9d81ad083 winpr: fix compiler warning
winpr/libwinpr/utils/wlog/wlog.c: In function ‘WLog_PrintMessageVA’:
winpr/libwinpr/utils/wlog/wlog.c:234:7: warning: ‘status’ may be
		used uninitialized in this function [-Wmaybe-uninitialized]
	BOOL status;
	      ^

gcc 4.9.2
2015-10-23 18:37:39 +02:00
Martin Fleisz
08cbcb3577 wlog: Fix variable definitions 2015-10-23 12:08:20 +02:00
David FORT
d9080312bc Adapt to last wLog changes 2015-10-22 10:54:21 +02:00
David FORT
720c879661 Add a wLog syslog appender 2015-10-22 10:37:49 +02:00
Martin Haimberger
b2398b3a9a wlog: fixed return values
wlog used to return an int but the only meaning
of the return value was:

 * negative ... error
 * 0 or positive ... success

but the positve returned value was 1 or some id of some
subsystem, nothing meaningful for the caller.

For a more meaningful returnvalue we now use BOOL.

If something goes wrong FALSE is returned.
2015-10-21 01:11:06 -07:00
Marc-André Moreau
863939fd58 Merge pull request #2919 from realjiangms/fix_allow_empty_password
Sec/NLA: Support passwordless (blank password) login with NLA.
2015-10-13 10:40:28 -04:00
Marc-André Moreau
329194b87e libwinpr-crypto: fix OpenSSL 1.0 HMAC API change 2015-10-13 09:54:59 -04:00
Marc-André Moreau
6ab29da576 libwinpr-crypto: fix error checking 2015-10-13 09:43:26 -04:00
Marc-André Moreau
0a7e07a3a5 libwinpr-crypto: avoid linking to less common digests and ciphers 2015-10-13 09:13:52 -04:00
Marc-André Moreau
87780a850d Merge branch 'master' of github.com:FreeRDP/FreeRDP into mbedtls 2015-10-09 15:58:50 -04:00
Marc-André Moreau
4f769866d7 winpr: make clean non-OpenSSL build possible (without schannel, makecert) 2015-10-09 15:57:41 -04:00
Marc-André Moreau
82afb0f1ee libwinpr-crypto: add generic digest API and OpenSSL compatible key derivation 2015-10-09 15:23:15 -04:00
zihao.jiang
a7f4685c09 Sec/NLA: Support passwordless (blank password) login with NLA.
It was supported in freerdp 1.0.2 but not supported in lastest master.
We should take empty password if it is explicitly specified with /v option.
If a password is not specified, we could first try SAM file. If the user entry does not exist, prompt for password.
2015-10-10 01:48:41 +08:00
Marc-André Moreau
54292f29ea libwinpr-crypto: add generic cipher API with OpenSSL/mbedtls support 2015-10-09 12:15:31 -04:00
Marc-André Moreau
87c42127c7 libwinpr-sspi: remove OpenSSL dependency in NTLM SSPI module 2015-10-08 16:48:58 -04:00
Marc-André Moreau
5bff1d0fdf libwinpr-crypto: add rand and RC4 functions with OpenSSL/mbedtls 2015-10-08 16:26:37 -04:00
Marc-André Moreau
7521ecd759 libwinpr-crypto: add basic hashing and HMAC support with OpenSSL/mbedTLS 2015-10-08 13:58:55 -04:00
Marc-André Moreau
ac62d43e0f winpr: isolate OpenSSL 2015-10-06 10:56:24 -04:00
Marc-André Moreau
94a2f9533e winpr: start porting to non-OpenSSL 2015-10-05 16:23:44 -04:00
Martin Fleisz
2d641c4dd4 Merge pull request #2864 from bjcollins/smartcard_same_name_readers
Give unique aliases for smartcards with the same name, so that two re…
2015-10-01 13:45:20 +02:00
Marc-André Moreau
70b037145e libwinpr-synch: fix broken FD_ISSET check caused by hidden type cast from int to char 2015-09-18 11:38:27 -04:00
Marc-André Moreau
8a5c55788b libwinpr-sspi: don't warn about non-error security statuses 2015-09-17 11:16:20 -04:00
Martin Fleisz
912cd96321 Merge pull request #2887 from FreeRDP/mh-file-api-extension
winpr/file: extend API
2015-09-15 15:57:56 +02:00
Marc-André Moreau
2c3c6930c3 Merge pull request #2888 from awakecoding/master
fix ARM64 data type portability
2015-09-15 09:12:00 -04:00
MartinHaimberger
db2ce49a98 Merge pull request #2763 from akallabeth/nla_null_auth
Fixed server and client NLA state machine for NULL identity.
2015-09-15 14:53:55 +02:00
MartinHaimberger
d4d360f6a4 Merge pull request #2859 from akallabeth/resource_leak_fix
Fixes API misuse and logic errors
2015-09-15 14:45:42 +02:00
Martin Haimberger
925e4ea4d4 winpr/file: extend API
added windows code
fixed compiler issue
2015-09-15 04:14:30 -07:00
Bernhard Miklautz
074854735f winpr/file: extend API
Add function GetFileHandleForFileDescriptor to get
a file handle for a valid file descriptor.
2015-09-15 02:16:36 -07:00
Marc-André Moreau
01b52d08d7 winpr: fix ARM64 data type portability 2015-09-14 14:34:24 -04:00
Bryan Everly
37b3881f06 Merge remote-tracking branch 'upstream/master' 2015-09-14 13:21:00 -04:00
Bryan Everly
bd149a284d Cleaned up previous OpenBSD change per recommendation 2015-09-14 13:20:11 -04:00
MartinHaimberger
735383b7f5 Merge pull request #2877 from bmiklautz/filehandling
winpr/file refactoring and regular file support
2015-09-14 17:15:50 +02:00
Armin Novak
e685f13e0b Added ORIENTATION_PREFERENCE from WinUser.h. 2015-09-10 13:26:37 +02:00
Bernhard Miklautz
0d9dfb974d winpr/file: integrate pull request feedback
* simplify RemoveDirectory
* move std handle function into an extern C block
2015-09-10 11:50:10 +02:00
Bernhard Miklautz
0f5e7c60a7 winpr/file: don't close stdin/stdout/stderr
If the handle is closed stdin/stdout/stderr should be left open.
2015-09-09 17:07:40 +02:00
Bernhard Miklautz
8091530779 winpr/file: fix ios build
comm is only build on linux.
2015-09-09 17:07:13 +02:00
Bernhard Miklautz
6b52a2e5cc winpr/file: initial regular file support
Add initial support for "regular" files. First implemented call is
GetStdHandle to get stdin/stdout/stderr.
2015-09-09 16:47:03 +02:00
Bernhard Miklautz
204ae5462a winpr/file: refactoring
The used method for initalizing and registering the handle creators
had certain disadvantages like that it was necessary to have the creators
initialized before the first call to CreateFile. In case of comm it
wouldn't have been possible to open an comm port without calling any
other call related function first.
Now the handle creators are initialized the first time CreateFile is
called. This way it is also possible to ensure a certain order of the
handler invocations.

This commit also splits out the client side named pipe code from
the generic file handling (now called generic.c instead of file.c) and
uses the new handle creator infrastructure to register.
2015-09-09 15:48:59 +02:00
Bernhard Miklautz
868add7a51 Merge pull request #2873 from mfleisz/makecert_change
makecert: Remove key usage attribute
2015-09-07 11:15:51 +02:00
Martin Fleisz
899d0874b8 makecert: Remove key usage attribute
The original makecert tool won't add this tribute to a generated
certificate. Adding this attribute might cause problems when using the
certificate with other apps (i.e. Qt SSL).
2015-09-07 10:43:19 +02:00
MartinHaimberger
d971116457 Merge pull request #2765 from akallabeth/connect_abort
Connect abort and unified TCP connect
2015-09-07 10:05:24 +02:00
Armin Novak
7d8ab23877 WSAEvent fixes ported from realjiangms pull 2870. 2015-09-05 15:18:01 +02:00
Armin Novak
ce479e312a Fixed uninitialized environment block. 2015-09-03 13:37:16 +02:00
bjcollins
ac67e25007 Give unique aliases for smartcards with the same name, so that two readers do not end up with the same alias. 2015-09-02 12:11:47 -05:00
Armin Novak
6c74dbbe25 Reverted broken malloc size fix. 2015-09-02 13:57:04 +02:00
MartinHaimberger
74817efbdb Merge pull request #2852 from bmiklautz/process_env
Update CreateProcess and rfx
2015-09-02 10:09:11 +02:00
Armin Novak
6c288bd0f2 Fixed zero length allocation. 2015-09-01 12:25:43 +02:00
Armin Novak
2c7a20d8c0 Fixed uninitialized memory. 2015-09-01 12:25:43 +02:00
Armin Novak
205878383d Fixed array out of bound access. 2015-09-01 12:25:43 +02:00
Armin Novak
cdf884fd45 Fixed broken structure comparison. 2015-09-01 12:25:43 +02:00
Armin Novak
cb7927756d Fixed resource leak. 2015-09-01 11:31:12 +02:00
Armin Novak
5cad081cc8 Fixed memory leak. 2015-08-28 11:07:25 +02:00
Bernhard Miklautz
72f13aeacb CreateProcess: add stdin/out/err redirection
When launching a new process stdin/stdout/stderr can be redirected by
passing the corresponding HANDLEs in the passed lpStartupInfo structure.
This is required for example if a pipe should be used as stdin/stdout.

If set in lpStartupInfo the file descriptor of the passed handle is
now used. The test was updated accordingly.
2015-08-28 10:41:23 +02:00
Marc-André Moreau
e1e4d2ae98 Merge pull request #2827 from HenryJacques/winpr_cleanup
Remove unused variable in RegQueryValueExA()
2015-08-27 10:11:50 -04:00
Armin Novak
134a16d522 Fixed WSAEventSelect mode reset. 2015-08-27 15:33:06 +02:00
Armin Novak
d557690426 x509_get_default_name tries to get FQDN before hostname now. 2015-08-25 17:44:03 +02:00
Armin Novak
1abd652530 Fixed GetComputerNameExA and GetComputerNameA. 2015-08-25 17:43:22 +02:00
HenryJacques
e9a7da3b4e Remove unused variable 2015-08-05 18:38:50 +02:00
Martin Haimberger
008d9f3b79 fixed misc *_free functions to accept NULL
Following types of collections support now
NULL in the free call:

* ArrayList
* BitStream
* ContdownEvent
* Dictionary
* KeyValuePair
* MessageQueue
2015-07-30 07:02:36 -07:00
Martin Haimberger
479157b69c winpr: WaitFor*Ojbect/s set lastError now 2015-07-30 02:52:11 -07:00
Marc-André Moreau
611c194f80 Merge pull request #2801 from bmiklautz/fix/thread
winpr/thread: small cleanups
2015-07-28 08:47:06 -04:00
Marc-André Moreau
b33ea8aee9 Merge pull request #2804 from bmiklautz/fix/misc
Misc fixes
2015-07-28 08:46:27 -04:00
Marc-André Moreau
06c3f2fca4 Merge pull request #2793 from rkondratenko/pcsclite-transactions
Fix for transactions support for Smart Cards
2015-07-28 08:44:58 -04:00
Bernhard Miklautz
c3ea07f3d9 winpr/thread: don't close invalid file descriptors
In case the file descriptor is -1 don't call close.
2015-07-24 14:57:47 +02:00
Bernhard Miklautz
81d422588e winrp/thread: don't call pthread_exit on return
As the pthread_exit man page states pthread_exit is called implicitly
when the start function returns.
2015-07-24 14:52:31 +02:00
Bernhard Miklautz
4250f3f030 winpr/event: remove critical section
The critical section isn't required and not used anymore since
commit 8a2220a3d9.
2015-07-24 13:29:48 +02:00
Bernhard Miklautz
ca150f2255 winpr/thread: small cleanups
Also adds error checking of winpr_StartThread in winpr_StartThread.
2015-07-23 11:52:49 +02:00
Rostislav Kondratenko
3f81ff87a6 Removing private context on hCard so that transaction will properly unlock when context is released. 2015-07-17 18:13:41 +03:00
Rostislav Kondratenko
f2863fabf5 Re-enabled PCSC-Lite transactions and fixed smartcard deinitialization so it will release all contexts to unblock calls waiting for transactions 2015-07-17 16:37:44 +03:00
Armin Novak
9af2e22d51 Fixed mutex unlocking and return checks. 2015-07-16 17:07:29 +02:00
Martin Fleisz
1a6aba0130 winpr/tools: Fixed x509_get_default_name failing with long computer names 2015-07-15 11:47:01 +02:00
MartinHaimberger
b06d83ba80 Merge pull request #2766 from akallabeth/snprintf_to_sprintf_s
Replaced snprintf with sprintf_s
2015-07-15 09:47:43 +02:00
Bernhard Miklautz
1a0253ef93 winpr/handle: define WINPR_FD_ on all platforms 2015-07-14 12:21:24 +02:00
Bernhard Miklautz
68e8569110 winpr/synch: remove the dependency on winsock.h
winsock.h pulls in a lot of defines and dependencies that are not
required and partially unwanted in winpr's core (for parts that are not
related to network). In order to get rid of this dependency and have an
independent defines for extended winpr functions the WINPR_FD_* defines
are used internally (and for exposed functions). Where required, like in
WSAEventSelect, the FD_* is mapped to WINPR_FD_*.
2015-07-14 11:39:41 +02:00
Armin Novak
48ccf73a36 More SSPI logging. 2015-07-08 17:41:22 +02:00
Armin Novak
7360cb638a Erasing memory on credentials or SecBuffer free. 2015-07-08 17:41:21 +02:00
Armin Novak
cf9f975341 Replaced snprintf with sprintf_s 2015-07-03 13:26:15 +02:00
Armin Novak
776f15e135 Fixed inverted bAttached setting.
If bAttached is TRUE, the resources of the event are not
cleaned up on CloseHandle.
2015-07-03 12:42:04 +02:00
Armin Novak
c21de0dae6 Fixed pr comments. 2015-07-03 11:13:48 +02:00