- if (ret) {
- if (wimlib_print_errors) {
- ERROR_WITH_ERRNO("Failed to set security descriptor "
- "on \"%s\" in NTFS volume",
- dentry_full_path(one_dentry));
- fprintf(stderr, "The security descriptor is: ");
- print_byte_field(desc, desc_size, stderr);
- fprintf(stderr, "\n");
+
+ if (unlikely(ret)) {
+ int err = errno;
+ ERROR_WITH_ERRNO("Failed to set security descriptor on "
+ "\"%s\" in NTFS volume",
+ dentry_full_path(one_dentry));
+ if (err == EINVAL && wimlib_print_errors) {
+ fprintf(wimlib_error_file,
+ "The security descriptor is: ");
+ print_byte_field(desc, desc_size, wimlib_error_file);
+ fprintf(wimlib_error_file, "\n");
+ fprintf(wimlib_error_file,
+ "\nThis error occurred because libntfs-3g thinks "
+ "the security descriptor is invalid. If you "
+ "are extracting a Windows 10 image, this may be "
+ "caused by a known bug in libntfs-3g. See: "
+ "http://wimlib.net/forums/viewtopic.php?f=1&t=4 "
+ "for more information.\n\n");