Fix bug that causes send_file_list to send no data
authorSam Hartman <hartmans@mit.edu>
Fri, 29 Aug 1997 03:59:43 +0000 (03:59 +0000)
committerSam Hartman <hartmans@mit.edu>
Fri, 29 Aug 1997 03:59:43 +0000 (03:59 +0000)
on short directories in safe mode.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10185 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftpd/ChangeLog
src/appl/gssftp/ftpd/ftpd.c

index 9b4ca1e05607d0bb68dddf6eb4129e190bf5d8c0..d43bbdbaf5cf2ace6019945062fc6bee7a0c8b3d 100644 (file)
@@ -1,3 +1,7 @@
+Thu Aug 28 23:48:27 1997  Sam Hartman  <hartmans@luminous.mesas.com>
+
+       * ftpd.c (send_file_list): Flush the data before closing it.
+
 Sun Aug 17 14:24:09 1997  Ezra Peisach  <epeisach@mit.edu>
 
        * Makefile.in (SRCS): Add $(srcdir) where needed.
index b4a5794b9b404cec1eee7e214afc9650de377dc5..aedacdf4e00ed58e0ea0c7ee99f90129c6030e4b 100644 (file)
@@ -2221,7 +2221,11 @@ send_file_list(whichfiles)
                }
                (void) closedir(dirp);
        }
-       ret = secure_write(fileno(dout), "", 0);
+       if (dout != NULL ) {
+         ret = secure_write(fileno(dout), "", 0);
+         if (ret >= 0)
+           ret = secure_flush(fileno(dout));
+       }
 data_err:
        if (dout == NULL)
                reply(550, "No files found.");
@@ -2232,7 +2236,7 @@ data_err:
 
        transflag = 0;
        if (dout != NULL)
-               (void) fclose(dout);
+         (void) fclose(dout);
        data = -1;
        pdata = -1;
 }