+ if (ntfs_inode_close_in_dir(ni, dir_ni) != 0) {
+ ERROR_WITH_ERRNO("Failed to close new inode");
+ ret = WIMLIB_ERR_NTFS_3G;
+ goto out;
+ } else {
+ DEBUG("Closed inode `%s'", dentry->full_path_utf8);
+ }
+ if (ntfs_inode_close(dir_ni) != 0) {
+ ret = WIMLIB_ERR_NTFS_3G;
+ ERROR_WITH_ERRNO("Failed to close directory inode");
+ goto out;
+ } else {
+ DEBUG("Closed parent inode");
+ }
+ if (dentry->security_id != -1) {
+ wimlib_assert(dentry->security_id < sd->num_entries);
+ DEBUG("Applying security descriptor %d to `%s'",
+ dentry->security_id, dentry->full_path_utf8);
+ ret = ntfs_set_file_security(scapi, dentry->full_path_utf8,
+ ~0,
+ sd->descriptors[dentry->security_id]);
+ if (ret != 0) {
+ ERROR_WITH_ERRNO("Failed to set security data on `%s'",
+ dentry->full_path_utf8);
+ ret = WIMLIB_ERR_NTFS_3G;
+ goto out;
+ }
+ }
+ DEBUG("Setting file attributes 0x%x on `%s'",
+ dentry->attributes, dentry->full_path_utf8);
+ if (!ntfs_set_file_attributes(scapi, dentry->full_path_utf8,
+ dentry->attributes)) {
+ ERROR_WITH_ERRNO("Failed to set NTFS file attributes on `%s'",
+ dentry->full_path_utf8);
+ ret = WIMLIB_ERR_NTFS_3G;
+ goto out;
+ }