Release Notes for Bacula 1.31
 
-  Bacula code: Total files = 250 Total lines = 74,253 (*.h *.c *.in)
+  Bacula code: Total files = 250 Total lines = 74,359 (*.h *.c *.in)
 
 Major Changes this Release:
 - The database format has changed. Please see below.
 - Added readline to depkgs (removed from depkgs1) and fixed configuration if
   it is not installed in your system libraries.
 - Implemented generalized tape label formats including counter variables.
+- Implement multiple simultaneous jobs.
 
 
 Other Changes this Release:
 
 - Test multiple simultaneous Volumes
 - Test of last block is correct in JobMedia when splitting file 
   over two volumes.
-
 - Figure out how to use ssh or stunnel to protect Bacula communications.
 
 For 1.31 release:
 - Add restore to specific date.
 - Instrument use_count on DEVICE packets and ensure that the device is
   being close()ed at the appropriate time.
+- Test long path names (>64 chars) in Windows -- crashes FD?
 
 
     char name[1];                    /* The name */
 };
 
+static void free_dir_ff_pkt(FF_PKT *dir_ff_pkt)
+{
+   free(dir_ff_pkt->fname);
+   free(dir_ff_pkt->link);
+   free_pool_memory(dir_ff_pkt->sys_fname);
+   free(dir_ff_pkt);
+}
+
 /*
  * Find a single file.                       
  * handle_file is the callback for handling the file.
       } else {
         ff_pkt->type = FT_DIR;
       }
-      FF_PKT *dir_ff_pkt;
-      dir_ff_pkt = (FF_PKT *)bmalloc(sizeof(FF_PKT));
+
+      /*
+       * Create a temporary ff packet for this directory
+       *   entry, and defer handling the directory until
+       *   we have recursed into it.  This saves the
+       *   directory after all files have been processed, and
+       *   during the restore, the directory permissions will
+       *   be reset after all the files have been restored.
+       */
+      FF_PKT *dir_ff_pkt = (FF_PKT *)bmalloc(sizeof(FF_PKT));
       memcpy(dir_ff_pkt, ff_pkt, sizeof(FF_PKT));
       dir_ff_pkt->fname = bstrdup(ff_pkt->fname);
       dir_ff_pkt->link = bstrdup(ff_pkt->link);
+      dir_ff_pkt->sys_fname = get_pool_memory(PM_FNAME);
        
       ff_pkt->link = ff_pkt->fname;     /* reset "link" */
 
            ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
         }
         free(link);
-        free(dir_ff_pkt->fname);
-        free(dir_ff_pkt->link);
-        free(dir_ff_pkt);
+        free_dir_ff_pkt(dir_ff_pkt);
         return rtn_stat;
       }
 
            ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
         }
         free(link);
-        free(dir_ff_pkt->fname);
-        free(dir_ff_pkt->link);
-        free(dir_ff_pkt);
+        free_dir_ff_pkt(dir_ff_pkt);
         return rtn_stat;
       }
       /* 
-       * Open directory for reading files within 
+       * Decend into or "recurse" into the directory to read
+       *   all the files in it.
        */
       errno = 0;
       if ((directory = opendir(fname)) == NULL) {
            ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
         }
         free(link);
-        free(dir_ff_pkt->fname);
-        free(dir_ff_pkt->link);
-        free(dir_ff_pkt);
+        free_dir_ff_pkt(dir_ff_pkt);
         return rtn_stat;
       }
 
       if (ff_pkt->linked) {
         ff_pkt->linked->FileIndex = dir_ff_pkt->FileIndex;
       }
-      free(dir_ff_pkt->fname);
-      free(dir_ff_pkt->link);
-      free(dir_ff_pkt);
+      free_dir_ff_pkt(dir_ff_pkt);
 
       if (ff_pkt->atime_preserve) {
         utime(fname, &restore_times);