From: Eric Biggers Date: Sat, 27 Apr 2013 19:30:36 +0000 (-0500) Subject: Win32: Do not set file attributes on root directory X-Git-Tag: v1.3.3~21 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=4d09d61542de5f16137192b6d0a9cac1bbf4f468 Win32: Do not set file attributes on root directory --- diff --git a/src/win32.c b/src/win32.c index 5d0bba30..06fd74d6 100644 --- a/src/win32.c +++ b/src/win32.c @@ -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 - * 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))) {