X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fhardlink.c;h=5e2c62618ad43b5e2641d97a31cb86f899425e97;hp=90446f98e0a123a4a14f19a4154aa298aa692589;hb=1c940d499beb539f846ed2509e3fee7772adf250;hpb=c7f1c7e38a23290bd5edd2a70c234875cc299901 diff --git a/src/hardlink.c b/src/hardlink.c index 90446f98..5e2c6261 100644 --- a/src/hardlink.c +++ b/src/hardlink.c @@ -23,10 +23,14 @@ * along with wimlib; if not, see http://www.gnu.org/licenses/. */ -#include "wimlib_internal.h" -#include "dentry.h" -#include "list.h" -#include "lookup_table.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/capture.h" +#include "wimlib/dentry.h" +#include "wimlib/error.h" +#include "wimlib/lookup_table.h" /* NULL NULL * ^ ^ @@ -342,6 +346,13 @@ fix_nominal_inode(struct wim_inode *inode, struct list_head *inode_list, wimlib_assert(inode->i_nlink == inode_link_count(inode)); + if (inode->i_nlink > 1 && + (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)) + { + ERROR("Found unsupported directory hard link!"); + return WIMLIB_ERR_INVALID_DENTRY; + } + LIST_HEAD(dentries_with_data_streams); LIST_HEAD(dentries_with_no_data_streams); HLIST_HEAD(true_inodes);