]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix hard link -- JobId
authorKern Sibbald <kern@sibbald.com>
Sun, 2 Feb 2003 11:35:57 +0000 (11:35 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 2 Feb 2003 11:35:57 +0000 (11:35 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@334 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/ua_restore.c

index 7ab4a8848c13b32add952d6b89ade2f9f6b4774c..cbcf54f76c1c47497a2ca949b32c17a5116c23b2 100644 (file)
@@ -930,12 +930,14 @@ static void set_extract(UAContext *ua, TREE_NODE *node, TREE_CTX *tree, int valu
       if (db_get_file_attributes_record(ua->jcr, ua->db, cwd, &fdbr)) {
         uint32_t LinkFI;
         decode_stat(fdbr.LStat, &statp, &LinkFI); /* decode stat pkt */
-        /* If we point to a hard linked file, traverse the tree to
-         * find that file, and mark it for restoration as well.
+        /*
+         * If we point to a hard linked file, traverse the tree to
+         * find that file, and mark it for restoration as well. It
+         * must have the Link we just obtained and the same JobId.
          */
         if (LinkFI) {
            for (n=first_tree_node(tree->root); n; n=next_tree_node(n)) {
-              if (n->FileIndex == LinkFI) {
+              if (n->FileIndex == LinkFI && n->JobId == node->JobId) {
                  n->extract = 1;
                  break;
               }