From 4d09d61542de5f16137192b6d0a9cac1bbf4f468 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 27 Apr 2013 14:30:36 -0500 Subject: [PATCH] Win32: Do not set file attributes on root directory --- src/win32.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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))) { -- 2.43.0