Backed out the change to create missing parent directories when using
authorDavid Dykstra <dwd@samba.org>
Wed, 24 Mar 1999 19:28:03 +0000 (19:28 +0000)
committerDavid Dykstra <dwd@samba.org>
Wed, 24 Mar 1999 19:28:03 +0000 (19:28 +0000)
--compare-dest.  It was due to an incomplete analysis of the problem,
sorry.  I left a comment in its place indicating that normally the
parent directories should already have been created.

It turned out to actually be a bug in nsbd in which it was not always
including all the parent directories in the include list like it was
supposed to.  The files themselves were still being sent but that was only
because my exclude_the_rest optimization was kicking in; if it weren't,
excluding the parent directories would have had the side effect of
excluding the files too.  So it really had nothing to do with the
--compare-dest option after all, just with the requirement that if you use
--exclude '*' you need to explicitly include all parent directories of
files you include.

receiver.c

index 816d69f..2b8869d 100644 (file)
@@ -417,8 +417,10 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
                fd2 = do_open(fnametmp,O_WRONLY|O_CREAT|O_EXCL,
                              file->mode & INITACCESSPERMS);
 
-               if (fd2 == -1 && errno == ENOENT && 
-                   (relative_paths || (compare_dest != NULL)) &&
+               /* in most cases parent directories will already exist
+                  because their information should have been previously
+                  transferred, but that may not be the case with -R */
+               if (fd2 == -1 && relative_paths && errno == ENOENT && 
                    create_directory_path(fnametmp) == 0) {
                        fd2 = do_open(fnametmp,O_WRONLY|O_CREAT|O_EXCL,
                                      file->mode & INITACCESSPERMS);