Commit Graph

73 Commits

Author SHA1 Message Date
firewave
5eed76f32b fixed -Wunused-function compiler warnings 2024-04-23 18:38:20 +02:00
firewave
fb9c175b11 enabled and fixed -Wmissing-prototypes compiler warnings
Co-authored-by: matt335672 <30179339+matt335672@users.noreply.github.com>
2024-04-23 18:38:20 +02:00
Koichiro Iwao
47d4ab1339 Apply astyle 3.4 code formatter 2024-02-08 15:52:54 +09:00
matt335672
50cff2eb75
Merge pull request #2794 from matt335672/utf_changes_new
Improve Unicode support
2023-11-02 10:57:39 +00:00
matt335672
7ceff70c1c Fix message ordering in devredir
The drive redirector is not compliant with the message ordering
in [MS-RDPEFS], causing FreeRDP 2.11.2 ro fail on redirecting drives.
2023-10-26 15:17:17 +01:00
matt335672
8556f83905 Update drive redirection code to use new UTF-8 calls 2023-10-23 14:19:49 +01:00
matt335672
2a287963da devredir_proc_query_dir_response(): Conform to spec
This commit adds more error checking to the above function. The function
now conforms to [MS-FSCC] regarding processing of the NextEntryOffset
field.
2023-10-16 10:28:41 +01:00
matt335672
5f030a95b7 Don't try to listen on the scard socket if it isn't there
If the scard local socket can't be created, there's no point
in trying to listen on it. This will just fill the chansrv log
file with errors.
2023-01-16 13:41:18 +00:00
matt335672
b5b047458e Remove unused g_full_name_for_filesystem
Not only was this unused, the way it was read could lead to a
buffer overflow (CVE-2022-23480)
2022-12-09 18:11:03 +00:00
matt335672
ae7c17e1f6 CVE-2022-23480
Added length checking to redirector response parsing
2022-12-09 18:11:03 +00:00
a1346054
7fe18cc1c0
fix typos 2022-09-03 02:01:48 +00:00
matt335672
8e9fb8008f Addressed review comments 2021-09-08 11:51:21 +01:00
matt335672
d32953c405 Parse DEVICE_ANNOUNCE header correctly 2021-09-08 11:33:43 +01:00
matt335672
eda01f0853 Fix chansrv unterminated streams 2021-05-28 10:57:12 +01:00
matt335672
0a1a8f40e5 Moved a lot of string funcs to string_calls module 2020-12-22 11:57:24 +00:00
Alexandre Quesnel
0c61a15fc5 Migrating logging to LOG() and LOG_DEVEL() in sesman/* 2020-11-30 00:36:20 +00:00
Alexandre Quesnel
a9ec1ebd99 Unifying logging in chanserv
This commit adds:
* replace multiple logging macros with LOG and LOG_DEVEL
* logging configuration for chanserv
* logging configuration for console output
* logging configuration for per file or method log level filtering for
debug builds
* file, line, and method name in log message for debug builds
2020-10-19 05:10:47 +00:00
matt335672
a3d429b4f7 Minor fixes to drive redirection 2020-03-03 16:14:24 +00:00
matt335672
77686bf832 Fix cppcheck 1.89+1.90 warnings 2020-01-30 10:36:23 +00:00
matt335672
6f881d47d3 Rationalise ms- constants
Constants from MS documents (MS-RDPBCGR etc) moved out of
common/xrdp_constants.h into includes named after the documents.

Similar includes moved from sesman/chansrv to the common area.
2020-01-06 15:46:37 +00:00
matt335672
3ef2e7ce49 CI Fixes 2019-12-05 16:44:52 +00:00
matt335672
4d8f2b5a31 Significant remote file system improvements
- Reimplemented inode store in separate module chansrv_xfs.[hc]
- Allowed atimes and mtimes to be written to Windows side
- Mapped file user write bit to (inverted) Windows FILE_ATTRIBUTE_READONLY bit
- Mapped file user execute bit to Windows FILE_ATTRIBUTE_SYSTEM bit
- Implemented improved security for remotely mounted drives
- Implemented USB device removal, allowing hot-plug/remove of memory sticks
- Fixed pagefile.sys breaking Ubuntu file browser
- Fixed write offset bug
- Allowed renaming of open files
- Improved reported error codes
- Fixed various memory leaks
- Addressed valgrind errors related to struct fuse_file_info pointers.
2019-12-05 11:41:32 +00:00
matt335672
d154df5059 Add remote drive lookup functionality to fuse
- Replace xfuse_cb_enum_dir() directory callback for adding files with
  more general xfuse_devredir_add_file_or_dir() to be called from a
  directory or a lookup operation.
- Moved XRDP_INODE out of public interface for chansrv_fuse, and replaced
  with simpler struct file_attr to pass to
  xfuse_devredir_add_file_or_dir()
- Allow a struct file_attr to be placed in an IRP for assembly of file
  attributes over multiple IRP_MJ_QUERY_INFORMATION requats.
- Add dev_redir_lookup_entry() to public interface for devredir.c
- Add xfuse_devredir_cb_lookup_entry() callback to public interface for
  chansrv-fuse.c
2019-04-01 14:15:12 +01:00
matt335672
ef9013b4d9 Implement O_WRONLY option for open file
Allows files to be overwritten on Linux without EIO
Logging improved on failed write
2019-04-01 14:14:46 +01:00
matt335672
c43c9cd551 Code tidyups
- Remove unused 'is_synced' member from struct xrdp_inode
- Move prototype for xfuse_devredir_cb_write_file() to correct file
- Add const correctness to dev_redir_strings_ends_with() function
- Add const correctness to fuse_reverse_pathname() function
- Moved devredir_proc_cid_* functions out of devredir.h and made static
- Added XFUSE_DUMP_ADDED_ENTRIES maro for debugging
- Removed duplicate code path in xfuse_remove_dir_or_file()
- Removed duplicate code path in xfuse_cb_rename()
- Removed duplicate code path in xfuse_create_dir_or_file()
- Removed duplicate code path in xfuse_cb_open()
- Removed duplicate code path in xfuse_proc_opendir_req()
2019-04-01 14:14:22 +01:00
Koichiro IWAO
780ba744f6
Revert "devredir: fix xinode leak"
This reverts commit 5daa09171e.

Causes "double free". Fix #990 was not correct.

```
[1271363627]: DEV_REDIR  dev_redir_proc_device_iocompletion: 738 : entered: IoStatus=0x0 CompletionId=1
[1271363627]: DEV_REDIR  dev_redir_proc_device_iocompletion: 839 : got CID_DIRECTORY_CONTROL
[1271363627]: DEV_REDIR  dev_redir_proc_query_dir_response: 933 : processing FILE_DIRECTORY_INFORMATION structs
[1271363627]: DEV_REDIR  dev_redir_proc_query_dir_response: 968 : FileName:          .
[1271363627]: DEV_REDIR  devredir_fuse_data_peek: 1335 : returning 0x7f2a9c013410
*** Error in `/usr/sbin/xrdp-chansrv': double free or corruption (out): 0x00007f2a9c13a330 ***
```

Closes: #1025
2018-03-23 11:40:52 +09:00
Koichiro IWAO
5daa09171e
devredir: fix xinode leak
Pointed out by: #919
2018-01-12 09:24:03 +09:00
Pavel Roskin
6ed4c969f4 Eliminate APP_CC and DEFAULT_CC 2017-03-14 00:21:48 -07:00
Pavel Roskin
b2d3dcf169 Include config_ac.h from all source files 2017-03-04 00:52:34 -08:00
Jay Sorg
a1aff316dc change log message to long long 2017-01-29 23:14:33 -08:00
Jay Sorg
b5029c2596 sesman: fix warning for 32 bit / 64 bit log entry, trunc to 32 bit 2017-01-29 23:14:33 -08:00
Pavel Roskin
e35b5a4708 Constify string arguments in xrdp-chansrv sources 2017-01-22 22:39:10 -08:00
Pavel Roskin
8ee886a5cc Don't log device_data_len in the code where it may be uninitialized
Log device_data_len only in the code that reads it.
2017-01-11 23:25:42 -08:00
Pavel Roskin
9a2e728396 Remove send_channel_data() from devredir.h, it's declared in chansrv.h
Include "chansrv.h" from devredir.c to have send_channel_data()
declaration.
2017-01-11 23:25:42 -08:00
Pavel Roskin
e92c4f3b40 Use constant strings to fix warnings 2016-11-26 09:17:51 -08:00
Pavel Roskin
662172012b Call devredir_cvt_slash() on the path copy, it changes the argument 2016-11-26 09:17:51 -08:00
Pavel Roskin
cbe413bd8b Fix return type of devredir_fuse_data_peek and devredir_fuse_data_dequeue 2016-07-08 04:29:56 +00:00
Pavel Roskin
d1efb0d5ba Fix signed to unsigned comparisons reported by g++ 6.1.0 2016-07-08 04:29:51 +00:00
Pavel Roskin
5829323ad8 Use g_new or g_new0 when C++ compiler would complain about implicit cast 2016-07-08 04:29:49 +00:00
Pavel Roskin
1403652c72 Remove unused variable in devredir_cvt_from_unicode_len() 2016-05-06 18:58:16 -07:00
Pavel Roskin
f2d326cbed Remove unused variables from dev_redir_proc_query_dir_response() 2016-05-06 18:58:16 -07:00
Pavel Roskin
92a6833e9b Fix typos 2016-02-13 20:41:07 -08:00
Laxmikant Rashinkar
1c423dadf4 coverity: copy into fixed sized buffer 2014-07-26 16:33:36 -07:00
Laxmikant Rashinkar
fde7be5151 coverity: fixed issue argument cannot be negative 2014-07-23 19:07:38 -07:00
Laxmikant Rashinkar
0c63a8feb3 coverity: Dereference after null check 2014-07-20 16:36:33 -07:00
Laxmikant Rashinkar
3bb31876e7 coverity: fixed resolution leak issues 2014-07-19 11:56:00 -07:00
Laxmikant Rashinkar
06f01f6c37 Merge branch 'master' of github.com:neutrinolabs/xrdp 2013-09-24 17:19:43 -07:00
Laxmikant Rashinkar
379685bfca FUSE: we now process only one opendir command at a time 2013-09-24 17:19:10 -07:00
Jay Sorg
2d112bac8f chansrv: work on smart card 2013-09-09 12:30:58 -07:00
Jay Sorg
a9f37229ac chansrv: work on smartcard 2013-09-08 14:22:53 -07:00