From: Brian P. Hinz Date: Fri, 12 Mar 2021 00:59:29 +0000 (-0500) Subject: Create VNC homedir if it doesn't already exist X-Git-Tag: v1.11.90~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=89f6d5aed0a3d7b8caba7e869e7f96cc7be7ec32;p=tigervnc.git Create VNC homedir if it doesn't already exist --- diff --git a/java/com/tigervnc/rfb/CSecurityTLS.java b/java/com/tigervnc/rfb/CSecurityTLS.java index e63945dc..ed9de383 100644 --- a/java/com/tigervnc/rfb/CSecurityTLS.java +++ b/java/com/tigervnc/rfb/CSecurityTLS.java @@ -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"+