Add option to pass the password in an encrypted file, kasmvncpasswd utility

This commit is contained in:
Lauri Kasanen
2020-10-01 14:37:51 +03:00
parent ae07707e66
commit 279c41fc32
11 changed files with 226 additions and 3 deletions

View File

@@ -38,11 +38,13 @@
#include <sys/un.h>
#include <stdlib.h>
#include <unistd.h>
#include <wordexp.h>
#include "websocket.h"
#include <network/TcpSocket.h>
#include <rfb/LogWriter.h>
#include <rfb/Configuration.h>
#include <rfb/ServerCore.h>
#ifdef WIN32
#include <os/winerrno.h>
@@ -485,6 +487,13 @@ WebsocketListener::WebsocketListener(const struct sockaddr *listenaddr,
listen(internalSocket);
settings.passwdfile = NULL;
wordexp_t wexp;
if (!wordexp(rfb::Server::kasmPasswordFile, &wexp, WRDE_NOCMD))
settings.passwdfile = strdup(wexp.we_wordv[0]);
wordfree(&wexp);
settings.basicauth = basicauth;
settings.cert = cert;
settings.key = "";