]> source.dussan.org Git - tigervnc.git/commitdiff
Create VNC homedir if it doesn't already exist
authorBrian P. Hinz <bphinz@users.sf.net>
Fri, 12 Mar 2021 00:59:29 +0000 (19:59 -0500)
committerBrian P. Hinz <bphinz@users.sf.net>
Fri, 12 Mar 2021 01:00:15 +0000 (20:00 -0500)
java/com/tigervnc/rfb/CSecurityTLS.java

index e63945dc2d3f6e7fac1f74b64afc0dafcc107074..ed9de383f93406802c8c7ca8422cec2e4fd5774c 100644 (file)
@@ -279,9 +279,14 @@ public class CSecurityTLS extends CSecurity {
           throw new AuthFailureException("server certificate has expired");
       }
       File vncDir = new File(FileUtils.getVncHomeDir());
-      if (!vncDir.exists())
-        throw new AuthFailureException("Could not obtain VNC home directory "+
-                                       "path for known hosts storage");
+      if (!vncDir.exists()) {
+        try {
+          vncDir.mkdir();
+        } catch(SecurityException e) {
+          throw new AuthFailureException("Could not obtain VNC home directory "+
+                                         "path for known hosts storage");
+        }
+      }
       File dbPath = new File(vncDir, "x509_known_hosts");
       String info =
         "  Subject: "+cert.getSubjectX500Principal().getName()+"\n"+