]> wimlib.net Git - wimlib/commitdiff
verify_dentry(): Allow multiple DOS names per inode (for UDF)
authorEric Biggers <ebiggers3@gmail.com>
Tue, 21 May 2013 01:18:18 +0000 (20:18 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 21 May 2013 01:18:18 +0000 (20:18 -0500)
include/wimlib/dentry.h
src/ntfs-3g_apply.c
src/verify.c
src/win32_apply.c

index e515abec732b26c722d83c0b10ecad362a71c331..3b0de793c96a82e8368b3e09f906e8aa1d0fb9de 100644 (file)
@@ -157,10 +157,13 @@ struct wim_dentry {
        /* Does this dentry need to be extracted? */
        u8 needs_extraction : 1;
 
+       u8 not_extracted : 1;
+
        /* Only used during NTFS capture */
        u8 is_win32_name : 1;
 
-       u8 not_extracted : 1;
+       /* Set to 1 if an inode has multiple DOS names. */
+       u8 dos_name_invalid : 1;
 
        /* Temporary list */
        struct list_head tmp_list;
index ffe3a8b0572253dc6ab8333d139f6a65db6e58d0..0de2bb042da01fc98a5421a5f7567ad60f1775d7 100644 (file)
@@ -458,7 +458,8 @@ do_apply_dentry_ntfs(struct wim_dentry *dentry, ntfs_inode *dir_ni,
        }
 
        /* Set DOS (short) name if given */
-       if (dentry_has_short_name(dentry)) {
+       if (dentry_has_short_name(dentry) && !dentry->dos_name_invalid)
+       {
                char *short_name_mbs;
                size_t short_name_mbs_nbytes;
                ret = utf16le_to_tstr(dentry->short_name,
index 56e77ef759f1ac4fb7bda0e844894af8658895df..a4be1f8b1ccc7d9105905d483bb3ba3a2546953f 100644 (file)
@@ -104,11 +104,19 @@ verify_inode(struct wim_inode *inode, const WIMStruct *w)
        inode_for_each_dentry(dentry, inode) {
                if (dentry_has_short_name(dentry)) {
                        if (dentry_with_dos_name) {
+                               /* This was previously an error, but if we
+                                * capture a WIM from UDF on Windows, hard links
+                                * are supported but DOS names are automatically
+                                * generated for all names for an inode.  */
+                       #if 0
                                ERROR("Hard-linked file has a DOS name at "
                                      "both `%"TS"' and `%"TS"'",
                                      dentry_full_path(dentry_with_dos_name),
                                      dentry_full_path(dentry));
                                return WIMLIB_ERR_INVALID_DENTRY;
+                       #else
+                               dentry->dos_name_invalid = 1;
+                       #endif
                        }
                        dentry_with_dos_name = dentry;
                }
index 972224efad978188b191c217508fe734ba2fd2a8..f022e1d0bb1d2646e9edf291f51badd0a66e792c 100644 (file)
@@ -734,7 +734,7 @@ win32_finish_extract_stream(HANDLE h, const struct wim_dentry *dentry,
                                return ret;
                }
 
-               if (dentry_has_short_name(dentry))
+               if (dentry_has_short_name(dentry) && !dentry->dos_name_invalid)
                        SetFileShortNameW(h, dentry->short_name);
                else if (running_on_windows_7_or_later())
                        SetFileShortNameW(h, L"");