Commit Graph

728 Commits

Author SHA1 Message Date
matt335672
cf5e1961d3 os_calls: Add g_setpgid() 2023-05-02 11:55:22 +01:00
matt335672
65ff618479 os_calls: Add g_executable_exist() 2023-05-02 11:55:22 +01:00
matt335672
ff24984cf3 os_calls: Add g_file_is_open() 2023-05-02 11:55:22 +01:00
matt335672
f08355a325 Ensure commonly used file descriptors are close-on-exec 2023-04-24 14:20:14 +01:00
matt335672
1c798cee47 Logging: Add LOG_DEVEL_LOG_LEAKING_FDS 2023-04-24 14:20:14 +01:00
matt335672
d712f3527a os_calls: Add g_get_open_fds() 2023-04-24 11:57:38 +01:00
matt335672
b811fdb36b os_calls: Add g_file_{get,set}_cloexec() functions
Allows us to avoid file descriptor leaks when running a new executable
2023-04-24 11:11:04 +01:00
matt335672
3ee8eb9c9e
Merge pull request #2592 from matt335672/restructure_session_start
Restructure session start
2023-03-27 10:38:37 +01:00
Jay Sorg
2d8b52f744 common: change g_malloc, g_free, g_memset, g_memcpy, and g_memmove to macros 2023-03-25 12:22:19 -07:00
matt335672
8b9f9b40c8 os_calls changes
- Add g_pipe()
- Add g_file_duplicate_on()
- Rework struct exit_status to make it easier to parse
- Add optional status return to g_waitchild()
2023-03-23 18:12:06 +00:00
Nexarian
5273624089 Fixing some comments 2023-03-14 02:02:09 -04:00
matt335672
3bd1820407 Fix regression caused by move to poll() 2023-03-13 20:02:05 +00:00
matt335672
621b3fc6dc Add g_execvp_list() to os_calls 2023-03-06 16:03:55 +00:00
matt335672
c3d697de16 Add list_add_strdup() etc 2023-03-06 15:58:13 +00:00
matt335672
a317c3de5d Fix regression in list module 2023-03-06 15:47:49 +00:00
Nexarian
89e178e7c9 Add function to split string into list.
- With working unit tests.
2023-03-03 18:33:33 -05:00
matt335672
86d0d0e9fd Addressed review comments 2023-02-13 14:28:29 +00:00
matt335672
78fa1c15b2 Replace select() system call with poll()
poll() is specified in POSIX.1-2001 as a simpler interface for
multiplexed file descriptors than select(). It also provides more
functionality.

This PR replaces the select() calls used in xrdp with poll()
equivalents.
2023-02-13 14:28:29 +00:00
matt335672
5aa5624551 Add memory allocation checking to the list module
The list module lacks memory allocation checking, and
consequently can coredump on list_create() or
list_add_item().
2023-02-13 10:37:46 +00:00
Derek Schrock
1e5b42893c Add g_set_alarm to set an alarm calling func after secs seconds 2023-02-11 18:01:12 -05:00
metalefty
c463a0e865
Merge pull request #2541 from metalefty/log_time
log: fix syslog glitch after #2386
2023-02-10 09:06:12 +09:00
Koichiro IWAO
ec2f165af4 log: fix syslog glitch after #2386
The tail of new datetime format was sticking out.
2023-02-09 17:09:28 +09:00
Nexarian
7542dfc4f2
Merge pull request #2533 from Nexarian/Nexarian/update-pixman-region-header
Add functions and reformat pixman-region.h
2023-02-05 19:16:53 -05:00
Nexarian
7520c69049 Add functions and reformat pixman-region.h
- Update pixman-region.h header
-- Reformat so all lines fit within 80 characters.
-- Update define guard to use convention for the rest of XRDP.

Add pixman_region_not_empty and pixman_region_extents in anticipation of
using it for EGFX in the future.
2023-02-04 15:07:13 -05:00
matt335672
a5034e3572 Implement g_sck_send_fd_set() and g_sck_recv_fd_set() 2023-01-30 14:31:16 +00:00
matt335672
1fbcdffff1 Use unsigned int for some data lengths 2023-01-30 14:31:16 +00:00
Nexarian
db5ea2f214 Initial EGFX tests.
- Rearranging imports.
- Remove unnecessary check to g_is_wait_obj_set.
- Use g_get_term everywhere.
- Misc updates.
2023-01-23 23:05:24 -05:00
matt335672
48e46d183a Add g_setallusercontext() for *BSD systems 2023-01-05 10:52:08 +00:00
matt335672
47ace4acfd Fix g_sck_get_peer_cred() on FreeBSD
Socket level should be SOL_LOCAL rather than SOL_SOCKET - See
'man unix'.
2022-12-22 11:35:02 +00:00
matt335672
a16e56f711 Add function to get user information by UID
Moving to a uid_t to store the user information makes a lot
of sense. When doing this, we need a function to get information
about a user from the uid_t

As well as creating the function g_getuser_info_by_uid() we also
rename g_getuser_info() to g_getuser_info_by_name() and make the
parameter ordering more usual.
2022-12-22 11:35:02 +00:00
matt335672
a4fb635a5d
Merge pull request #2453 from matt335672/update_kerberos
Fix the kerberos module
2022-12-14 10:44:31 +00:00
matt335672
cce78b0698
Merge pull request #2407 from alexpevzner/devel
LogFile=- redirects log to stdout, which is useful for debugging
2022-12-12 20:33:04 +00:00
matt335672
df83fbf9bf Fix const-correctness for g_system() 2022-12-12 19:52:27 +00:00
matt335672
b1147f5faa CVE-2022-23479
Detect attempts to overflow input buffer

If application code hasn't properly sanitised the header_size
for a transport, it is possible for read requests to be issued
which overflow the input buffer. This change detects this
at a low level and bounces the read request.
2022-12-09 17:34:25 +00:00
matt335672
c3bb7dc294 guid_new() returns GUIDs compatible with RFC4122 2022-11-10 14:19:19 +00:00
matt335672
3a0a932472 Add --reload option to sesman
Adds a --reload switch to sesman and plumbs this in
to systemctl reload xrdp-sesman.service
2022-11-09 09:46:36 +00:00
Alexander Pevzner
79d6219d9d Code formatting fixed 2022-11-04 22:18:02 +03:00
metalefty
cc43061ed4
Merge pull request #2401 from metalefty/codec_guid
Record codec GUID to identify unknown codec
2022-11-04 16:13:30 +09:00
Koichiro IWAO
9120dc9a66 Update header comments 2022-11-04 16:06:50 +09:00
Alexander Pevzner
d6e888cf38 Use LogFile=<stdiut> instead of LogFile=- to redirect log to stdout 2022-11-03 14:44:58 +03:00
Alexander Pevzner
59ca0e1c58 LogFile=- redirects log to stdout, which is useful for debugging 2022-11-02 17:00:44 +03:00
Koichiro IWAO
32da5a7ed6 Replace guid_to_str() with ms_guid_to_str() 2022-11-02 00:20:31 +09:00
Koichiro IWAO
44c977a7c2 Use 8-4-4-4-12 rather than 8-4-4-16 for GUID textual representation 2022-11-01 22:57:07 +09:00
Koichiro IWAO
791f055e18 common: add function to convert from Microsoft's GUID to string 2022-11-01 19:24:02 +09:00
Koichiro IWAO
ece8fd2946 Add CODEC_GUID_IGNORE
ref. https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/86507fed-a0ee-4242-b802-237534a8f65e
2022-11-01 19:24:02 +09:00
matt335672
18c5538781 Add casts required for C++ CI and OpenSSL 3.x 2022-10-20 09:56:23 +01:00
Koichiro IWAO
662011a757 log: add some more comments 2022-10-11 09:56:40 +09:00
Koichiro IWAO
db96239982 log: quit using lrint and -lm 2022-10-11 09:56:36 +09:00
Koichiro IWAO
aca05c4f2e log: change date format to ISO8601-like
Former format:  "[20221007-16:36:02] "
New format:     "[2022-10-07T16:36:04.357+0900] "
2022-10-11 09:55:33 +09:00
sefler
cb2b32e6c5 fix code review issues 2022-09-15 23:55:23 +08:00