diff -Naur vsftpd-3.0.3.orig/postlogin.c vsftpd-3.0.3/postlogin.c
--- vsftpd-3.0.3.orig/postlogin.c	2015-07-23 00:33:22.000000000 +0530
+++ vsftpd-3.0.3/postlogin.c	2018-01-22 14:16:10.427323169 +0530
@@ -1069,13 +1069,19 @@
   }
   created = 1;
   vsf_sysutil_fstat(new_file_fd, &s_p_statbuf);
-  if (vsf_sysutil_statbuf_is_regfile(s_p_statbuf))
+  /* no truncate on fifo/pipe */
+  if (vsf_sysutil_statbuf_is_fifo(s_p_statbuf))
+  {
+    do_truncate = 0;
+  }
+  else if (vsf_sysutil_statbuf_is_regfile(s_p_statbuf))
   {
     /* Now deactive O_NONBLOCK, otherwise we have a problem on DMAPI filesystems
      * such as XFS DMAPI.
      */
     vsf_sysutil_deactivate_noblock(new_file_fd);
   }
+
   /* Are we required to chown() this file for security? */
   if (p_sess->is_anonymous && tunable_chown_uploads)
   {
diff -Naur vsftpd-3.0.3.orig/sysutil.c vsftpd-3.0.3/sysutil.c
--- vsftpd-3.0.3.orig/sysutil.c	2012-09-16 12:37:38.000000000 +0530
+++ vsftpd-3.0.3/sysutil.c	2018-01-22 14:16:10.427323169 +0530
@@ -1320,6 +1320,13 @@
   return S_ISDIR(p_realstat->st_mode);
 }
 
+int
+vsf_sysutil_statbuf_is_fifo(const struct vsf_sysutil_statbuf* p_stat)
+{
+  const struct stat* p_realstat = (const struct stat*) p_stat;
+  return S_ISFIFO(p_realstat->st_mode);
+}
+
 const char*
 vsf_sysutil_statbuf_get_perms(const struct vsf_sysutil_statbuf* p_statbuf)
 {
diff -Naur vsftpd-3.0.3.orig/sysutil.h vsftpd-3.0.3/sysutil.h
--- vsftpd-3.0.3.orig/sysutil.h	2012-09-16 11:43:13.000000000 +0530
+++ vsftpd-3.0.3/sysutil.h	2018-01-22 14:16:10.427323169 +0530
@@ -118,6 +118,7 @@
 int vsf_sysutil_statbuf_is_symlink(const struct vsf_sysutil_statbuf* p_stat);
 int vsf_sysutil_statbuf_is_socket(const struct vsf_sysutil_statbuf* p_stat);
 int vsf_sysutil_statbuf_is_dir(const struct vsf_sysutil_statbuf* p_stat);
+int vsf_sysutil_statbuf_is_fifo(const struct vsf_sysutil_statbuf* p_stat);
 filesize_t vsf_sysutil_statbuf_get_size(
   const struct vsf_sysutil_statbuf* p_stat);
 const char* vsf_sysutil_statbuf_get_perms(
