diff -urd vsftpd-1.1.3.orig/Changelog vsftpd-1.1.3/Changelog
--- vsftpd-1.1.3.orig/Changelog	Sat Nov  9 18:17:39 2002
+++ vsftpd-1.1.3/Changelog	Mon Mar 17 21:02:59 2003
@@ -637,3 +637,4 @@
 At this point: 1.1.3 package released
 -------------------------------------
 
+- upload temporary dot prefixed file and rename it when uploaded
diff -urd vsftpd-1.1.3.orig/postlogin.c vsftpd-1.1.3/postlogin.c
--- vsftpd-1.1.3.orig/postlogin.c	Sun Sep 22 23:35:27 2002
+++ vsftpd-1.1.3/postlogin.c	Mon Mar 17 20:33:49 2003
@@ -54,6 +54,7 @@
 static void port_cleanup(struct vsf_session* p_sess);
 static void handle_dir_common(struct vsf_session* p_sess, int full_details);
 static void prepend_path_to_filename(struct mystr* p_str);
+static void add_dot_to_filename(struct mystr* p_str);
 static int get_remote_transfer_fd(struct vsf_session* p_sess);
 static int dispose_remote_transfer_fd(struct vsf_session* p_sess);
 static void handle_sigurg(void* p_private);
@@ -731,9 +732,11 @@
 {
   struct vsf_transfer_ret trans_ret;
   int new_file_fd;
+  int real_file_fd;
   int remote_fd;
   int retval;
   filesize_t offset = p_sess->restart_pos;
+  static struct mystr s_tmp_str;
   p_sess->restart_pos = 0;
   if (!pasv_active(p_sess) && !port_active(p_sess))
   {
@@ -746,7 +749,25 @@
    */
   if (p_sess->is_anonymous && !tunable_anon_other_write_enable)
   {
-    new_file_fd = str_create(&p_sess->ftp_arg_str);
+    /* Create empty file to hold it used */
+    real_file_fd = str_create(&p_sess->ftp_arg_str);
+    if (vsf_sysutil_retval_is_error(real_file_fd))
+    {
+      vsf_cmdio_write(p_sess, FTP_UPLOADFAIL, "Could not create file.");
+      return;
+    }
+    vsf_sysutil_close(real_file_fd);
+    /* create temporary file with prefix '.' */
+    str_copy(&s_tmp_str, &p_sess->ftp_arg_str);
+    add_dot_to_filename(&s_tmp_str);
+    new_file_fd = str_create(&s_tmp_str);
+    if (vsf_sysutil_retval_is_error(new_file_fd))
+    {
+      str_unlink(&p_sess->ftp_arg_str);
+      str_unlink(&s_tmp_str);
+      vsf_cmdio_write(p_sess, FTP_UPLOADFAIL, "Could not create temporary file.");
+      return;
+    }
   }
   else
   {
@@ -804,6 +825,14 @@
   }
   p_sess->transfer_size = trans_ret.transferred;
   /* XXX - handle failure, delete file? */
+
+  if (p_sess->is_anonymous && !tunable_anon_other_write_enable)
+  {
+    retval = str_rename(&s_tmp_str, &p_sess->ftp_arg_str);
+    if (retval != 0)
+      vsf_cmdio_write(p_sess, FTP_FILEFAIL, "Temporary file rename failed.");
+  }
+
   retval = dispose_remote_transfer_fd(p_sess);
   /* Log _after_ the blocking dispose call, so we get transfer times right */
   if (trans_ret.retval == 0 && retval == 0)
@@ -972,6 +1001,33 @@
   }
   str_append_str(&s_tmp_str, p_str);
   str_copy(p_str, &s_tmp_str);
+}
+
+
+static void
+add_dot_to_filename(struct mystr* p_str)
+{
+  struct str_locate_result loc_result;
+  static struct mystr s_tmp_str;
+  static struct mystr s_filename_str;
+
+  loc_result = str_locate_char(p_str, '/');
+  if (loc_result.found)
+  {
+    /* filename with path */
+    str_empty(&s_tmp_str);
+    str_split_char_reverse(p_str, &s_filename_str, '/');
+    str_append_text(p_str, "/.");
+    str_append_str(p_str, &s_filename_str);
+    return;
+  } else {
+    /* filename without path */
+    str_empty(&s_tmp_str);
+    str_alloc_text(&s_tmp_str, ".");
+    str_append_str(&s_tmp_str, p_str);
+    str_copy(p_str, &s_tmp_str);
+    return;
+  }
 }
 
 
diff -urd vsftpd-1.1.3.orig/str.c vsftpd-1.1.3/str.c
--- vsftpd-1.1.3.orig/str.c	Sun Jul 14 21:26:52 2002
+++ vsftpd-1.1.3/str.c	Mon Mar 17 19:26:09 2003
@@ -448,6 +448,15 @@
 }
 
 struct str_locate_result
+str_locate_char_reverse(const struct mystr* p_str, char look_char)
+{
+  char look_str[2];
+  look_str[0] = look_char;
+  look_str[1] = '\0';
+  return str_locate_text_reverse(p_str, look_str);
+}
+
+struct str_locate_result
 str_locate_text_reverse(const struct mystr* p_str, const char* p_text)
 {
   struct str_locate_result retval;
diff -urd vsftpd-1.1.3.orig/str.h vsftpd-1.1.3/str.h
--- vsftpd-1.1.3.orig/str.h	Sun Jul 14 21:27:16 2002
+++ vsftpd-1.1.3/str.h	Mon Mar 17 19:26:07 2003
@@ -75,6 +75,8 @@
   const struct mystr* p_str, char look_char);
 struct str_locate_result str_locate_str(
   const struct mystr* p_str, const struct mystr* p_look_str);
+struct str_locate_result str_locate_char_reverse(
+  const struct mystr* p_str, char look_char);
 struct str_locate_result str_locate_str_reverse(
   const struct mystr* p_str, const struct mystr* p_look_str);
 struct str_locate_result str_locate_text(
