aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'types' of https://github.com/CendioOssman/tigervncPierre Ossman2023-03-02297-5504/+4469
|\
| * Merge "Pixel" type in to PixelFormat headerPierre Ossman2023-02-185-30/+3
| | | | | | | | | | It's a type specific to that class, so let's keep them close for clarity.
| * Use operator overloading for comparisonPierre Ossman2023-02-0421-31/+44
| | | | | | | | | | It is much more natural than custom methods for this very common operation.
| * Warn if Point/Rect/Region methods are used wrongPierre Ossman2023-02-042-9/+24
| | | | | | | | | | | | It is easy to get confused if these methods modify the existing object, or return a new one. So let's mark the return value as critical so the compiler can help out if someone gets it wrong.
| * Avoid redefining errnoPierre Ossman2023-02-042-12/+12
| | | | | | | | | | | | This can have unexpected consequences as some code may rely on it being a simple variable. Instead to what we do in Socket, which is to define a unique name for getting socket error numbers.
| * Remove unneeded header from SDesktop.hPierre Ossman2023-02-044-3/+3
| | | | | | | | It doesn't use any exceptions, so stop including the header for it.
| * Remove unused rfb/util.h includesPierre Ossman2023-02-0429-12/+19
| | | | | | | | | | | | | | | | These files don't use anything from this header, so remove the include. This exposes some missing includes in other places, though. So add an explicit include in the files that were relying on an indirect inclusion.
| * Remove "str" prefix from string helpersPierre Ossman2023-02-0414-67/+66
| | | | | | | | | | This matches the naming in STL, which is what we are mostly mimicing now that we are using std::string for these functions.
| * Use standard C string functionsPierre Ossman2023-02-046-50/+9
| | | | | | | | It's just confusing that we have our own variety that isn't compatible.
| * Remove custom CharArray typePierre Ossman2023-02-046-47/+6
| | | | | | | | | | It has now been replaced, mostly by std::string, so remove the actual type definition.
| * Use std::string for string memory managementPierre Ossman2023-02-0417-97/+66
| | | | | | | | | | Avoids a bit of complexity by delegating that handling to a string object.
| * Use std::string instead of CharArrayPierre Ossman2023-02-0458-375/+391
| | | | | | | | | | Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
| * Use std::vector for temporary char arraysPierre Ossman2023-02-045-39/+37
| | | | | | | | | | | | | | | | It's more standard and familiar than our custom CharArray type, and it still gives us automatic freeing of the buffer. We could probably have used std::unique_ptr instead, but we are currently targeting older compilers where C++11 isn't standard yet.
| * Free char buffer directlyPierre Ossman2023-02-044-16/+24
| | | | | | | | | | It's extreme overkill to inherit from CharArray just to get the automatic freeing of the buffer when the object is destroyed.
| * Make strSplit() simpler and saferPierre Ossman2023-02-0411-123/+90
| | | | | | | | | | | | | | Get rid of all the magical re-allocation and shuffling and instead just return a new set of strings that is fully splitted. Will consume a bit more memory, but is a lot safer to use as there is less confusion about ownership of memory.
| * Return std::string instead of dynamic allocationsPierre Ossman2023-02-0447-450/+357
| | | | | | | | | | | | 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.
| * Specify expected array size in argumentsPierre Ossman2023-02-042-4/+4
| | | | | | | | | | The compiler doesn't enforce this, but it at least documents the expected array size.
| * Use fixed size character bufferPierre Ossman2023-02-0411-84/+74
| | | | | | | | | | 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-045-12/+12
| | | | | | | | | | It should return a path to the directory itself, just like its sister function getuserhomedir().
| * Namespace directory functionsPierre Ossman2023-02-047-28/+32
| | | | | | | | All library functions should be in a proper namespace.
| * Better fallback for missing peer addressPierre Ossman2023-02-041-3/+3
| | | | | | | | | | | | A blank string might be very confusing, depending on where this will be used. Let's give something more visible back in the cases where we cannot get the proper name for the peer.
| * Return static char buffer from some methodsPierre Ossman2023-02-0424-137/+111
| | | | | | | | | | | | | | | | | | 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.
| * Replace tabs with spacesPierre Ossman2023-02-041-45/+45
| | | | | | | | Use the same indentation we use in all other files.
| * Use string literal instead of dynamic bufferPierre Ossman2023-02-042-8/+8
| | | | | | | | | | These don't need to be changed, so let's just keep it simple with a constant string literal.
| * Remove unneded string duplicationPierre Ossman2023-02-041-8/+1
| | | | | | | | | | It's unclear why this was initially added. The function takes string constants, so it is not going to modify these.
| * Remove unneeded CharArray:sPierre Ossman2023-02-043-22/+18
| | | | | | | | | | Avoid complicating things by moving things in to a second buffer here as there is no need for it.
| * Use StringParameters directlyPierre Ossman2023-02-0420-75/+40
| | | | | | | | | | 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.
| * Get rid of TCHAR magicPierre Ossman2023-02-0468-700/+453
| | | | | | | | | | We never use Windows' "UNICODE" mode anyway, so let's get rid of this complexity.
| * Return std::vector instead of dynamic allocationPierre Ossman2023-02-048-40/+35
| | | | | | | | | | This makes memory management more clear and robust when using these helper functions.
| * Avoid duplicating configuration settingPierre Ossman2023-02-041-16/+7
| | | | | | | | | | Let the string helpers call the more fancy setParam(). This makes sure we can avoid duplicating things.
| * Make sure length is reset on assignmentPierre Ossman2023-02-041-1/+3
| | | | | | | | | | Otherwise the old length is preserved, which will result in NULL pointer dereferencing if the parameter is ever accessed.
| * Clean up BinaryParameter typingPierre Ossman2023-02-043-16/+21
| | | | | | | | | | This is explicitly a byte sequence, so let's try to keep a consistent typing.
| * Move hex conversion helpers to utilPierre Ossman2023-02-049-88/+109
| | | | | | | | | | These are used here and there so let's make them more general rather than hiding them in the stream classes.
| * Use std::vector for basic data arraysPierre Ossman2023-02-0113-212/+150
| | | | | | | | | | Avoid our own custom types in favour of what's already included with C++.
| * Use stdint typesPierre Ossman2023-02-01151-1086/+1114
| | | | | | | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
| * Use templates for optimized codePierre Ossman2023-02-0131-2062/+1582
| | | | | | | | | | Avoid preprocessor magic and instead rely on templating to generate optimized functions for performance critical code.
* | Merge branch 'vncsession-create-homedir' of https://github.com/zpytela/tigervncPierre Ossman2023-02-281-0/+1
|\ \
| * | 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
* | | Merge branch 'master-clipboard-check-state-before-access' of ↵Pierre Ossman2023-02-281-3/+3
|\ \ \ | | | | | | | | | | | | https://github.com/MarkMielke/tigervnc
| * | | VNCSConnectionST clipboard functions should check state before access.Mark Mielke2023-02-201-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Clipboard functions may run on connections that are not yet at RFBSTATE_NORMAL. Due to recent hardening of the accessCheck() function, it is important to validate that the state is RFBSTATE_NORMAL before calling accessCheck(). Fixes #1599.
* | | Throw exception instead on bad access checkPierre Ossman2023-02-281-2/+2
| | | | | | | | | | | | | | | | | | An assert will kill the entire server, which is overly harsh when there is a problem with a single connection. Instead, throw an exception which will just disconnect that specific client.
* | | Update Serbian translationМирослав Николић2023-02-271-234/+277
|/ /
* | 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.
* | Update Friulian translationFabio T2023-02-031-324/+684
| |
* | Remove old mingw CMake checksPierre Ossman2023-01-302-10/+0
|/ | | | | This should have been removed with the code using these defines in 03ca975.
* Fix CRLF line endingsPierre Ossman2023-01-175-442/+442
| | | | Everything else uses LF line endings, so fix up the few stray ones.
* Merge branch 'libtool' of https://github.com/CendioOssman/tigervncPierre Ossman2023-01-102-25/+79
|\
| * Create .la files at the end of the cmake runPierre Ossman2023-01-102-11/+34
| | | | | | | | | | We might not have all the necessary information, e.g. all targets might not exist yet, until we're done going through all CMakeLists.
| * Bail on missing librariesPierre Ossman2023-01-101-2/+2
| | | | | | | | They may be crucial, so refuse to continue if this happens.
| * Fall back to dynamic libraries in .la filesPierre Ossman2023-01-101-3/+7
| | | | | | | | | | This is what the linker does, so we should do the same for correct behaviour.