From: Eric Bollengier Date: Tue, 23 May 2017 08:37:26 +0000 (+0200) Subject: Fix #2803 about error message during restore session with 'cd /' X-Git-Tag: Release-7.9.0 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c6064c3a1bf0db4047fce7c4a291eb108c5386a2;p=bacula%2Fbacula Fix #2803 about error message during restore session with 'cd /' --- diff --git a/bacula/src/lib/tree.c b/bacula/src/lib/tree.c index 99baddbccd..3cae5bbf67 100644 --- a/bacula/src/lib/tree.c +++ b/bacula/src/lib/tree.c @@ -93,6 +93,7 @@ TREE_ROOT *new_tree(int count) root->cached_path = get_pool_memory(PM_FNAME); root->type = TN_ROOT; root->fname = ""; + root->can_access = 1; HL_ENTRY* entry = NULL; root->hardlinks.init(entry, &entry->link, 0); return root; @@ -108,6 +109,7 @@ static TREE_NODE *new_tree_node(TREE_ROOT *root) node = (TREE_NODE *)tree_alloc(root, size); memset(node, 0, size); node->delta_seq = -1; + node->can_access = 1; return node; } @@ -328,8 +330,6 @@ static TREE_NODE *search_and_insert_tree_node(char *fname, int type, strcpy(node->fname, fname); node->parent = parent; node->type = type; - node->can_access = true; - /* Maintain a linear chain of nodes */ if (!root->first) { root->first = node; diff --git a/bacula/src/lib/tree.h b/bacula/src/lib/tree.h index 1c6681c261..7a2467cc1f 100644 --- a/bacula/src/lib/tree.h +++ b/bacula/src/lib/tree.h @@ -90,9 +90,11 @@ struct s_tree_root { unsigned int type: 8; /* node type */ unsigned int extract: 1; /* extract item */ unsigned int extract_dir: 1; /* extract dir entry only */ - unsigned int have_link: 1; /* set if have hard link */ + unsigned int hard_link: 1; /* set if have hard link */ + unsigned int soft_link: 1; /* set if is soft link */ unsigned int inserted: 1; /* set when newly inserted */ unsigned int loaded: 1; /* set when the dir is in the tree */ + unsigned int can_access: 1; /* Can access to this node */ struct s_tree_node *parent; struct s_tree_node *next; /* next hash of FileIndex */ struct delta_list *delta_list; /* delta parts for this node */