From 5e890931bc9b9107a7b9c7d4c47cdb48949a7091 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 2 Feb 2003 11:35:57 +0000 Subject: [PATCH] Fix hard link -- JobId git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@334 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/ua_restore.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 7ab4a8848c..cbcf54f76c 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -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; } -- 2.39.5