aboutsummaryrefslogtreecommitdiffstats
path: root/unix/vncserver
Commit message (Collapse)AuthorAgeFilesLines
* Remove incorrect umask changePierre Ossman2020-09-071-3/+0
| | | | | | | Not sure why this got in there, but it is incorrect as it results in creating files with too liberal permissions. (cherry picked from commit 68f5097fd531b7c3429bc41e982e939c455f0c81)
* Comment on SELinux rule affect other commandsPierre Ossman2020-08-171-0/+1
| | | | | | This line affects every command run by the user, unlike everything else in our policy which is just for vncserver/vncsession. It's easy to miss this so add a comment pointing it out.
* Merge branch 'vnc_home' of https://github.com/wrabcak/tigervncPierre Ossman2020-08-172-5/+18
|\
| * [SELinux] Allow vnc session create ~/.vncLukas Vrabec2020-07-312-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow vnc session labeled with SELinux vnc_session_t domain to create directory in user homedir ~/.vnc labeled with SELinux label xdm_home_t. Because also process vncpasswd creates ~/.vnc directory, file transition that userdomain attribute SELinux domain (label for the process) can create the directory with the same label needs to be added. userdomain attribute contains following SELinux types: auditadm_t dbadm_t guest_t logadm_t secadm_t staff_t staff_wine_t sysadm_t unconfined_t user_t user_wine_t webadm_t xguest_t Signed-off-by: Lukas Vrabec <lvrabec@redhat.com>
* | vncserver: Display check should confirm UNIX domain socket is still validMark Mielke2020-07-291-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the X server is not shut down cleanly, it can leave UNIX domain sockets around that "vncserver" has previously mis-identified as evidence that the display number is still in use. Instead of checking for existence of /tmp/.X11-unix/X<n>, the code will now attempt to connect to the socket to confirm that there is a server process listening on this UNIX domain socket. This will eliminate false positives in the case the UNIX domain socket still exists but is not associated with a listening Xorg server. The Xorg server does not have a problem with fixing this file when it next starts up. It is only important to avoid using the port if it is still in use.
* | vncserver: Display check should be re-factored for Perl 5Mark Mielke2020-07-291-36/+6
| | | | | | | | | | | | | | | | The display check and related setup code was complex due to compatibility with Perl 4. This included different ways of obtaining system constants and building system data structures. Perl 5 provides direct constants and utility methods to abstract this out of the vncserver code.
* | vncserver: Display check should confirm lock file is still validMark Mielke2020-07-291-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the X server is not shut down cleanly, it may leave lock files around that "vncserver" has previously mis-identified as evidence that the display number is still in use. Instead of checking for existence of /tmp/.X<n>-lock, the code will now extract the PID from the lock file and confirm that a process exists with the same PID. This will eliminate false positives in the case that this file references a PID that no longer exists. The Xorg server does not have a problem with fixing this file when it next starts up. It is only important to avoid using the port if it is still in use.
* | vncserver: Display check should avoid duplicate codeMark Mielke2020-07-291-14/+10
| | | | | | | | | | | | The display check had duplicate code to first check if the X11 port is not in use, and then check that the RFB port is not in use. Eliminate the duplicate code by using a for-loop.
* | vncserver: Display check should use named variablesMark Mielke2020-07-291-6/+13
| | | | | | | | | | | | | | Several calculated values such as file paths and port numbers were hard coded within strings or expressions, sometimes multiple times. These values should be extracted into named variables to improve self-documentation and avoid accidental divergence.
* | vncserver: Display check should check for lock file firstMark Mielke2020-07-291-6/+6
| | | | | | | | | | | | Checking for the existence of `/tmp/.X<n>-lock` is a fast read-only operation, while calls to bind() or connect() are more expensive and may have side effects. Perform the fast operation first.
* | vncserver: Remove legacy HP-UX supportMark Mielke2020-07-291-7/+0
|/ | | | | | The check for existence of `/usr/spool/sockets/X11/<n>` has been removed. This file is only relevant on HP-UX, and TigerVNC dropped support for HP-UX in commit 31e5aa3.
* Remove trailing spaces in user nameJan Grulich2020-07-031-1/+1
| | | | | | | It's quite easy to make a mistake and add an additional space when configuring users in the vncserver.users config file. You will then get an error that the user doesn't exist and it's hard to spot the mistake. Same applies for a space before the display number.
* [SELinux] Allow vnc_session_t type execute itselfLukas Vrabec2020-05-061-0/+2
| | | | | | | | vncsession-start is running in SELinux vnc_session_t domain because of "SELinuxContext=system_u:system_r:vnc_session_t:s0" option in systemd vncserver@.service unit file. vncsession-start executing binary vncsession with SELinux label/type vnc_session_t. This access was not allowed in vncsession policy.
* Use standard install dir variable namesPierre Ossman2020-03-125-14/+14
| | | | | This makes our builds directly compatible with most distributions without packagers/users having to specify extra flags.
* Add SELinux policy file for vncsessionPierre Ossman2020-03-125-0/+104
| | | | | | Running as a service on a SELinux system requires rules so we can transition to our own context. We also need the proper permissions to start new user sessions.
* Start sessions via PAMPierre Ossman2020-03-129-137/+755
| | | | | | | | | This sets up a more correct session as there are key tasks that need to be performed by PAM. E.g. systemd will allocate cgroups and start base services. In order to easily handle this as a system service the mapping of displays is now done via a configuration file.
* Stop searching for XvncPierre Ossman2020-03-122-31/+3
| | | | | Assume we are part of a complete and proper installation and encode the full expected path in to the vncserver script.
* Start the sessions using xinitPierre Ossman2020-03-122-88/+20
| | | | | It keeps much better track of the X server and startup files than we can do.
* Make vncserver always run in the foregroundPierre Ossman2020-03-122-204/+8
| | | | | | We need to be started as a system service for things to work correctly anyway, so delegate the work of starting and stopping things to the system service manager (e.g. systemd).
* Start sessions using session desktop filePierre Ossman2020-03-122-88/+126
| | | | | This is how display managers (e.g. gdm or lightdm) start sessions and is necessary to get the proper set of environment variables.
* Don't create a default user configPierre Ossman2020-03-121-20/+0
| | | | | We don't want to create files in the users home directory unless we have to. Users can read about how this file works in our man pages.
* Don't accept arbitrary arguments to vncserverPierre Ossman2020-03-123-244/+19
| | | | | We now have config files for more fine grained control of these things, so avoid duplicating the functionality.
* Stop unsetting environment variablesPierre Ossman2020-03-121-2/+0
| | | | | These might contain values we want if we are start from a proper environment.
* Always install systemd servicesPierre Ossman2020-03-122-0/+51
| | | | | | | It is the most common init system these days so it should not be hidden in the contrib/ directory. This also removes all old SysV files from the contrib packages.
* Add default configuration filesPierre Ossman2020-03-125-0/+237
| | | | Install some example files to make things more easily discoverable.
* Don't background the main session commandPierre Ossman2019-12-091-1/+1
| | | | | | When used with -fg we expect the startup script to remain running until the session is over. This will not happen if the session command is put in the background using &.
* Do not return returncode indicating error when listing sessionsJan Grulich2019-07-111-1/+1
|
* Remove Java web serverPierre Ossman2018-10-091-8/+0
| | | | | Applets don't work anymore so remove everything that has to do with serving them.
* Make sure auth argument is escapedOliver Gondža2018-02-201-1/+1
|
* Do not depends on mcookie commandKoichiro IWAO2016-10-051-2/+18
| | | | | | | | for operating systems other than GNU/Linux. mcookie is a part of util-linux. Usually only GNU/Linux systems have it. Do not die even if mcookie is not found. Use the previous pure perl code to generate cookie as fallback.
* remove trailing spaceKoichiro IWAO2016-10-031-5/+5
|
* Merge branch 'system-wide-config' of https://github.com/jblaine/tigervncPierre Ossman2016-08-221-93/+130
|\
| * Support both defaults and mandatory system config filesJeff Blaine2016-08-211-93/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces support for optional basic system-wide configuration of vncserver. The format and syntax of /etc/tigervnc/vncserver* match that of $HOME/.vnc/config exactly. Allows /etc/tigervnc/vncserver-config-defaults as well as /etc/tigervnc/vncserver-config-mandatory. The former is optional and sets user-overrideable vncserver settings. The latter is optional, but if it exists takes precedence over all user $HOME/.vnc/config settings of the same setting name. In the case where /etc/tigervnc/vncserver-config-mandatory overrides a setting in $HOME/.vnc/config, the user will be warned that it has happened. WARNING: Settings in /etc/tigervnc/vncserver-config-mandatory are easily subverted by passing args to vncserver on the CLI. The man page indicates this warning. This commit also introduces (should have been separate) examination of all config file settings (not just @ARGV!) when determining whether or not $HOME/.vnc/passwd needs to be created. That is, if /etc/tigervnc/vncserver* or $HOME/.vnc/config indicate that we are NOT using VNC-native authentication, then we don't need a $HOME/.vnc/passwd created. Code cleanup: $xstartup was renamed $xstartupFile for consistency with other "file" variable names. For VNC-auth checking, to determine if $HOME/.vnc/passwd needed creation, the 3-string check against lc($arg2) was in 2 places and was changed to a simple grep against the new @vncAuthStrings
* | Merge branch 'clipboard'Pierre Ossman2016-07-081-2/+0
|\ \
| * | Don't start vncconfig from vncserver anymorePierre Ossman2016-02-051-2/+0
| |/ | | | | | | The helper is no longer needed for clipboard support.
* / Properly name filehandle based on context of codeJeff Blaine2016-05-231-3/+3
|/ | | Old harmless copy/paste from code above left code confusing as it was reusing the filehandle "XSTARTUP" to write out $vncUserDir/config. This new small change uses a more topical filehandle name for the task at hand.
* Set up Xauthority using a single invokationPierre Ossman2015-12-291-2/+4
|
* Use mcookie to generate X server cookiePierre Ossman2015-12-291-19/+4
|
* Check that xauth is in PATHPierre Ossman2015-12-291-17/+1
| | | | | The rest of the code assumes xauth is in PATH, so let's check for that instead.
* option -xstartup addedLlorenç Garcia Martinez2015-10-301-11/+16
|
* Merge branch 'patch-1' of https://github.com/Siot/tigervncPierre Ossman2015-10-301-13/+28
|\
| * new option -noxstartup to not load any xstartup script fileLlorenç Garcia Martinez2015-10-231-13/+28
| |
* | update vncserver to parse a config filegraysky2015-10-191-11/+63
|/
* vncserver: Clean pid files of dead processes.Michal Srb2015-10-021-1/+7
| | | | | When Xvnc fails to start, delete the pid file. Clean pid files of dead processes when listing them as well.
* Start a hidden rather than minimised vncconfigPierre Ossman2015-07-301-1/+1
| | | | | This is plumbing that we shouldn't have to annoy the user with a separate window for.
* Remove bogus -geometry width/height adjustment from vncserver scriptAdam Tkac2013-03-141-8/+0
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5061 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Launch vncconfig directly from vncserver, not from xstartup. Justification: ↵DRC2011-10-051-1/+2
| | | | | | vncconfig is necessary to enable basic functionality of the TigerVNC system (clipboard transfer, most notably.) It isn't always going to be in the PATH, and in fact, there might be more than one version of it on the system (for instance, a version from RealVNC in /usr/bin and a version from TigerVNC in /opt/TigerVNC/bin.) If it is desirable to disable vncconfig under certain circumstances, then I would suggest adding a command-line option to vncserver to accomplish that. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4709 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Always look for the Java classes in ../vnc/classes first before looking in ↵DRC2011-10-041-3/+4
| | | | | | the system locations. This prevents TigerVNC from picking up the Java classes from a RealVNC installation. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4691 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Merged r4361 from 1_1 branch.Adam Tkac2011-04-271-4/+14
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4384 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Merged r4342 - r4359 from 1_1 branch.Adam Tkac2011-04-271-14/+42
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4383 3789f03b-4d11-0410-bbf8-ca57d06f2519