[proftpd-dfsg] 01/01: Revert changes of commit 929b05c1cfa2257da24b47cf85bd191032b234f0. Make a real Debian patch instead to make "debuild -S" happy.
Hilmar Preuße
hilmar-guest at moszumanska.debian.org
Thu Sep 15 11:53:27 UTC 2016
This is an automated email from the git hooks/post-receive script.
hilmar-guest pushed a commit to branch master
in repository proftpd-dfsg.
commit db79ce0c8b9193e243b6e0c2bda90175519b9d9c
Author: Hilmar Preuße <hille42 at web.de>
Date: Thu Sep 15 13:52:16 2016 +0200
Revert changes of commit 929b05c1cfa2257da24b47cf85bd191032b234f0.
Make a real Debian patch instead to make "debuild -S" happy.
---
debian/patches/FTBS_on_Hurd | 115 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 115 insertions(+)
diff --git a/debian/patches/FTBS_on_Hurd b/debian/patches/FTBS_on_Hurd
new file mode 100644
index 0000000..8eb0eb7
--- /dev/null
+++ b/debian/patches/FTBS_on_Hurd
@@ -0,0 +1,115 @@
+Author: Svante Signell <svante.signell at gmail.com>
+Last-Update: 2014-07-09
+Forwarded: http://bugs.proftpd.org/show_bug.cgi?id=4050
+Bug-Debian: http://bugs.debian.org/745493
+
+Index: proftpd-dfsg_cp/contrib/mod_exec.c
+===================================================================
+--- proftpd-dfsg_cp.orig/contrib/mod_exec.c 2015-05-28 02:25:54.000000000 +0200
++++ proftpd-dfsg_cp/contrib/mod_exec.c 2016-09-15 13:42:30.000000000 +0200
+@@ -742,14 +742,20 @@
+
+ if (fds >= 0) {
+ int buflen;
+- char buf[PIPE_BUF];
++
++ size_t len = fpathconf(exec_stdout_pipe[0], _PC_PIPE_BUF);
++ char *buf = malloc(len);
++ if (buf == NULL) {
++ exec_log("malloc failed: %s", strerror(errno));
++ return errno;
++ }
+
+ /* The child sent us something. How thoughtful. */
+
+ if (FD_ISSET(exec_stdout_pipe[0], &readfds)) {
+- memset(buf, '\0', sizeof(buf));
++ memset(buf, '\0', len);
+
+- buflen = read(exec_stdout_pipe[0], buf, sizeof(buf)-1);
++ buflen = read(exec_stdout_pipe[0], buf, len - 1);
+ if (buflen > 0) {
+ if (exec_opts & EXEC_OPT_SEND_STDOUT) {
+
+@@ -796,9 +802,9 @@
+ }
+
+ if (FD_ISSET(exec_stderr_pipe[0], &readfds)) {
+- memset(buf, '\0', sizeof(buf));
++ memset(buf, '\0', len);
+
+- buflen = read(exec_stderr_pipe[0], buf, sizeof(buf)-1);
++ buflen = read(exec_stdout_pipe[0], buf, len - 1);
+ if (buflen > 0) {
+
+ /* Trim trailing CRs and LFs. */
+@@ -828,6 +834,7 @@
+ }
+ }
+ }
++ free(buf);
+ }
+
+ res = waitpid(pid, &status, WNOHANG);
+Index: proftpd-dfsg_cp/contrib/mod_sftp/keys.c
+===================================================================
+--- proftpd-dfsg_cp.orig/contrib/mod_sftp/keys.c 2016-09-15 13:40:43.000000000 +0200
++++ proftpd-dfsg_cp/contrib/mod_sftp/keys.c 2016-09-15 13:42:30.000000000 +0200
+@@ -413,10 +413,15 @@
+
+ if (FD_ISSET(stderr_pipe[0], &readfds)) {
+ int stderrlen;
+- char stderrbuf[PIPE_BUF];
+
+- memset(stderrbuf, '\0', sizeof(stderrbuf));
+- stderrlen = read(stderr_pipe[0], stderrbuf, sizeof(stderrbuf)-1);
++ size_t len = fpathconf(stderr_pipe[0], _PC_PIPE_BUF);
++ char *stderrbuf = malloc(len);
++ if (stderrbuf == NULL) {
++ pr_log_pri(PR_LOG_ALERT, MOD_SFTP_VERSION ": Out of memory!");
++ return -1;
++ }
++ memset(stderrbuf, '\0', len);
++ stderrlen = read(stderr_pipe[0], stderrbuf, len - 1);
+ if (stderrlen > 0) {
+ while (stderrlen &&
+ (stderrbuf[stderrlen-1] == '\r' ||
+@@ -433,6 +438,7 @@
+ ": error reading stderr from '%s': %s",
+ passphrase_provider, strerror(errno));
+ }
++ free(stderrbuf);
+ }
+ }
+
+Index: proftpd-dfsg_cp/contrib/mod_tls.c
+===================================================================
+--- proftpd-dfsg_cp.orig/contrib/mod_tls.c 2015-05-28 02:25:54.000000000 +0200
++++ proftpd-dfsg_cp/contrib/mod_tls.c 2016-09-15 13:42:30.000000000 +0200
+@@ -1792,10 +1792,15 @@
+
+ if (FD_ISSET(stderr_pipe[0], &readfds)) {
+ int stderrlen;
+- char stderrbuf[PIPE_BUF];
+
+- memset(stderrbuf, '\0', sizeof(stderrbuf));
+- stderrlen = read(stderr_pipe[0], stderrbuf, sizeof(stderrbuf)-1);
++ size_t len = fpathconf(stderr_pipe[0], _PC_PIPE_BUF);
++ char *stderrbuf = malloc(len);
++ if (stderrbuf == NULL) {
++ tls_log("malloc failed: %s", strerror(errno));
++ return -1;
++ }
++ memset(stderrbuf, '\0', len);
++ stderrlen = read(stderr_pipe[0], stderrbuf, len - 1);
+ if (stderrlen > 0) {
+ while (stderrlen &&
+ (stderrbuf[stderrlen-1] == '\r' ||
+@@ -1812,6 +1817,7 @@
+ ": error reading stderr from '%s': %s",
+ tls_passphrase_provider, strerror(errno));
+ }
++ free(stderrbuf);
+ }
+ }
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-proftpd/proftpd-dfsg.git
More information about the Pkg-proftpd-maintainers
mailing list