From: Eric Biggers Date: Wed, 22 May 2013 05:04:38 +0000 (-0500) Subject: read_metadata_resource(): Check for named root here X-Git-Tag: v1.4.1~34 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=94b1f82c62aa6fd381e89a7b08254c1dd90ac55c read_metadata_resource(): Check for named root here --- diff --git a/src/metadata_resource.c b/src/metadata_resource.c index 109b0d32..e600f301 100644 --- a/src/metadata_resource.c +++ b/src/metadata_resource.c @@ -150,6 +150,16 @@ read_metadata_resource(WIMStruct *wim, struct wim_image_metadata *imd) goto out_free_security_data; } + if (dentry_has_long_name(root) || dentry_has_short_name(root)) { + WARNING("The root directory has a nonempty name (removing it)"); + FREE(root->file_name); + FREE(root->short_name); + root->file_name = NULL; + root->short_name = NULL; + root->file_name_nbytes = 0; + root->short_name_nbytes = 0; + } + /* This is the root dentry, so set its parent to itself. */ root->parent = root; diff --git a/src/verify.c b/src/verify.c index d348e302..5f7924b5 100644 --- a/src/verify.c +++ b/src/verify.c @@ -124,7 +124,6 @@ verify_dentry(struct wim_dentry *dentry, void *wim) { int ret; WIMStruct *w = wim; - /* Verify the associated inode, but only one time no matter how many * dentries it has (unless we are doing a full verification of the WIM, * in which case we need to force the inode to be verified again.) */ @@ -133,35 +132,6 @@ verify_dentry(struct wim_dentry *dentry, void *wim) if (ret) return ret; } - - /* Make sure root dentry is unnamed, while every other dentry has at - * least a long name. - * - * I am assuming that dentries having only a DOS name is illegal; i.e., - * Windows will always combine the Win32 name and DOS name for a file - * into a single WIM dentry, even if they are stored separately on NTFS. - * (This seems to be the case...) */ - if (dentry_is_root(dentry)) { - if (dentry_has_long_name(dentry) || dentry_has_short_name(dentry)) { - WARNING("The root dentry has a nonempty name"); - FREE(dentry->file_name); - FREE(dentry->short_name); - dentry->file_name = NULL; - dentry->short_name = NULL; - dentry->file_name_nbytes = 0; - dentry->short_name_nbytes = 0; - } - } - -#if 0 - /* Check timestamps */ - if (inode->i_last_access_time < inode->i_creation_time || - inode->i_last_write_time < inode->i_creation_time) { - WARNING("Dentry `%"TS"' was created after it was last accessed or " - "written to", dentry->full_path); - } -#endif - return 0; }