Commit Graph

1167 Commits

Author SHA1 Message Date
Koichiro Iwao
a6199e8510
clipboard: tidy up bmp file header assembly
Sponsored by:   Krämer Pferdesport GmbH & Co KG

(cherry picked from commit e070902310)
2024-06-18 21:56:30 +09:00
Koichiro Iwao
57cf5c19b7
clipboard: fix a bug when pasting image to LibreOffice
While here, embed correct file size in BMP file header.

Fixes:          #3102
Sponsored by:   Krämer Pferdesport GmbH & Co KG

(cherry picked from commit 4968a34cd6)
2024-06-18 21:56:19 +09:00
matt335672
c98289732e
Merge pull request #3103 from matt335672/fix_display_list
Fix session list processing
2024-06-03 09:42:28 +01:00
matt335672
70f1b685ba Fix session list processing
The get_sorted_session_displays() is broken in that it
doesn't produce a sorted list of displays.

The problem is the qsort comparison function which has 2 errors in 4 lines:-
1) The test is the wrong way round (i.e. arg1 < arg2 produces a +ve
   result instead of -ve)
2) Subtracting two unsigned ints in C will never return < 0

The broken function has been masked by other display checks which mean
that it is only visible in a few situations:-
1) Starting two sessions very closely to each other may allocate the
   same display to both sessions.
2) If /tmp is namespaced, the other display checks do not work, and
   more than two sessions cannot be started.
2024-06-01 10:31:58 +01:00
matt335672
5f91eec695 Remove duplicate enable&disable func registration 2024-05-30 12:19:20 +01:00
matt335672
f0069456f9 Remove the wait for the ibus daemon to start
The initial implementation of Uinicode input via IBus used a startup delay
of 3 seconds to wait for the daemon to be ready before connecting to it.

This commit introduces a poll-wait loop which can remove the delay
entirely if the daemon is up when chansrv starts the interface.
2024-05-23 16:35:53 +01:00
matt335672
e0a1339b34 chansrv FUSE fixes
1) [Regression] If the specified mountpoint is not immediately below an
   existing directory, the directory is not created.
2) The message to ask the user to unmount an existing mounted directory
   has been moved to the right place.
2024-05-21 12:33:17 +01:00
sefler
4599ac7bf6 apply patch generated by matt 2024-05-05 10:44:19 +08:00
seflerZ
c42a09709e fix a bug in returning the init result. 2024-05-05 10:44:19 +08:00
matt335672
1e78b42022 Fix CI errors using C++ compiler 2024-05-05 10:44:19 +08:00
matt335672
a2064e51c1 Some changes to Unicode input processing
- xrdp is not now built with XRDP_IBUS to allow other input
  methods to be more easily supported.
- chansrv is only aked to start an input method if the client
  supports it.
- chansrv sends a status report back to xrdp when asked to start
  and input method.
- ./configure without --enable-ibus now works.
2024-05-05 10:44:19 +08:00
seflerZ
b623766503 remote uncessary conditional compilation 2024-05-05 10:44:19 +08:00
seflerZ
8c98ed4a58 add conditional compilation annotations 2024-05-05 10:44:19 +08:00
seflerZ
bcd690f037 code refactored 2024-05-05 10:44:19 +08:00
seflerZ
3b1cc551e4 format code 2024-05-05 10:44:19 +08:00
seflerZ
d4e2e0a093 It works now 2024-05-05 10:44:19 +08:00
seflerZ
bea72150fb change parameter types 2024-05-05 10:44:19 +08:00
seflerZ
a8c075e84e refine makefile 2024-05-05 10:44:19 +08:00
seflerZ
97138d5bad add missing code 2024-05-05 10:44:19 +08:00
sefler
7bea1f9d56 compile suscceed 2024-05-05 10:44:19 +08:00
matt335672
20b90c1098 Initial support for ibus input from chansrv 2024-05-05 10:44:19 +08:00
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
matt335672
200e4d84f4 Fix permissions on user socket directory
The user socket directory needs to be SGID so that they inherit
the group ownnership. Then xrdp can write to them.
2024-03-22 10:44:19 +00:00
matt335672
b2c0c506e8
Merge pull request #2745 from matt335672/wtmp
Add utmp/wtmp support
2024-02-21 14:22:16 +00:00
Koichiro Iwao
ae249c6755 Bump copyright year and make easier to bump 2024-02-21 19:09:34 +09:00
matt335672
8cea9b03ab Replace g_strncpy() with str2memcpy()
g_strncpy() is the wrong function for copying strings in struct utmp[x]
as it always terminates strings.

strncpy() itself would be a good choice, but is marked by many compilers
as being unsafe to use.

str2memcpy() is taken from util-linux, and is exactly right for this
application.
2024-02-21 09:24:48 +00:00
matt335672
b53c683edf Allow some utmpx fields to be optional
POSIX.1 doesn't define ut_host in struct utmpx. Also, Linux has support
for an exit status value in ut_exit. This commit adds conditional code
for both ut_host and ut_exit to maximise portability.
2024-02-21 09:24:48 +00:00
matt335672
04c67a5039 Set ut_id field
The utmp record is generally looked up by the ut_id field. Setting
this field means we can use a blank username and host when the
session exits
2024-02-21 09:24:48 +00:00
matt335672
98d6545566 Don't use DEAD_PROCESS/USER_PROCESS for add_xtmp_entry
If we're not compiling with USE_UTMP, these defines will not
be available
2024-02-21 09:24:48 +00:00
matt335672
3b6c9bcba3 Add --enable-utmp to configure.ac 2024-02-21 09:24:48 +00:00
matt335672
bf53a76ea1 Remove wtmp updating code 2024-02-21 09:24:48 +00:00
matt335672
bc9b35c38c Rename struct exit_status in os_calls
This conflicts with struct exit_status in <utmp.h>
2024-02-21 09:24:48 +00:00
BLINDAUER Emmanuel
da0f3cefd7 Move some definitions, and small fixes 2024-02-20 17:37:11 +00:00
BLINDAUER Emmanuel
22f17ad123 More g_* functions usage
Follow coding standard
2024-02-20 17:37:11 +00:00
BLINDAUER Emmanuel
58b3989655 don't forget a free
use g_*
2024-02-20 17:37:11 +00:00
Blindauer Emmanuel
547388ddce Add support for FreeBSD 2024-02-20 17:37:11 +00:00
Koichiro IWAO
eaffeaf53f cosmetic changes 2024-02-20 17:37:10 +00:00
Koichiro IWAO
e32671cd79 Include sys/time.h to use gettimeofday() 2024-02-20 17:37:10 +00:00
BLINDAUER Emmanuel
bacda80492 WIP utmp/wtmp
- renamed the two files, including the header was conflicting with official headers
- configure look for utmp/utmpx headers, wo we know which struct to use
- reworked the usage for linux, works mostly (last still showing 'gone' for loggued users)
2024-02-20 17:37:10 +00:00
Koichiro IWAO
56eec32b7e os_calls.h needs to be included to use g_snprintf() 2024-02-20 17:37:10 +00:00
Koichiro IWAO
3ea306249b don't forget include utmp.h 2024-02-20 17:37:10 +00:00
Koichiro IWAO
c103d2308b sesman: add utmp files to makefile 2024-02-20 17:37:10 +00:00
Koichiro IWAO
42388ca009 remove trailing space 2024-02-20 17:37:10 +00:00
BLINDAUER Emmanuel
895fe28961 Initial support for utmp/wtmp on linux 2024-02-20 17:37:10 +00:00
metalefty
45fd497645
Merge pull request #2891 from neutrinolabs/gfx_mainline_merge_work
Gfx mainline merge work
2024-02-08 21:50:16 +09:00
Koichiro Iwao
47d4ab1339 Apply astyle 3.4 code formatter 2024-02-08 15:52:54 +09:00
Nexarian
584a894490 Add 0 as valid g_obj_wait timeout instead of having it be equivalent to -1. 2024-01-31 19:08:29 -05:00
matt335672
b80f07d2a7 Improve portability
- Use clearenv() if it exists
- Don't rely on <limits.h> being pulled in by <sys/param.h>
- Rename the DEFAULT_TYPE macro in sesrun.c.  This name appears to be
  used on Solaris. It's not a good choice.
2024-01-11 11:16:06 +00:00
matt335672
e529a04d26 Fix session_list scanning where some entries were skipped 2023-12-23 13:10:31 +00:00