summaryrefslogtreecommitdiffstats
path: root/x11vnc/inet.c
diff options
context:
space:
mode:
authorrunge <runge>2006-07-04 16:09:22 +0000
committerrunge <runge>2006-07-04 16:09:22 +0000
commita7726a6f970f49c2bedac4926aa30de18d96ae41 (patch)
tree79c23911a3acba751461bcdc3db5d6b59364a433 /x11vnc/inet.c
parent9992160105b0433484bca804d62eb672aff113de (diff)
downloadlibtdevnc-a7726a6f970f49c2bedac4926aa30de18d96ae41.tar.gz
libtdevnc-a7726a6f970f49c2bedac4926aa30de18d96ae41.zip
x11vnc: more -unixpw work. add -license, etc. options
Diffstat (limited to 'x11vnc/inet.c')
-rw-r--r--x11vnc/inet.c9
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);