Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dcommander committed Jul 1, 2024
2 parents 39f3974 + 6660b94 commit f8399dd
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 71 deletions.
15 changes: 15 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ VirtualGL, although the performance will be better with VirtualGL. Refer to
the description of the `-drinode` option in the Xvnc man page for more details.


3.1.2
=====

### Significant changes relative to 3.1.1:

1. The TurboVNC Server now assigns an ordinal ID to every VNC viewer after the
viewer successfully connects, and the viewer's ID is reported in the TurboVNC
session log along with the IP address from which the viewer connection
originated. This makes it easier to distinguish log entries related to a
specific viewer, especially when using SSH tunneling (which makes it appear as
if all viewer connections originate from the loopback IP address.) The
TurboVNC Server now also logs the total number of simultaneously connected
viewers.


3.1.1
=====

Expand Down
14 changes: 8 additions & 6 deletions unix/Xvnc/programs/Xserver/hw/vnc/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file implements authentication when setting up an RFB connection.
*/

/* Copyright (C) 2010, 2012-2022 D. R. Commander. All Rights Reserved.
/* Copyright (C) 2010, 2012-2022, 2024 D. R. Commander. All Rights Reserved.
* Copyright (C) 2010 University Corporation for Atmospheric Research.
* All Rights Reserved.
* Copyright (C) 2003-2006 Constantin Kaplinsky. All Rights Reserved.
Expand Down Expand Up @@ -1354,12 +1354,14 @@ static Bool CheckResponse(rfbClientPtr cl, int numPasswords,
memset(passwdViewOnly, 0, MAXPWLEN + 1);

if (memcmp(encryptedChallenge1, response, CHALLENGESIZE) == 0) {
rfbLog("Full-control authentication enabled for %s\n", cl->host);
rfbLog("Full-control authentication enabled for Client %d (%s)\n", cl->id,
cl->host);
ok = TRUE;
cl->viewOnly = FALSE;

} else if (memcmp(encryptedChallenge2, response, CHALLENGESIZE) == 0) {
rfbLog("View-only authentication enabled for %s\n", cl->host);
rfbLog("View-only authentication enabled for Client %d (%s)\n", cl->id,
cl->host);
ok = TRUE;
cl->viewOnly = TRUE;
}
Expand Down Expand Up @@ -1441,16 +1443,16 @@ void rfbVncAuthProcessResponse(rfbClientPtr cl)
for (otherCl = rfbClientHead; otherCl; otherCl = otherCl->next) {
if ((otherCl != cl) && (otherCl->state == RFB_NORMAL)) {
rfbLog("-dontdisconnect: Not shared & existing client\n");
rfbLog(" refusing new client %s\n", cl->host);
rfbLog(" refusing new client %d (%s)\n", cl->id, cl->host);
rfbClientAuthFailed(cl, "Authentication failed. The server is already in use.");
return;
}
}
}
rfbClientAuthSucceeded(cl, rfbAuthVNC);
} else {
rfbLog("rfbVncAuthProcessResponse: authentication failed from %s\n",
cl->host);
rfbLog("rfbVncAuthProcessResponse: authentication failed from Client %d (%s)\n",
cl->id, cl->host);
if (rfbAuthConsiderBlocking(cl->host))
rfbClientAuthFailed(cl, "Authentication failed. Client temporarily blocked");
else
Expand Down
7 changes: 4 additions & 3 deletions unix/Xvnc/programs/Xserver/hw/vnc/authpam.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* authpam.c - deal with PAM authentication.
*/

/* Copyright (C) 2015, 2017-2018, 2020 D. R. Commander. All Rights Reserved.
/* Copyright (C) 2015, 2017-2018, 2020, 2024 D. R. Commander.
* All Rights Reserved.
* Copyright (C) 2020 Andrew Yoder. All Rights Reserved.
* Copyright (C) 2010 University Corporation for Atmospheric Research.
* All Rights Reserved.
Expand Down Expand Up @@ -153,7 +154,7 @@ Bool rfbPAMAuthenticate(rfbClientPtr cl, const char *svc, const char *user,
rfbLog("PAMAuthenticate: pam_open_session: %s\n",
pam_strerror(pamHandle, authStatus));
} else {
rfbLog("Opened PAM session for client %s\n", cl->host);
rfbLog("Opened PAM session for Client %d (%s)\n", cl->id, cl->host);
}
}
}
Expand Down Expand Up @@ -212,7 +213,7 @@ void rfbPAMEnd(rfbClientPtr cl)
if ((r = pam_end(cl->pamHandle, PAM_SUCCESS)) != PAM_SUCCESS)
rfbLog("PAMEnd: pam_end: %s\n", pam_strerror(cl->pamHandle, r));

rfbLog("Closed PAM session for client %s\n", cl->host);
rfbLog("Closed PAM session for Client %d (%s)\n", cl->id, cl->host);
cl->pamHandle = 0;
}
}
4 changes: 3 additions & 1 deletion unix/Xvnc/programs/Xserver/hw/vnc/rfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ typedef struct rfbClientRec {

int sock;
char *host;
char *login;
int id;

int protocol_minor_ver; /* RFB protocol minor version in use */
Bool protocol_tightvnc; /* TightVNC protocol extensions enabled */
Expand Down Expand Up @@ -981,6 +981,7 @@ extern Bool rfbGIIDebug;
extern int rfbInterframe;
extern int rfbMaxClipboard;
extern Bool rfbVirtualTablet;
extern int rfbClientNumber;

/* Multithreading params specified on the command line or in the environment */
extern Bool rfbMT;
Expand All @@ -992,6 +993,7 @@ extern char *rfbCaptureFile;
rfbLog(m" %d, %d %d x %d\n", (r).extents.x1, (r).extents.y1, \
(r).extents.x2 - (r).extents.x1, (r).extents.y2 - (r).extents.y1)

extern int rfbClientCount(void);
extern void rfbNewClientConnection(int sock);
extern rfbClientPtr rfbReverseConnection(char *host, int port, int id);
extern void rfbClientConnectionGone(rfbClientPtr cl);
Expand Down
Loading

0 comments on commit f8399dd

Please sign in to comment.