diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-12-23 19:32:31 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-12-23 20:19:46 +0100 |
commit | 04a80b89b8cd0d3b4d7a68d60f9c4f3ca56a9b72 (patch) | |
tree | 4b5db515c34ac497b802a621688a526fdd153957 /lib/fstree/hardlink.c | |
parent | 111702799a5a46e84a9bc54823a7fb9aae6a91cc (diff) |
Simplify hard link handling
- For now, enforce that hard links don't point to a directories.
- Instead of doing the swaping trickery, just reorder the flat list
and hand out new inode numbers.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree/hardlink.c')
-rw-r--r-- | lib/fstree/hardlink.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/fstree/hardlink.c b/lib/fstree/hardlink.c index 8a79d46..e71670a 100644 --- a/lib/fstree/hardlink.c +++ b/lib/fstree/hardlink.c @@ -57,6 +57,11 @@ int fstree_resolve_hard_link(fstree_t *fs, tree_node_t *node) } } + if (S_ISDIR(node->mode)) { + errno = EPERM; + return -1; + } + start->mode = FSTREE_MODE_HARD_LINK_RESOLVED; start->data.target_node = node; |