]> wimlib.net Git - wimlib/commitdiff
Win32: Do not set file attributes on root directory
authorEric Biggers <ebiggers3@gmail.com>
Sat, 27 Apr 2013 19:30:36 +0000 (14:30 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 27 Apr 2013 19:30:36 +0000 (14:30 -0500)
src/win32.c

index 5d0bba3052fd80399fc4f7e64c91fff681bfcaec..06fd74d6371fc1ffe1ad94c4ddb1f42bed1c7cab 100644 (file)
@@ -1973,8 +1973,14 @@ win32_begin_extract_unnamed_stream(const struct wim_inode *inode,
 
        /* Set file attributes if we created the file.  Otherwise, we haven't
         * created the file set and we will set the attributes in the call to
 
        /* Set file attributes if we created the file.  Otherwise, we haven't
         * created the file set and we will set the attributes in the call to
-        * CreateFileW(). */
-       if (*creationDisposition_ret == OPEN_EXISTING) {
+        * CreateFileW().
+        *
+        * The FAT filesystem does not let you change the attributes of the root
+        * directory, so treat that as a special case and do not set attributes.
+        * */
+       if (*creationDisposition_ret == OPEN_EXISTING &&
+           !path_is_root_of_drive(path))
+       {
                if (!SetFileAttributesW(path,
                                        win32_mask_attributes(inode->i_attributes)))
                {
                if (!SetFileAttributesW(path,
                                        win32_mask_attributes(inode->i_attributes)))
                {