aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
author90 <hi@90.gripe>2024-04-26 16:22:03 +0100
committer90 <hi@90.gripe>2024-04-26 16:22:03 +0100
commit337c136ce018fc8d9d12b9e188634925238d11cc (patch)
tree5733614d537fa373cc5376cdc9b8e29a8de4432c /vncviewer
parent119a5ff7d2e2543e51947d35be7c5f84f74b3243 (diff)
downloadtigervnc-337c136ce018fc8d9d12b9e188634925238d11cc.tar.gz
tigervnc-337c136ce018fc8d9d12b9e188634925238d11cc.zip
Implement XDG Base Directory paths, deprecate ~/.vnc
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/.gitignore1
-rw-r--r--vncviewer/vncviewer.cxx13
-rw-r--r--vncviewer/vncviewer.man31
3 files changed, 35 insertions, 10 deletions
diff --git a/vncviewer/.gitignore b/vncviewer/.gitignore
index feba068d..db3cc77d 100644
--- a/vncviewer/.gitignore
+++ b/vncviewer/.gitignore
@@ -1,3 +1,4 @@
vncviewer
vncviewer.desktop.in
vncviewer.desktop
+org.tigervnc.vncviewer.metainfo.xml
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx
index c5d6082e..59be4812 100644
--- a/vncviewer/vncviewer.cxx
+++ b/vncviewer/vncviewer.cxx
@@ -745,13 +745,18 @@ int main(int argc, char** argv)
migrateDeprecatedOptions();
+ char *confdir = strdup(os::getvncconfigdir());
#ifndef WIN32
- // Check if config and state dirs are both the same legacy ~/.vnc dir
- struct stat st;
- if (stat(os::getvnchomedir(), &st) == 0)
- vlog.info(_("~/.vnc is deprecated, please migrate to XDGBDS-compliant paths!"));
+ char *dotdir = strrchr(confdir, '.');
+ if (dotdir != NULL && strcmp(dotdir, ".vnc") == 0)
+ vlog.info(_("~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to."));
+#else
+ char *vncdir = strrchr(confdir, '\\');
+ if (vncdir != NULL && strcmp(vncdir, "vnc") == 0)
+ vlog.info(_("%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location."));
#endif
mkdirrecursive(os::getvncconfigdir());
+ mkdirrecursive(os::getvncdatadir());
mkdirrecursive(os::getvncstatedir());
CSecurity::upg = &dlg;
diff --git a/vncviewer/vncviewer.man b/vncviewer/vncviewer.man
index 928896a1..1a282126 100644
--- a/vncviewer/vncviewer.man
+++ b/vncviewer/vncviewer.man
@@ -147,19 +147,22 @@ every supported scheme.
.B \-passwd, \-PasswordFile \fIpassword-file\fP
If you are on a filesystem which gives you access to the password file used by
the server, you can specify it here to avoid typing it in. It will usually be
-"~/.vnc/passwd".
+\fI$XDG_CONFIG_HOME/tigervnc/passwd\fP, or \fI~/.config/tigervnc/passwd\fP
+if the former is unset.
.
.TP
.B \-X509CA \fIpath\fP
Path to CA certificate to use when authenticating remote servers using any
of the X509 security schemes (X509None, X509Vnc, etc.). Must be in PEM
-format. Default is \fB$HOME/.vnc/x509_ca.pem\fP.
+format. Default is \fI$XDG_CONFIG_HOME/tigervnc/x509_ca.pem\fP, or
+\fI~/.config/tigervnc/x509_ca.pem\fP.
.
.TP
.B \-X509CRL \fIpath\fP
Path to certificate revocation list to use in conjunction with
\fB-X509CA\fP. Must also be in PEM format. Default is
-\fB$HOME/.vnc/x509_crl.pem\fP.
+\fI$XDG_CONFIG_HOME/tigervnc/x509_crl.pem\fP, or
+\fI~/.config/tigervnc/x509_crl.pem\fP.
.
.TP
.B \-Shared
@@ -338,17 +341,33 @@ re-connect will be offered. Default is on.
.SH FILES
.TP
-$HOME/.vnc/default.tigervnc
+\fI$XDG_CONFIG_HOME/tigervnc/default.tigervnc\fP
+.TQ
+\fI$HOME/.config/tigervnc/default.tigervnc\fP
Default configuration options. This file must have a "magic" first line of
"TigerVNC Configuration file Version 1.0" (without quotes), followed by simple
<setting>=<value> pairs of your choosing. The available settings are those
shown in this man page.
.TP
-$HOME/.vnc/x509_ca.pem
+\fI$XDG_CONFIG_HOME/tigervnc/x509_ca.pem\fP
+.TQ
+\fI$HOME/.config/tigervnc/x509_ca.pem\fP
Default CA certificate for authenticating servers.
.TP
-$HOME/.vnc/x509_crl.pem
+\fI$XDG_CONFIG_HOME/tigervnc/x509_crl.pem\fP
+.TQ
+\fI$HOME/.config/tigervnc/x509_crl.pem\fP
Default certificate revocation list.
+.TP
+\fI$XDG_DATA_HOME/tigervnc/x509_known_hosts\fP
+.TQ
+\fI$HOME/.local/share/tigervnc/x509_known_hosts\fP
+Known hosts database for certificate-based authentication.
+.TP
+\fI$XDG_STATE_HOME/tigervnc/tigervnc.history\fP
+.TQ
+\fI$HOME/.local/state/tigervnc/tigervnc.history\fP
+History file for hostnames that have been recently connected to.
.SH SEE ALSO
.BR Xvnc (1),