aboutsummaryrefslogtreecommitdiffstats
path: root/unix
Commit message (Collapse)AuthorAgeFilesLines
* Clean up string encoding handlingPierre Ossman2023-06-303-0/+16
| | | | | | We should handle this in the low-level protocol code as much as possible to avoid mistakes. This way the rest of the code can assume that strings are always UTF-8 with \n line endings.
* Merge branch 'types' of https://github.com/CendioOssman/tigervncPierre Ossman2023-03-0220-143/+117
|\
| * Remove unneeded header from SDesktop.hPierre Ossman2023-02-041-0/+1
| | | | | | | | It doesn't use any exceptions, so stop including the header for it.
| * Use standard C string functionsPierre Ossman2023-02-044-16/+9
| | | | | | | | It's just confusing that we have our own variety that isn't compatible.
| * Remove custom CharArray typePierre Ossman2023-02-041-0/+1
| | | | | | | | | | It has now been replaced, mostly by std::string, so remove the actual type definition.
| * Use std::string instead of CharArrayPierre Ossman2023-02-048-56/+55
| | | | | | | | | | Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
| * Return std::string instead of dynamic allocationsPierre Ossman2023-02-042-18/+7
| | | | | | | | | | | | We mostly use classical C strings, but the memory management around them can get confusing and error prone. Let's use std::string for the cases where we need to return a newly allocated string.
| * Use fixed size character bufferPierre Ossman2023-02-041-11/+12
| | | | | | | | | | We know the needed space here, so let's keep it simple with a constant size string buffer.
| * Remove trailing slash from getvnchomedir()Pierre Ossman2023-02-041-2/+2
| | | | | | | | | | It should return a path to the directory itself, just like its sister function getuserhomedir().
| * Namespace directory functionsPierre Ossman2023-02-041-1/+1
| | | | | | | | All library functions should be in a proper namespace.
| * Return static char buffer from some methodsPierre Ossman2023-02-043-6/+5
| | | | | | | | | | | | | | | | | | This mimics how some system functions (like inet_ntop()) work, and avoids complexity around ownership of the returned string buffer. The downside is that the string must be consumed directly as it will be overwritten on the next call, but that is not an issue with the current usage.
| * Use StringParameters directlyPierre Ossman2023-02-044-17/+9
| | | | | | | | | | We don't need to make extra copies of the string in most cases, so let's simplify the code and access the string directly when we can.
| * Use stdint typesPierre Ossman2023-02-019-23/+22
| | | | | | | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* | SELinux: Allow vncsession create ~/.vnc directoryZdenek Pytela2023-02-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Addresses the following AVC denial: type=PROCTITLE msg=audit(01/12/2023 02:58:12.648:696) : proctitle=/usr/sbin/vncsession fedora :1 type=PATH msg=audit(01/12/2023 02:58:12.648:696) : item=1 name=/home/fedora/.vnc nametype=CREATE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=PATH msg=audit(01/12/2023 02:58:12.648:696) : item=0 name=/home/fedora/ inode=262145 dev=fc:02 mode=dir,700 ouid=fedora ogid=fedora rdev=00:00 obj=unconfined_u:object_r:user_home_dir_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 type=CWD msg=audit(01/12/2023 02:58:12.648:696) : cwd=/home/fedora type=SYSCALL msg=audit(01/12/2023 02:58:12.648:696) : arch=x86_64 syscall=mkdir success=no exit=EACCES(Permission denied) a0=0x7fff47d52540 a1=0755 a2=0x0 a3=0x0 items=2 ppid=2869 pid=2880 auid=fedora uid=fedora gid=fedora euid=fedora suid=fedora fsuid=fedora egid=fedora sgid=fedora fsgid=fedora tty=(none) ses=8 comm=vncsession exe=/usr/sbin/vncsession subj=system_u:system_r:vnc_session_t:s0 key=(null) type=AVC msg=audit(01/12/2023 02:58:12.648:696) : avc: denied { create } for pid=2880 comm=vncsession name=.vnc scontext=system_u:system_r:vnc_session_t:s0 tcontext=system_u:object_r:vnc_home_t:s0 tclass=dir permissive=0 Resolves: rhbz#2143704
* | Sanity check when cleaning up keymap changesPierre Ossman2023-02-091-0/+4
|/ | | | | Make sure we don't send a bogus request to the X server in the (common) case that we don't actually have anything to restore.
* Use __attribute__:s directlyPierre Ossman2023-01-052-19/+11
| | | | | | These are supported by gcc and clang, and I don't think MSVC works well with our code anyway, so let's keep things simple and use these directly.
* Fix incorrect typesPierre Ossman2023-01-052-3/+3
| | | | | These types caused an incorrect signed/unsigned behaviour, so let's make sure we use the appropriate type.
* Fix order of qualifiersPierre Ossman2023-01-051-1/+1
| | | | gcc can get upset if they aren't in this order.
* Explicitly mark unused parametersPierre Ossman2023-01-0412-15/+25
| | | | | This allows us to separate accidentally unused, from explicitly unused parameters, which allows us to turn on such checks in the compiler.
* Mark system include paths correctlyPierre Ossman2023-01-043-3/+3
| | | | | This makes sure the compiler doesn't complain about problems in those files.
* Change development version to 1.13.80Pierre Ossman2022-12-151-1/+1
|
* Improve error message when `passwd `file has a bad permissionTAKAHASHI Shuuji2022-12-141-1/+3
|
* Don't start sessions until there are usersPierre Ossman2022-12-121-1/+1
| | | | | | Delay startup of VNC sessions until user databases are up and running. This is the same ordering that GDM imposes to make sure users can actually log in.
*-. Merge branches 'x0vncserver-keyboard' and 'zaphod-fixes' of ↵Pierre Ossman2022-12-012-10/+175
|\ \ | | | | | | | | | https://github.com/grulja/tigervnc
| | * x0vncserver: update/display cursor only on correct screen in zaphod modeJan Grulich2022-08-241-7/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to check whether we update cursor position/shape only in case the cursor is on our display, otherwise in zaphod mode, ie. when having two instances of x0vncserver on screens :0.0 and :0.1 we would be having the cursor duplicated and actually not funcional (aka ghost cursor) as it would be actually not present. We also additionally watch EnterNotify and LeaveNotify events in order to show/hide cursor accordingly. Change made with help from Olivier Fourdan <ofourdan@redhat.com>
| * | x0vncserver: add new keysym in case we don't find a matching keycodeJan Grulich2022-12-012-3/+122
|/ / | | | | | | | | | | | | | | | | We might often fail to find a matching X11 keycode when the client has a different keyboard layout and end up with no key event. To avoid a failure we add it as a new keysym/keycode pair so the next time a keysym from the client that is unknown to the server is send, we will find a match and proceed with key event. This is same behavior used in Xvnc or x11vnc, although Xvnc has more advanced mapping from keysym to keycode.
* | Don't enable RSA-AES by default in serversPierre Ossman2022-10-142-2/+2
| | | | | | | | | | | | These require a key to have been set up on the server beforehand, so they do not give a good default experience as clients will be unable to connect.
* | Fix SecurityTypes default value in man pagesPierre Ossman2022-09-012-2/+2
| | | | | | | | | | The order is important in the servers, so make sure the man pages follow the code properly.
* | Add support for RSA-AES security typespdlan2022-09-012-4/+24
|/
* Fix typo in previous commitPierre Ossman2022-07-051-1/+1
|
* Fix Xvnc dependency list (again)Pierre Ossman2022-07-051-3/+8
| | | | | | | | | The previous commit was incorrect in that it overrides automake's dependency list, rather than adding to it. So we need to make sure things are duplicated between Xvnc_DEPENDENCIES and Xvnc_LDADD as appropriate. Use the same approach as the Xorg binary to keep things familiar.
* Add missing dependencies for XvncPierre Ossman2022-07-041-0/+1
| | | | | | These aren't crucial for a clean build, but must be set for Xvnc to be properly rebuilt if anything in the Xorg tree changes. automake doesn't properly deduce these automatically from Xvnc_LDADD, unfortunately.
* Change vncsession startup error messagePierre Ossman2022-03-111-1/+1
| | | | | | | We need to get to the point of starting the session script before we consider things a success. So this can fail in many different ways, not just the daemonization. Adjust the error message to something more generic to reflect this.
* SELinux: use /root/.vnc in file context specificationZdenek Pytela2022-02-071-1/+1
| | | | | | Instead of HOME_ROOT/.vnc, /root/.vnc should be used for user root's home to specify default file context as HOME_ROOT actually means base for home dirs (usually /home).
* Improve logging around screen resizingPierre Ossman2022-01-253-13/+4
| | | | | | Avoid duplication, and add logging for some more error conditions so it's possible to see in the logs why a resize has failed or produced unexpected results.
* Log objects should be localPierre Ossman2022-01-211-1/+1
| | | | Otherwise things might be logged under the wrong label.
* Merge branch 'selinux-restorecon' of https://github.com/grulja/tigervncPierre Ossman2022-01-132-1/+17
|\
| * SELinux: restore SELinux context in case of different policiesJan Grulich2022-01-132-1/+17
| |
* | Properly set XDG_CURRENT_DESKTOPPierre Ossman2022-01-101-1/+1
| | | | | | | | There is no such thing as XDG_DESKTOP_NAMES.
* | Update copyright year to 2022Pierre Ossman2022-01-051-1/+1
| |
* | Be consistent in including config.hPierre Ossman2021-12-3018-4/+70
| | | | | | | | | | | | The generally recommended way is to include it from source files, not headers. We had a mix of both. Let's try to be consistent and follow the recommended way.
* | xserver21.1.1.patch: Add Xorg 21 patchJoakim Tjernlund2021-11-261-0/+75
| |
* | xvnc: adapt for 1.21Joakim Tjernlund2021-11-241-4/+2
| | | | | | | | | | VENDOR_STRING is gone as is DEFAULT_LOG_VERBOSITY site.h has been removed and is not needed.
* | xorg-version.h: Increase supported Xorg version to 1.21Joakim Tjernlund2021-11-241-2/+2
| |
* | Fix formatting of -rfbport in man pagesPierre Ossman2021-11-092-4/+4
|/
* Change development version to 1.12.80Pierre Ossman2021-09-081-1/+1
|
* Merge branch 'fb-session-nfs' of https://github.com/zpytela/tigervncPierre Ossman2021-08-262-32/+47
|\
| * Add vnc_home_t typeZdenek Pytela2021-05-182-15/+13
| | | | | | | | | | | | The new vnc_home_t type for HOME/.vnc directory was added to the policy, backed by a name transition. The vnc_session_t domain can manage files and directories of this type.
| * Allow vnc_session_t manage nfs dirs and files conditionallyZdenek Pytela2021-05-181-0/+5
| | | | | | | | | | | | | | The permissions set to manage directories and files with the nfs_t type is allowed when the use_nfs_home_dirs boolean is turned on. Resolves: https://github.com/TigerVNC/tigervnc/issues/1189
| * selinux: further style and comprehensibility improvementsZdenek Pytela2021-05-181-23/+36
| | | | | | | | | | | | Sections and rules blocks reordered according to the Style guide. https://github.com/TresysTechnology/refpolicy/wiki/StyleGuide