KASM-3119 send full frame on permission changes
This commit is contained in:
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,4 +1,4 @@
|
|||||||
[submodule "kasmweb"]
|
[submodule "kasmweb"]
|
||||||
path = kasmweb
|
path = kasmweb
|
||||||
url = https://github.com/kasmtech/noVNC.git
|
url = https://github.com/kasmtech/noVNC.git
|
||||||
branch = master
|
branch = release/0.9.3
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ cd /tmp
|
|||||||
# default to the version of x in Ubuntu 18.04, otherwise caller will need to specify
|
# default to the version of x in Ubuntu 18.04, otherwise caller will need to specify
|
||||||
XORG_VER=${XORG_VER:-"1.19.6"}
|
XORG_VER=${XORG_VER:-"1.19.6"}
|
||||||
XORG_PATCH=$(echo "$XORG_VER" | grep -Po '^\d.\d+' | sed 's#\.##')
|
XORG_PATCH=$(echo "$XORG_VER" | grep -Po '^\d.\d+' | sed 's#\.##')
|
||||||
wget https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.bz2
|
wget --no-check-certificate https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.bz2
|
||||||
|
|
||||||
#git clone https://kasmweb@bitbucket.org/kasmtech/kasmvnc.git
|
#git clone https://kasmweb@bitbucket.org/kasmtech/kasmvnc.git
|
||||||
#cd kasmvnc
|
#cd kasmvnc
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ int ssl_initialized = 0;
|
|||||||
int pipe_error = 0;
|
int pipe_error = 0;
|
||||||
settings_t settings;
|
settings_t settings;
|
||||||
|
|
||||||
|
extern int wakeuppipe[2];
|
||||||
|
|
||||||
void traffic(const char * token) {
|
void traffic(const char * token) {
|
||||||
/*if ((settings.verbose) && (! settings.daemon)) {
|
/*if ((settings.verbose) && (! settings.daemon)) {
|
||||||
@@ -1083,6 +1084,9 @@ static uint8_t ownerapi_post(ws_ctx_t *ws_ctx, const char *in, const char * cons
|
|||||||
free(set->entries);
|
free(set->entries);
|
||||||
free(set);
|
free(set);
|
||||||
|
|
||||||
|
//force full frame to all users with at least read
|
||||||
|
write(wakeuppipe[1], "", 1);
|
||||||
|
|
||||||
sprintf(buf, "HTTP/1.1 200 OK\r\n"
|
sprintf(buf, "HTTP/1.1 200 OK\r\n"
|
||||||
"Server: KasmVNC/4.0\r\n"
|
"Server: KasmVNC/4.0\r\n"
|
||||||
"Connection: close\r\n"
|
"Connection: close\r\n"
|
||||||
@@ -1172,6 +1176,9 @@ static uint8_t ownerapi_post(ws_ctx_t *ws_ctx, const char *in, const char * cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//force full frame to all users with at least read
|
||||||
|
write(wakeuppipe[1], "", 1);
|
||||||
|
|
||||||
free(set->entries);
|
free(set->entries);
|
||||||
free(set);
|
free(set);
|
||||||
|
|
||||||
@@ -1312,7 +1319,7 @@ static uint8_t ownerapi(ws_ctx_t *ws_ctx, const char *in, const char * const use
|
|||||||
}
|
}
|
||||||
} else entry("/api/create_user") {
|
} else entry("/api/create_user") {
|
||||||
char decname[1024] = "", decpw[1024] = "";
|
char decname[1024] = "", decpw[1024] = "";
|
||||||
uint8_t read = 0, write = 0, owner = 0;
|
uint8_t read_p = 0, write_p = 0, owner_p = 0;
|
||||||
|
|
||||||
param = parse_get(args, "name", &len);
|
param = parse_get(args, "name", &len);
|
||||||
if (len) {
|
if (len) {
|
||||||
@@ -1337,29 +1344,32 @@ static uint8_t ownerapi(ws_ctx_t *ws_ctx, const char *in, const char * const use
|
|||||||
param = parse_get(args, "read", &len);
|
param = parse_get(args, "read", &len);
|
||||||
if (len && isalpha(param[0])) {
|
if (len && isalpha(param[0])) {
|
||||||
if (!strncmp(param, "true", len))
|
if (!strncmp(param, "true", len))
|
||||||
read = 1;
|
read_p = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
param = parse_get(args, "write", &len);
|
param = parse_get(args, "write", &len);
|
||||||
if (len && isalpha(param[0])) {
|
if (len && isalpha(param[0])) {
|
||||||
if (!strncmp(param, "true", len))
|
if (!strncmp(param, "true", len))
|
||||||
write = 1;
|
write_p = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
param = parse_get(args, "owner", &len);
|
param = parse_get(args, "owner", &len);
|
||||||
if (len && isalpha(param[0])) {
|
if (len && isalpha(param[0])) {
|
||||||
if (!strncmp(param, "true", len))
|
if (!strncmp(param, "true", len))
|
||||||
owner = 1;
|
owner_p = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!decname[0] || !decpw[0])
|
if (!decname[0] || !decpw[0])
|
||||||
goto nope;
|
goto nope;
|
||||||
|
|
||||||
if (!settings.adduserCb(settings.messager, decname, decpw, read, write, owner)) {
|
if (!settings.adduserCb(settings.messager, decname, decpw, read_p, write_p, owner_p)) {
|
||||||
handler_msg("Invalid params to create_user\n");
|
handler_msg("Invalid params to create_user\n");
|
||||||
goto nope;
|
goto nope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//force full frame to all users with at least read
|
||||||
|
write(wakeuppipe[1], "", 1);
|
||||||
|
|
||||||
sprintf(buf, "HTTP/1.1 200 OK\r\n"
|
sprintf(buf, "HTTP/1.1 200 OK\r\n"
|
||||||
"Server: KasmVNC/4.0\r\n"
|
"Server: KasmVNC/4.0\r\n"
|
||||||
"Connection: close\r\n"
|
"Connection: close\r\n"
|
||||||
@@ -1444,6 +1454,9 @@ static uint8_t ownerapi(ws_ctx_t *ws_ctx, const char *in, const char * const use
|
|||||||
goto nope;
|
goto nope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//force full frame to all users with at least read
|
||||||
|
write(wakeuppipe[1], "", 1);
|
||||||
|
|
||||||
sprintf(buf, "HTTP/1.1 200 OK\r\n"
|
sprintf(buf, "HTTP/1.1 200 OK\r\n"
|
||||||
"Server: KasmVNC/4.0\r\n"
|
"Server: KasmVNC/4.0\r\n"
|
||||||
"Connection: close\r\n"
|
"Connection: close\r\n"
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s,
|
|||||||
kasmpasswdpath[0] = '\0';
|
kasmpasswdpath[0] = '\0';
|
||||||
wordexp_t wexp;
|
wordexp_t wexp;
|
||||||
if (!wordexp(rfb::Server::kasmPasswordFile, &wexp, WRDE_NOCMD))
|
if (!wordexp(rfb::Server::kasmPasswordFile, &wexp, WRDE_NOCMD))
|
||||||
strncpy(kasmpasswdpath, wexp.we_wordv[0], 4096);
|
strncpy(kasmpasswdpath, wexp.we_wordv[0], 4095);
|
||||||
kasmpasswdpath[4095] = '\0';
|
kasmpasswdpath[4095] = '\0';
|
||||||
wordfree(&wexp);
|
wordfree(&wexp);
|
||||||
|
|
||||||
|
|||||||
@@ -1181,3 +1181,13 @@ void VNCServerST::handleClipboardAnnounceBinary(VNCSConnectionST* client,
|
|||||||
clipboardClient = client;
|
clipboardClient = client;
|
||||||
desktop->handleClipboardAnnounceBinary(num, mimes);
|
desktop->handleClipboardAnnounceBinary(num, mimes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VNCServerST::refreshClients()
|
||||||
|
{
|
||||||
|
add_changed(pb->getRect());
|
||||||
|
|
||||||
|
std::list<VNCSConnectionST*>::iterator i;
|
||||||
|
for (i = clients.begin(); i != clients.end(); i++) {
|
||||||
|
(*i)->add_changed_all();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,7 +43,6 @@ namespace rfb {
|
|||||||
class ListConnInfo;
|
class ListConnInfo;
|
||||||
class PixelBuffer;
|
class PixelBuffer;
|
||||||
class KeyRemapper;
|
class KeyRemapper;
|
||||||
class network::GetAPIMessager;
|
|
||||||
|
|
||||||
class VNCServerST : public VNCServer,
|
class VNCServerST : public VNCServer,
|
||||||
public Timer::Callback,
|
public Timer::Callback,
|
||||||
@@ -198,6 +197,8 @@ namespace rfb {
|
|||||||
void handleClipboardAnnounceBinary(VNCSConnectionST* client, const unsigned num,
|
void handleClipboardAnnounceBinary(VNCSConnectionST* client, const unsigned num,
|
||||||
const char mimes[][32]);
|
const char mimes[][32]);
|
||||||
|
|
||||||
|
void refreshClients();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
friend class VNCSConnectionST;
|
friend class VNCSConnectionST;
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void vncSetGlueContext(int screenIndex);
|
void vncSetGlueContext(int screenIndex);
|
||||||
|
|
||||||
|
extern int wakeuppipe[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace rfb;
|
using namespace rfb;
|
||||||
@@ -307,6 +309,13 @@ void XserverDesktop::handleSocketEvent(int fd, bool read, bool write)
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (read) {
|
if (read) {
|
||||||
|
if (fd == wakeuppipe[0]) {
|
||||||
|
unsigned char buf;
|
||||||
|
while (::read(fd, &buf, 1) > 0);
|
||||||
|
server->refreshClients();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (handleListenerEvent(fd, &listeners, server))
|
if (handleListenerEvent(fd, &listeners, server))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,10 @@
|
|||||||
* USA.
|
* USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
@@ -49,6 +51,8 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void vncSetGlueContext(int screenIndex);
|
void vncSetGlueContext(int screenIndex);
|
||||||
|
|
||||||
|
int wakeuppipe[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace rfb;
|
using namespace rfb;
|
||||||
@@ -225,6 +229,11 @@ void vncExtensionInit(void)
|
|||||||
dummyY < 16)
|
dummyY < 16)
|
||||||
vncFatalError("Invalid value to %s", Server::maxVideoResolution.getName());
|
vncFatalError("Invalid value to %s", Server::maxVideoResolution.getName());
|
||||||
|
|
||||||
|
pipe(wakeuppipe);
|
||||||
|
const int flags = fcntl(wakeuppipe[0], F_GETFL, 0);
|
||||||
|
fcntl(wakeuppipe[0], F_SETFL, flags | O_NONBLOCK);
|
||||||
|
vncSetNotifyFd(wakeuppipe[0], 0, true, false);
|
||||||
|
|
||||||
initialised = true;
|
initialised = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user