diff options
Diffstat (limited to 'x11vnc/inet.c')
-rw-r--r-- | x11vnc/inet.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/x11vnc/inet.c b/x11vnc/inet.c index 852056c..3095f37 100644 --- a/x11vnc/inet.c +++ b/x11vnc/inet.c @@ -1,6 +1,8 @@ /* -- inet.c -- */ #include "x11vnc.h" +#include "unixpw.h" +#include "sslhelper.h" /* * Simple utility to map host name to dotted IP address. Ignores aliases. @@ -22,7 +24,6 @@ int have_ssh_env(void); static int get_port(int sock, int remote); static char *get_host(int sock, int remote); - char *host2ip(char *host) { struct hostent *hp; struct sockaddr_in addr; @@ -291,7 +292,11 @@ char *ident_username(rfbClientPtr client) { if (!strcmp(user, "unknown-user") && cd && cd->unixname[0] != '\0') { user = cd->unixname; } - newhost = ip2host(client->host); + if (unixpw && openssl_last_ip && strstr("UNIX:", user) != user) { + newhost = ip2host(openssl_last_ip); + } else { + newhost = ip2host(client->host); + } len = strlen(user) + 1 + strlen(newhost) + 1; str = (char *) malloc(len); sprintf(str, "%s@%s", user, newhost); |