diff options
author | obrien <obrien@FreeBSD.org> | 2005-02-07 08:14:41 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2005-02-07 08:14:41 +0000 |
commit | 372eab9a5209173b8eaab80b430c84b0ba5cb5b6 (patch) | |
tree | 9cb0aeedb17a8f10b51dd764eb77f7763422d4ee /net | |
parent | 53ae9d07e08011e03cb77de140e2cf474db67a05 (diff) | |
download | FreeBSD-ports-372eab9a5209173b8eaab80b430c84b0ba5cb5b6.zip FreeBSD-ports-372eab9a5209173b8eaab80b430c84b0ba5cb5b6.tar.gz |
Fix '[1077366] Send Client IP instead of 127.0.0.1 using RDPv5'
Obtained from: http://sourceforge.net/tracker/index.php?func=detail&aid=1077366&group_id=24366&atid=381349
Diffstat (limited to 'net')
-rw-r--r-- | net/rdesktop/Makefile | 8 | ||||
-rw-r--r-- | net/rdesktop/files/extra-patch-localIP | 81 |
2 files changed, 88 insertions, 1 deletions
diff --git a/net/rdesktop/Makefile b/net/rdesktop/Makefile index 9f60ad4..10527b1 100644 --- a/net/rdesktop/Makefile +++ b/net/rdesktop/Makefile @@ -7,11 +7,13 @@ PORTNAME= rdesktop PORTVERSION= 1.3.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net comms MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} +EXTRA_PATCHES= ${WRKDIR}/extra-patch-localIP + MAINTAINER= matt@fruitsalad.org COMMENT= RDP client for Windows NT/2000/2003 Terminal Server @@ -24,6 +26,10 @@ CONFIGURE_ARGS= --prefix=${PREFIX} DOCS= doc/AUTHORS doc/TODO doc/*.txt MAN1= rdesktop.1 +pre-patch: + ${SED} -e 's,rdesktop-1.3.1_localip/,,g' \ + ${FILESDIR}/extra-patch-localIP \ + > ${WRKDIR}/extra-patch-localIP post-patch: @${REINPLACE_CMD} -e 's|$$cc|${CC}|' \ ${WRKSRC}/configure diff --git a/net/rdesktop/files/extra-patch-localIP b/net/rdesktop/files/extra-patch-localIP new file mode 100644 index 0000000..c3e1c43 --- /dev/null +++ b/net/rdesktop/files/extra-patch-localIP @@ -0,0 +1,81 @@ +diff -urN rdesktop-1.3.1/iso.c rdesktop-1.3.1_localip/iso.c +--- rdesktop-1.3.1/iso.c 2003-08-11 13:08:19.000000000 +0200 ++++ rdesktop-1.3.1_localip/iso.c 2004-12-01 15:26:40.000000000 +0100 +@@ -211,3 +211,10 @@ + iso_send_msg(ISO_PDU_DR); + tcp_disconnect(); + } ++ ++/* p.hoekstra@koops-furness.nl: Get Client IP from the ISO layer */ ++char* ++iso_getlocalip(void) ++{ ++ return tcp_getlocalip(); ++} +diff -urN rdesktop-1.3.1/mcs.c rdesktop-1.3.1_localip/mcs.c +--- rdesktop-1.3.1/mcs.c 2003-07-01 11:31:24.000000000 +0200 ++++ rdesktop-1.3.1_localip/mcs.c 2004-12-01 15:32:02.000000000 +0100 +@@ -418,3 +418,10 @@ + { + iso_disconnect(); + } ++ ++/* p.hoekstra@koops-furness.nl: Get Client IP from the MCS layer */ ++char* ++mcs_getlocalip(void) ++{ ++ return iso_getlocalip(); ++} +diff -urN rdesktop-1.3.1/rdp.c rdesktop-1.3.1_localip/rdp.c +--- rdesktop-1.3.1/rdp.c 2003-12-11 18:20:01.000000000 +0100 ++++ rdesktop-1.3.1_localip/rdp.c 2004-12-01 15:26:17.000000000 +0100 +@@ -142,7 +142,7 @@ + int len_password = 2 * strlen(password); + int len_program = 2 * strlen(program); + int len_directory = 2 * strlen(directory); +- int len_ip = 2 * strlen("127.0.0.1"); ++ int len_ip = 2 * strlen("255.255.255.255"); + int len_dll = 2 * strlen("C:\\WINNT\\System32\\mstscax.dll"); + int packetlen = 0; + uint32 sec_flags = g_encryption ? (SEC_LOGON_INFO | SEC_ENCRYPT) : SEC_LOGON_INFO; +@@ -247,7 +247,7 @@ + } + out_uint16_le(s, 2); + out_uint16_le(s, len_ip + 2); /* Length of client ip */ +- rdp_out_unistr(s, "127.0.0.1", len_ip); ++ rdp_out_unistr(s, sec_getlocalip(), len_ip); /* p.hoekstra@koops-furness.nl: Send the REAL Client IP */ + out_uint16_le(s, len_dll + 2); + rdp_out_unistr(s, "C:\\WINNT\\System32\\mstscax.dll", len_dll); + +diff -urN rdesktop-1.3.1/secure.c rdesktop-1.3.1_localip/secure.c +--- rdesktop-1.3.1/secure.c 2003-12-10 09:02:59.000000000 +0100 ++++ rdesktop-1.3.1_localip/secure.c 2004-12-01 15:31:50.000000000 +0100 +@@ -887,3 +887,10 @@ + { + mcs_disconnect(); + } ++ ++/* p.hoekstra@koops-furness.nl: Get Client IP from the secure connection */ ++char* ++sec_getlocalip(void) ++{ ++ return mcs_getlocalip(); ++} +diff -urN rdesktop-1.3.1/tcp.c rdesktop-1.3.1_localip/tcp.c +--- rdesktop-1.3.1/tcp.c 2003-11-08 10:17:41.000000000 +0100 ++++ rdesktop-1.3.1_localip/tcp.c 2004-12-01 15:32:57.000000000 +0100 +@@ -228,3 +228,14 @@ + { + close(sock); + } ++ ++/* p.hoekstra@koops-furness.nl: Get Client IP from the TCP layer (the connected socket) */ ++char* ++tcp_getlocalip(void) ++{ ++ struct sockaddr_in local_addr; ++ int len = sizeof(struct sockaddr_in); ++ ++ getsockname(sock, (struct sockaddr *) &local_addr, &len); ++ return inet_ntoa(local_addr.sin_addr); ++} |