- ret = ntfs_3g_restore_dos_name(NULL, NULL, dentry, ctx->vol);
- if (ret)
- return ret;
- ret = report_file_created(&ctx->common);
- if (ret)
- return ret;
+ if (dentry_has_short_name(dentry)) {
+ ret = ntfs_3g_restore_dos_name(NULL, NULL, dentry,
+ ctx->vol);
+ if (ret)
+ return ret;
+ ret = report_file_created(&ctx->common);
+ if (ret)
+ return ret;
+ }
+ if (ntfs_3g_has_empty_attributes(inode)) {
+ ntfs_inode *ni;
+
+ ret = WIMLIB_ERR_NTFS_3G;
+ ni = ntfs_inode_open(ctx->vol, inode->i_mft_no);
+ if (ni) {
+ ret = ntfs_3g_create_empty_attributes(ni, inode,
+ ctx);
+ if (ntfs_inode_close(ni) && !ret)
+ ret = WIMLIB_ERR_NTFS_3G;
+ }
+ if (ret) {
+ ERROR_WITH_ERRNO("Failed to create empty "
+ "attributes of directory "
+ "\"%s\" in NTFS volume",
+ dentry_full_path(dentry));
+ return ret;
+ }
+ }