X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=x11fwd.c;h=584116aa69b29189ae93782da3ed0d5ffd15e2a8;hb=50965a6411b8da9301501e91262bfe6cf8c808ae;hp=4a6d82704b7cdbccbed5a1dfcf964aaa2dda9cbd;hpb=a53e4e2cb6aa5b953fa0cdbef3b1702d0925f195;p=PuTTY.git diff --git a/x11fwd.c b/x11fwd.c index 4a6d8270..584116aa 100644 --- a/x11fwd.c +++ b/x11fwd.c @@ -286,7 +286,8 @@ struct X11Display *x11_setup_display(const char *display, Conf *conf) disp->port = 6000 + disp->displaynum; disp->addr = name_lookup(disp->hostname, disp->port, - &disp->realhost, conf, ADDRTYPE_UNSPEC); + &disp->realhost, conf, ADDRTYPE_UNSPEC, + NULL, NULL); if ((err = sk_addr_error(disp->addr)) != NULL) { sk_addr_free(disp->addr); @@ -357,10 +358,10 @@ void x11_free_display(struct X11Display *disp) #define XDM_MAXSKEW 20*60 /* 20 minute clock skew should be OK */ -static char *x11_verify(unsigned long peer_ip, int peer_port, - tree234 *authtree, char *proto, - unsigned char *data, int dlen, - struct X11FakeAuth **auth_ret) +static const char *x11_verify(unsigned long peer_ip, int peer_port, + tree234 *authtree, char *proto, + unsigned char *data, int dlen, + struct X11FakeAuth **auth_ret) { struct X11FakeAuth match_dummy; /* for passing to find234 */ struct X11FakeAuth *auth; @@ -420,7 +421,8 @@ static char *x11_verify(unsigned long peer_ip, int peer_port, if (data[i] != 0) /* zero padding wrong */ return "XDM-AUTHORIZATION-1 data failed check"; tim = time(NULL); - if (abs(t - tim) > XDM_MAXSKEW) + if (((unsigned long)t - (unsigned long)tim + + XDM_MAXSKEW) > 2*XDM_MAXSKEW) return "XDM-AUTHORIZATION-1 time stamp was too far out"; seen = snew(struct XDMSeen); seen->time = t; @@ -932,7 +934,7 @@ int x11_send(struct X11Connection *xconn, char *data, int len) * Write a new connection header containing our replacement * auth data. */ - + socketdatalen = 0; /* placate compiler warning */ socketdata = sk_getxdmdata(xconn->s, &socketdatalen); if (socketdata && socketdatalen==6) { sprintf(new_peer_addr, "%d.%d.%d.%d", socketdata[0],