]> wimlib.net Git - wimlib/blobdiff - src/template.c
Warn rather than abort if SHA-1 is same but size is different
[wimlib] / src / template.c
index 7e0b92c04177e22054a8a4ee0e1b433c24704e26..1c018df7db28f4ac678582e718c729480732d4d3 100644 (file)
@@ -114,7 +114,8 @@ inode_copy_checksums(struct wim_inode *inode,
 
                back_ptr = retrieve_pointer_to_unhashed_blob(blob);
                copy_hash(blob->hash, template_blob->hash);
-               if (after_blob_hashed(blob, back_ptr, blob_table) != blob)
+               if (after_blob_hashed(blob, back_ptr, blob_table,
+                                     inode) != blob)
                        free_blob_descriptor(blob);
        }
 }
@@ -123,7 +124,7 @@ static int
 reference_template_file(struct wim_inode *inode, WIMStruct *wim,
                        WIMStruct *template_wim)
 {
-       struct wim_dentry *dentry = inode_first_dentry(inode);
+       struct wim_dentry *dentry = inode_any_dentry(inode);
        struct wim_dentry *template_dentry;
        int ret;
 
@@ -172,7 +173,7 @@ wimlib_reference_template_image(WIMStruct *wim, int new_image,
                return WIMLIB_ERR_METADATA_NOT_FOUND;
 
        new_imd = wim->image_metadata[new_image - 1];
-       if (!new_imd->modified)
+       if (!is_image_dirty(new_imd))
                return WIMLIB_ERR_INVALID_PARAM;
 
        ret = select_wim_image(template_wim, template_image);