[nc] Do not send CRLF line endings in an extra packet (#719386)
Petr Sabata
psabata at fedoraproject.org
Thu Jul 7 15:21:26 UTC 2011
commit 07cb3adf6ce7c42b43cf64c90abc5fc51b4f6a9d
Author: Petr Sabata <contyk at redhat.com>
Date: Thu Jul 7 17:20:56 2011 +0200
Do not send CRLF line endings in an extra packet (#719386)
nc-1.100-crlf.patch => nc-1.101-crlf.patch | 6 +++---
nc.spec | 8 ++++++--
2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/nc-1.100-crlf.patch b/nc-1.101-crlf.patch
similarity index 94%
rename from nc-1.100-crlf.patch
rename to nc-1.101-crlf.patch
index 9f8a0f8..e92f054 100644
--- a/nc-1.100-crlf.patch
+++ b/nc-1.101-crlf.patch
@@ -34,9 +34,9 @@
- if (atomicio(vwrite, nfd, buf, n) != n)
- return;
+ if (Cflag && (buf[n-1] == '\n')) {
-+ if (atomicio(vwrite, nfd, buf, n-1) != (n-1))
-+ return;
-+ if (atomicio(vwrite, nfd, "\r\n", 2) != 2)
++ buf[n-1] = '\r';
++ buf[n] = '\n';
++ if (atomicio(vwrite, nfd, buf, n+1) != n+1)
+ return;
+ } else {
+ if (atomicio(vwrite, nfd, buf, n) != n)
diff --git a/nc.spec b/nc.spec
index b6fbf61..e09315f 100644
--- a/nc.spec
+++ b/nc.spec
@@ -1,7 +1,7 @@
Summary: Reads and writes data across network connections using TCP or UDP
Name: nc
Version: 1.101
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
License: BSD ISC
Group: Applications/Internet
@@ -12,7 +12,7 @@ Patch0: nc-1.101-linux-ify.patch
Patch1: nc-1.100-pollhup.patch
Patch2: nc-1.100-udp-stop.patch
Patch3: nc-1.100-udp-portscan.patch
-Patch4: nc-1.100-crlf.patch
+Patch4: nc-1.101-crlf.patch
Patch5: nc-1.100-comma.patch
Patch6: nc-1.100-libbsd.patch
Patch7: nc-1.100-format-size_t.patch
@@ -62,6 +62,10 @@ install -m 644 nc.1 %{buildroot}%{_mandir}/man1
%{_mandir}/man1/nc.1*
%changelog
+* Thu Jul 07 2011 Petr Sabata <contyk at redhat.com> - 1.101-2
+- Do not send CRLF line endings in an extra packet
+ Thanks to Jaroslav Franek, rhbz#719386
+
* Wed Jun 22 2011 Petr Sabata <contyk at redhat.com> - 1.101-1
- 1.101 bump (no changes for us...)
More information about the scm-commits
mailing list