aboutsummaryrefslogtreecommitdiff
path: root/net/rdesktop/files
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2005-02-07 08:14:41 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2005-02-07 08:14:41 +0000
commitd536ae2e175efb56d8fd4267fa47c439b4bdfd95 (patch)
tree74cfea2f2ef3ac45f18c44d8ba6eef39d866201a /net/rdesktop/files
parent7467ae3d62304a53c4a79f9aad670b21cdfd30e9 (diff)
downloadports-d536ae2e175efb56d8fd4267fa47c439b4bdfd95.tar.gz
ports-d536ae2e175efb56d8fd4267fa47c439b4bdfd95.zip
Fix '[1077366] Send Client IP instead of 127.0.0.1 using RDPv5'
Notes
Notes: svn path=/head/; revision=128210
Diffstat (limited to 'net/rdesktop/files')
-rw-r--r--net/rdesktop/files/extra-patch-localIP81
1 files changed, 81 insertions, 0 deletions
diff --git a/net/rdesktop/files/extra-patch-localIP b/net/rdesktop/files/extra-patch-localIP
new file mode 100644
index 000000000000..c3e1c43ba437
--- /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);
++}