]> wimlib.net Git - wimlib/blobdiff - src/hardlink.c
Win32: Fix drive root detection with \\?\-style paths
[wimlib] / src / hardlink.c
index 90446f98e0a123a4a14f19a4154aa298aa692589..5e2c62618ad43b5e2641d97a31cb86f899425e97 100644 (file)
  * 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);